Improve the insert keyword feature when in the middle of a paragraph

This commit is contained in:
Veronica K. B. Olsen
2020-11-21 15:16:02 +01:00
parent 6087506cf0
commit 108b99f99b
+5
View File
@@ -773,11 +773,16 @@ class GuiDocEditor(QTextEdit):
return False
theCursor.beginEditBlock()
if theBlock.length() > 1:
theCursor.setPosition(theBlock.position() + theBlock.length() - 1)
theCursor.insertText("\n")
theCursor.insertText("%s: " % keyWord)
theCursor.endEditBlock()
self.setTextCursor(theCursor)
return True
def closeSearch(self):