From: Urban Wallasch Date: Mon, 14 Jun 2021 13:16:28 +0000 (+0200) Subject: * Optimized result highlighter callback. X-Git-Tag: v0.1.0~144 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=1a6701e2900c0c0640e729d7d26db08eb481f70d;p=jiten-pai.git * Optimized result highlighter callback. --- diff --git a/jiten-pai.py b/jiten-pai.py index 5f8267e..00c4082 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -232,10 +232,9 @@ class jpMainWindow(QMainWindow): re_term = re.compile(self.search_box.lineEdit().text(), re.IGNORECASE) nfmt = '
' % (cfg['font'], cfg['font_sz']) lfmt = '' % (cfg['lfont'], cfg['lfont_sz']) - hl = '' % cfg['hl_col'] html = [nfmt] def hl_repl(match): - return hl + match.group(0) + '' + return '%s' % (cfg['hl_col'], match.group(0)) for res in result: # highlight matches for i in range(len(res)):