delete key

This commit is contained in:
gutmet 2020-08-27 15:33:39 +02:00
parent f4be7cb739
commit ff7c8efd36
2 changed files with 10 additions and 2 deletions

View File

@ -48,7 +48,7 @@ index e5658a4e..2c79b387 100644
r = Rect(0, 0, Scrollwid+ButtonBorder, font->height+1); r = Rect(0, 0, Scrollwid+ButtonBorder, font->height+1);
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
index 09422dda..cecdd97b 100644 index 09422dda..81e5eb36 100644
--- a/src/cmd/acme/text.c --- a/src/cmd/acme/text.c
+++ b/src/cmd/acme/text.c +++ b/src/cmd/acme/text.c
@@ -692,10 +692,16 @@ texttype(Text *t, Rune r) @@ -692,10 +692,16 @@ texttype(Text *t, Rune r)
@ -172,13 +172,19 @@ index 09422dda..cecdd97b 100644
case Kins: case Kins:
typecommit(t); typecommit(t);
rp = textcomplete(t); rp = textcomplete(t);
@@ -844,9 +857,9 @@ texttype(Text *t, Rune r) @@ -844,9 +857,15 @@ texttype(Text *t, Rune r)
typecommit(t); typecommit(t);
t->iq1 = t->q0; t->iq1 = t->q0;
return; return;
- case 0x08: /* ^H: erase character */ - case 0x08: /* ^H: erase character */
- case 0x15: /* ^U: erase line */ - case 0x15: /* ^U: erase line */
- case 0x17: /* ^W: erase word */ - case 0x17: /* ^W: erase word */
+ case 0x7F: /* DEL: erase character in front */
+ if (t->q0>=t->file->b.nc)
+ return;
+ if (t->q0 == t->q1)
+ textshow(t, t->q0+1, t->q0+1,TRUE);
+ r = 0x08;
+ case 0x08: /* ^H: erase character */ + case 0x08: /* ^H: erase character */
+ case 0x15: /* ^U: erase line */ + case 0x15: /* ^U: erase line */
+ case 0x17: /* ^W: erase word */ + case 0x17: /* ^W: erase word */

View File

@ -7,3 +7,5 @@ Changes to acme
- switched behavior of Home/End with ^A/^E - switched behavior of Home/End with ^A/^E
- Ctrl+c, Ctrl+x, Ctrl+v now work as expected - Ctrl+c, Ctrl+x, Ctrl+v now work as expected
- Ctrl+z for undo, Ctrl+y for redo - Ctrl+z for undo, Ctrl+y for redo
- DELETE key