summaryrefslogtreecommitdiff
path: root/lulua
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2020-12-12 14:21:30 +0100
committerLars-Dominik Braun <lars@6xq.net>2020-12-12 14:24:48 +0100
commit0b568ab6409410aa78c28f48824b8ff5b338c3af (patch)
treec1db678773a3cc020545677bc534e2247a5aa010 /lulua
parent8d862f25cef71ee22d6734ae2cf3f8c2f99146e7 (diff)
downloadlulua-0b568ab6409410aa78c28f48824b8ff5b338c3af.tar.gz
lulua-0b568ab6409410aa78c28f48824b8ff5b338c3af.tar.bz2
lulua-0b568ab6409410aa78c28f48824b8ff5b338c3af.zip
render: Draw highlights only if visible
Saves ~4KiB on files without highlights
Diffstat (limited to 'lulua')
-rw-r--r--lulua/render.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lulua/render.py b/lulua/render.py
index 93d197e..bc09e4c 100644
--- a/lulua/render.py
+++ b/lulua/render.py
@@ -107,7 +107,8 @@ class Renderer:
gCap.add (self._drawMarker (btnWidth, btnPos))
highlight = self.keyHighlight.get (btn.name, 0)
- gHighlight.add (self._drawHighlight (highlight, btnWidth, btnPos))
+ if highlight > 0:
+ gHighlight.add (self._drawHighlight (highlight, btnWidth, btnPos))
l = self._drawLabel (buttonText, btnWidth, btnPos)
if isModifier: