diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-08-21 18:00:14 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-08-22 15:22:27 +0200 |
commit | 7269faf651cbb789156113df0a540943a24ded27 (patch) | |
tree | 908fcac816388260272aaeac27556ef22b8fae0e | |
parent | 7146059645dd87a4b46920223a0aa9881202f4e2 (diff) |
Only request selection index in ColorsPanel when needed
-rw-r--r-- | ColorsPanel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ColorsPanel.c b/ColorsPanel.c index e9c44b02..86c2023f 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -49,7 +49,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { ColorsPanel* this = (ColorsPanel*) super; HandlerResult result = IGNORED; - int mark = Panel_getSelectedIndex(super); + int mark; switch(ch) { case 0x0a: @@ -58,6 +58,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { case KEY_MOUSE: case KEY_RECLICK: case ' ': + mark = Panel_getSelectedIndex(super); assert(mark >= 0); assert(mark < LAST_COLORSCHEME); for (int i = 0; ColorSchemeNames[i] != NULL; i++) |