From fa4f4a8db47c85f813406022a3658a8f96b88026 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 13 Jun 2021 18:32:11 +0200 Subject: [PATCH] Make the comment format action a toggle feature --- nw/gui/doceditor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index a03c5927..32b50ebc 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -1728,9 +1728,13 @@ class GuiDocEditor(QTextEdit): elif theText.startswith("% "): newText = theText[2:] cOffset = 2 + if docAction == nwDocAction.BLOCK_COM: + docAction = nwDocAction.BLOCK_TXT elif theText.startswith("%"): newText = theText[1:] cOffset = 1 + if docAction == nwDocAction.BLOCK_COM: + docAction = nwDocAction.BLOCK_TXT elif theText.startswith("# "): newText = theText[2:] cOffset = 2