libdraw: enter/eenter: fix ^W removing the text on the right side of the tick

front
Sigrid 2021-02-04 10:57:37 +01:00
parent e0bfd148e2
commit 4ec97f73ee
2 changed files with 8 additions and 4 deletions

View File

@ -152,13 +152,15 @@ nodraw:
continue; continue;
} }
if(k == Ketb){ if(k == Ketb){
l = tick;
while(tick > 0){ while(tick > 0){
tick--; tick--;
if(tick == 0 || if(tick == 0 ||
strchr(" !\"#$%&'()*+,-./:;<=>?@`[\\]^{|}~", buf[tick-1])) strchr(" !\"#$%&'()*+,-./:;<=>?@`[\\]^{|}~", buf[tick-1]))
break; break;
} }
buf[n = tick] = 0; memmove(buf+tick, buf+l, n-l);
buf[n -= l-tick] = 0;
break; break;
} }
if(k == Kbs){ if(k == Kbs){

View File

@ -160,13 +160,15 @@ nodraw:
continue; continue;
} }
if(k == Ketb){ if(k == Ketb){
l = tick;
while(tick > 0){ while(tick > 0){
tick--; tick--;
if(tick == 0 || if(tick == 0 ||
strchr(" !\"#$%&'()*+,-./:;<=>?@`[\\]^{|}~", buf[tick-1])) strchr(" !\"#$%&'()*+,-./:;<=>?@`[\\]^{|}~", buf[tick-1]))
break; break;
} }
buf[n = tick] = 0; memmove(buf+tick, buf+l, n-l);
buf[n -= l-tick] = 0;
break; break;
} }
if(k == Kbs){ if(k == Kbs){