Improve the insert keyword feature when in the middle of a paragraph
This commit is contained in:
@@ -773,11 +773,16 @@ class GuiDocEditor(QTextEdit):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
theCursor.beginEditBlock()
|
theCursor.beginEditBlock()
|
||||||
|
|
||||||
if theBlock.length() > 1:
|
if theBlock.length() > 1:
|
||||||
|
theCursor.setPosition(theBlock.position() + theBlock.length() - 1)
|
||||||
theCursor.insertText("\n")
|
theCursor.insertText("\n")
|
||||||
|
|
||||||
theCursor.insertText("%s: " % keyWord)
|
theCursor.insertText("%s: " % keyWord)
|
||||||
theCursor.endEditBlock()
|
theCursor.endEditBlock()
|
||||||
|
|
||||||
|
self.setTextCursor(theCursor)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def closeSearch(self):
|
def closeSearch(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user