libdraw: implement ^W word delete for enter() and eenter()
This commit is contained in:
parent
01e3e719ed
commit
a77f6553d8
2 changed files with 18 additions and 0 deletions
|
@ -150,6 +150,15 @@ eenter(char *ask, char *buf, int len, Mouse *m)
|
|||
}
|
||||
continue;
|
||||
}
|
||||
if(k == Ketb){
|
||||
while(tick > 0){
|
||||
buf[--tick] = 0;
|
||||
if(tick == 0 || strchr("\t ", buf[tick-1]))
|
||||
break;
|
||||
}
|
||||
n = tick;
|
||||
break;
|
||||
}
|
||||
if(k == Kbs){
|
||||
if(tick <= 0)
|
||||
continue;
|
||||
|
|
|
@ -158,6 +158,15 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
|
|||
}
|
||||
continue;
|
||||
}
|
||||
if(k == Ketb){
|
||||
while(tick > 0){
|
||||
buf[--tick] = 0;
|
||||
if(tick == 0 || strchr("\t ", buf[tick-1]))
|
||||
break;
|
||||
}
|
||||
n = tick;
|
||||
break;
|
||||
}
|
||||
if(k == Kbs){
|
||||
if(tick <= 0)
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue