make ^U delete whole line

This commit is contained in:
hazen2215 2022-03-28 07:58:43 +09:00
parent 7050df36bb
commit 807e428b98
1 changed files with 2 additions and 3 deletions

View File

@ -358,13 +358,12 @@ keypress(XKeyEvent *ev)
case XK_n: ksym = XK_Down; break;
case XK_p: ksym = XK_Up; break;
case XK_u: /* delete left */
insert(NULL, 0 - cursor);
case XK_k: /* delete right */
text[cursor] = '\0';
match();
break;
case XK_u: /* delete left */
insert(NULL, 0 - cursor);
break;
case XK_w: /* delete word */
while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
insert(NULL, nextrune(-1) - cursor);