From 4176b8843743f88166491497c4f228b6be2346fc Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Tue, 23 Apr 2019 17:12:14 +0200 Subject: [PATCH] Removing edit block begin and end seems to help --- nw/gui/doceditor.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 39429b96..a0b516d1 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -168,52 +168,38 @@ class GuiDocEditor(QTextEdit): theThree = theText[thePos-3:thePos] if self.mainConf.doReplaceDQuote and theTwo == " \"": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 1) theCursor.insertText(self.typDQOpen) - theCursor.endEditBlock() elif self.mainConf.doReplaceDQuote and theOne == "\"": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 1) if thePos == 1: theCursor.insertText(self.typDQOpen) else: theCursor.insertText(self.typDQClose) - theCursor.endEditBlock() elif self.mainConf.doReplaceSQuote and theTwo == " '": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 1) theCursor.insertText(self.typSQOpen) - theCursor.endEditBlock() elif self.mainConf.doReplaceSQuote and theOne == "'": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 1) if thePos == 1: theCursor.insertText(self.typSQOpen) else: theCursor.insertText(self.typSQClose) - theCursor.endEditBlock() elif self.mainConf.doReplaceDash and theTwo == "--": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 2) theCursor.insertText("–") - theCursor.endEditBlock() elif self.mainConf.doReplaceDash and theTwo == "–-": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 2) theCursor.insertText("—") - theCursor.endEditBlock() elif self.mainConf.doReplaceDots and theThree == "...": - theCursor.beginEditBlock() theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 3) theCursor.insertText("…") - theCursor.endEditBlock() return