making tab and shift tab cycle suggestions

config
tiyn 1 year ago
parent b5fe99141e
commit 829066cbb2

@ -444,7 +444,8 @@ insert:
if (lines > 0) if (lines > 0)
return; return;
/* fallthrough */ /* fallthrough */
case XK_Up: // case XK_Up:
case XK_ISO_Left_Tab:
if (sel && sel->left && (sel = sel->left)->right == curr) { if (sel && sel->left && (sel = sel->left)->right == curr) {
curr = prev; curr = prev;
calcoffsets(); calcoffsets();
@ -472,28 +473,29 @@ insert:
if (sel) if (sel)
sel->out = 1; sel->out = 1;
break; break;
case XK_Right: // case XK_Right:
if (text[cursor] != '\0') { // if (text[cursor] != '\0') {
cursor = nextrune(+1); // cursor = nextrune(+1);
break; // break;
} // }
if (lines > 0) // if (lines > 0)
return; // return;
/* fallthrough */ // /* fallthrough */
case XK_Down: // case XK_Down:
case XK_Tab:
if (sel && sel->right && (sel = sel->right) == next) { if (sel && sel->right && (sel = sel->right) == next) {
curr = next; curr = next;
calcoffsets(); calcoffsets();
} }
break; break;
case XK_Tab: // case XK_Tab:
if (!sel) // if (!sel)
return; // return;
strncpy(text, sel->text, sizeof text - 1); // strncpy(text, sel->text, sizeof text - 1);
text[sizeof text - 1] = '\0'; // text[sizeof text - 1] = '\0';
cursor = strlen(text); // cursor = strlen(text);
match(); // match();
break; // break;
} }
draw: draw:

Loading…
Cancel
Save