rename: keyhandler_abort -> KEYHANDLER_ABORT (#172)

with the exception of arrays, all other var names in config.h are in ALL
CAPS. since keyhandler_abort is an unreleased feature, it should be okay
to rename it for consistency.

though.. in the future we should be more careful about naming when
adding new vars to config.h (or the codebase in general.)
This commit is contained in:
N-R-K 2021-11-24 17:38:25 +06:00 committed by GitHub
parent 7d87e6e412
commit 0262988671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -75,7 +75,7 @@ static const int THUMB_SIZE = 3;
static const int ignore_mask = Mod2Mask | LockMask; static const int ignore_mask = Mod2Mask | LockMask;
/* abort the keyhandler */ /* abort the keyhandler */
static const KeySym keyhandler_abort = XK_Escape; static const KeySym KEYHANDLER_ABORT = XK_Escape;
/* keyboard mappings for image and thumbnail mode: */ /* keyboard mappings for image and thumbnail mode: */
static const keymap_t keys[] = { static const keymap_t keys[] = {

4
main.c
View file

@ -499,7 +499,7 @@ void handle_key_handler(bool init)
if (init) { if (init) {
close_info(); close_info();
snprintf(win.bar.l.buf, win.bar.l.size, "Getting key handler input " snprintf(win.bar.l.buf, win.bar.l.size, "Getting key handler input "
"(%s to abort)...", XKeysymToString(keyhandler_abort)); "(%s to abort)...", XKeysymToString(KEYHANDLER_ABORT));
} else { /* abort */ } else { /* abort */
open_info(); open_info();
update_info(); update_info();
@ -642,7 +642,7 @@ static void on_keypress(XKeyEvent *kev)
} }
if (IsModifierKey(ksym)) if (IsModifierKey(ksym))
return; return;
if (extprefix && ksym == keyhandler_abort && MODMASK(kev->state) == 0) { if (extprefix && ksym == KEYHANDLER_ABORT && MODMASK(kev->state) == 0) {
handle_key_handler(false); handle_key_handler(false);
} else if (extprefix) { } else if (extprefix) {
run_key_handler(XKeysymToString(ksym), kev->state & ~sh); run_key_handler(XKeysymToString(ksym), kev->state & ~sh);