ref: 607f14e3f16eec13872118803992115de7b32f68
parent: 0d3ec6c7f3344091acd91516a097d01c29840966
author: phil9 <[email protected]>
date: Mon Nov 15 12:18:37 EST 2021
implement ^W in text entry
--- a/main.c
+++ b/main.c
@@ -337,6 +337,16 @@
ninput = 0;
inputchanged();
}
+ break;
+ case Ketb: /* ^W */
+ if(ninput > 0){
+ --ninput;
+ while(ninput > 0 && isalnum(input[ninput]))
+ --ninput;
+ input[++ninput] = '\0';
+ inputchanged();
+ }
+ break;
default:
if(isprint(k) && ninput < (sizeof input - 1)){
input[ninput++] = (char)k; /* XXX */