From a67d3ed599c63301e8ee67a7066cc5eea2a8adfa Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 25 Oct 2019 00:06:39 +0200 Subject: [PATCH] Set autoreplace characters with unicode code instead to make it easier to read the source code --- nw/config.py | 4 ++-- nw/gui/doceditor.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nw/config.py b/nw/config.py index dbe6c3c5..6baf30a2 100644 --- a/nw/config.py +++ b/nw/config.py @@ -87,8 +87,8 @@ class Config: self.doReplaceDots = True self.wordCountTimer = 5.0 - self.fmtSingleQuotes = ["‘","’"] - self.fmtDoubleQuotes = ["“","”"] + self.fmtSingleQuotes = ["\u2018","\u2019"] + self.fmtDoubleQuotes = ["\u201c","\u201d"] self.spellLanguage = "en_GB" diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 88d2460f..3ecc9f3c 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -422,15 +422,15 @@ class GuiDocEditor(QTextEdit): elif self.mainConf.doReplaceDash and theTwo == "--": theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 2) - theCursor.insertText("–") + theCursor.insertText("\u2013") - elif self.mainConf.doReplaceDash and theTwo == "–-": + elif self.mainConf.doReplaceDash and theTwo == "\u2013-": theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 2) - theCursor.insertText("—") + theCursor.insertText("\u2014") elif self.mainConf.doReplaceDots and theThree == "...": theCursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor, 3) - theCursor.insertText("…") + theCursor.insertText("\u2026") return