From 4feecf48635a0c270cf41d11918aa0bf4df9a737 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Fri, 28 Jan 2022 21:32:15 +0000 Subject: [PATCH] Fix highlighting to correctly highlight things like =='aa'. Given the way highlighting works, this change will break highlighting for statements like for a in $tags:'aa' rof. I think that strings following operators is far more common than strings following the colon in a for statement. --- src/calibre/gui2/dialogs/template_dialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/template_dialog.py b/src/calibre/gui2/dialogs/template_dialog.py index a5b11ce1eb..6454aaffa7 100644 --- a/src/calibre/gui2/dialogs/template_dialog.py +++ b/src/calibre/gui2/dialogs/template_dialog.py @@ -82,7 +82,7 @@ class TemplateHighlighter(QSyntaxHighlighter): r"|\b[+-]?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\b", "number") - a(r"""(?:[^:]'[^']*'|"[^"]*")""", "string") + a(r"""(?