From f8cbafe84dd3745bebae324e5219f2f21d4f32c0 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 25 Mar 2019 03:35:26 +0200 Subject: [PATCH] - in the TCL completer if the word is already complete don't add it again but add a space --- FlatCAMApp.py | 10 +++++++++- README.md | 5 +++++ flatcamGUI/GUIElements.py | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 54b6be65..9ae476e1 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -91,7 +91,7 @@ class App(QtCore.QObject): # Version version = 8.913 - version_date = "2019/03/23" + version_date = "2019/03/25" beta = True # current date now @@ -5835,6 +5835,14 @@ class App(QtCore.QObject): "# CREATE A NEW FLATCAM TCL SCRIPT\n" "# TCL Tutorial here: https://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html\n" "#\n\n" + "# FlatCAM commands list:\n" + "# AddCircle, AddPolygon, AddPolyline, AddRectangle, AlignDrill, AlignDrillGrid, ClearShell, Cncjob,\n" + "# Cutout, Delete, Drillcncjob, ExportGcode, ExportSVG, Exteriors, GeoCutout, GeoUnion, GetNames, GetSys,\n" + "# ImportSvg, Interiors, Isolate, Follow, JoinExcellon, JoinGeometry, ListSys, MillHoles, Mirror, New,\n" + "# NewGeometry, Offset, OpenExcellon, OpenGCode, OpenGerber, OpenProject, Options, Paint, Panelize,\n" + "# Plot, SaveProject, SaveSys, Scale, SetActive, SetSys, Skew, SubtractPoly,SubtractRectangle, Version,\n" + "# WriteGCode\n" + "#\n\n" )) self.ui.buttonOpen.clicked.connect(lambda: self.handleOpen(filt=flt)) diff --git a/README.md b/README.md index b8247ef4..dc9f822e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ CAD program, and create G-Code for Isolation routing. ================================================= +25.03.2019 + +- in the TCL completer if the word is already complete don't add it again but add a space + + 22.03.2019 - fixed an error that created a situation that when saving a project with some of the CNCJob objects disabled, on project reload the CNCJob objects are no longer loaded diff --git a/flatcamGUI/GUIElements.py b/flatcamGUI/GUIElements.py index e38b53f1..d28f1d2d 100644 --- a/flatcamGUI/GUIElements.py +++ b/flatcamGUI/GUIElements.py @@ -509,6 +509,13 @@ class FCTextAreaExtended(QtWidgets.QTextEdit): def insertCompletion(self, completion): tc = self.textCursor() extra = (len(completion) - len(self.completer.completionPrefix())) + + # don't insert if the word is finished but add a space instead + if extra == 0: + tc.insertText(' ') + self.completer.popup().hide() + return + tc.movePosition(QTextCursor.Left) tc.movePosition(QTextCursor.EndOfWord) tc.insertText(completion[-extra:]) @@ -1454,6 +1461,13 @@ class _ExpandableTextEdit(QTextEdit): def insertCompletion(self, completion): tc = self.textCursor() extra = (len(completion) - len(self.completer.completionPrefix())) + + # don't insert if the word is finished but add a space instead + if extra == 0: + tc.insertText(' ') + self.completer.popup().hide() + return + tc.movePosition(QTextCursor.Left) tc.movePosition(QTextCursor.EndOfWord) tc.insertText(completion[-extra:])