From 8e9f6ce4c7f13715e140ea502b34a2349c4e663e Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sun, 26 May 2019 00:37:23 +0200 Subject: [PATCH] Don't spellcheck command lines, and uppercase words --- nw/gui/dochighlight.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index 4db6267a..697b2dea 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -194,13 +194,14 @@ class GuiDocHighlighter(QSyntaxHighlighter): self.setCurrentBlockState(0) - if self.theDict is None or not self.spellCheck: + if self.theDict is None or not self.spellCheck or theText.startswith("@"): return rxSpell = self.spellRx.globalMatch(theText.replace("_"," "), 0) while rxSpell.hasNext(): rxMatch = rxSpell.next() if not self.theDict.check(rxMatch.captured(0)): + if rxMatch.captured(0) == rxMatch.captured(0).upper(): continue xPos = rxMatch.capturedStart(0) xLen = rxMatch.capturedLength(0) spFmt = self.format(xPos)