mirror of
https://github.com/tiyn/dmenu.git
synced 2025-04-18 23:57:46 +02:00
making tab and shift tab cycle suggestions
This commit is contained in:
parent
b5fe99141e
commit
829066cbb2
38
dmenu.c
38
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user