From 0acea8877a73db97eaa367f10963ea7b69271d9d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 16 Aug 2020 13:15:25 +0200 Subject: [PATCH] Added the option to replace 3 hypens with emdash, not just endash+hyphen --- nw/gui/doceditor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 0b2790cf..b455be7f 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -891,6 +891,10 @@ class GuiDocEditor(QTextEdit): else: theCursor.insertText(self.typSQClose) + elif self.mainConf.doReplaceDash and theThree == "---": + theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 3) + theCursor.insertText(nwUnicode.U_EMDASH) + elif self.mainConf.doReplaceDash and theTwo == "--": theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 2) theCursor.insertText(nwUnicode.U_ENDASH)