- in the TCL completer if the word is already complete don't add it again but add a space

This commit is contained in:
Marius Stanciu 2019-03-25 03:35:26 +02:00
parent 9648bcd693
commit f8cbafe84d
3 changed files with 28 additions and 1 deletions

View File

@ -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))

View File

@ -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

View File

@ -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:])