From 829066cbb25a149f259f83212700a409f22b61db Mon Sep 17 00:00:00 2001 From: tiyn Date: Mon, 6 Nov 2023 00:54:42 +0100 Subject: [PATCH] making tab and shift tab cycle suggestions --- dmenu.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/dmenu.c b/dmenu.c index 65f25ce..4b55418 100644 --- a/dmenu.c +++ b/dmenu.c @@ -444,7 +444,8 @@ insert: if (lines > 0) return; /* fallthrough */ - case XK_Up: + // case XK_Up: + case XK_ISO_Left_Tab: if (sel && sel->left && (sel = sel->left)->right == curr) { curr = prev; calcoffsets(); @@ -472,28 +473,29 @@ insert: if (sel) sel->out = 1; break; - case XK_Right: - if (text[cursor] != '\0') { - cursor = nextrune(+1); - break; - } - if (lines > 0) - return; - /* fallthrough */ - case XK_Down: + // case XK_Right: + // if (text[cursor] != '\0') { + // cursor = nextrune(+1); + // break; + // } + // if (lines > 0) + // return; + // /* fallthrough */ + // case XK_Down: + case XK_Tab: if (sel && sel->right && (sel = sel->right) == next) { curr = next; calcoffsets(); } break; - case XK_Tab: - if (!sel) - return; - strncpy(text, sel->text, sizeof text - 1); - text[sizeof text - 1] = '\0'; - cursor = strlen(text); - match(); - break; + // case XK_Tab: + // if (!sel) + // return; + // strncpy(text, sel->text, sizeof text - 1); + // text[sizeof text - 1] = '\0'; + // cursor = strlen(text); + // match(); + // break; } draw: