summary refs log tree commit diff
path: root/edit.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-09 03:56:18 -0500
committerJune McEnroe <june@causal.agency>2020-02-09 03:58:13 -0500
commitd7c96fc81b71b77b30511d6526fe3acaa84c39ee (patch)
tree8a3bafe6dc5fca996b2da40a4905d70ee2eab52a /edit.c
parentAdd C-d (diff)
downloadcatgirl-d7c96fc81b71b77b30511d6526fe3acaa84c39ee.tar.gz
catgirl-d7c96fc81b71b77b30511d6526fe3acaa84c39ee.zip
Add C-k
Also rename all the edit ops to something consistent.
Diffstat (limited to '')
-rw-r--r--edit.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/edit.c b/edit.c
index c30e725..7fcff40 100644
--- a/edit.c
+++ b/edit.c
@@ -133,14 +133,15 @@ static void tabReject(void) {
 void edit(size_t id, enum Edit op, wchar_t ch) {
 	size_t init = pos;
 	switch (op) {
-		break; case EditHome:  pos = 0;
-		break; case EditEnd:   pos = len;
-		break; case EditLeft:  if (pos) pos--;
-		break; case EditRight: if (pos < len) pos++;
-
-		break; case EditKill:   len = pos = 0;
-		break; case EditErase:  if (pos) delete(--pos, 1);
-		break; case EditDelete: delete(pos, 1);
+		break; case EditHead: pos = 0;
+		break; case EditTail: pos = len;
+		break; case EditPrev: if (pos) pos--;
+		break; case EditNext: if (pos < len) pos++;
+
+		break; case EditDeletePrev: if (pos) delete(--pos, 1);
+		break; case EditDeleteNext: delete(pos, 1);
+		break; case EditKillPrev: delete(0, pos); pos = 0;
+		break; case EditKillNext: delete(pos, len - pos);
 
 		break; case EditInsert: {
 			reserve(pos, 1);