summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2017-08-02 01:42:49 -0400
committerJune McEnroe <programble@gmail.com>2017-08-02 01:42:49 -0400
commitd9d987e962f8d564d8853fd1b1028832ecaa16a2 (patch)
tree97ef8471db2ec983a92d24f55186a04394096e24
parentPreserve color on replace (diff)
downloadtorus-d9d987e962f8d564d8853fd1b1028832ecaa16a2.tar.gz
torus-d9d987e962f8d564d8853fd1b1028832ecaa16a2.zip
Move in insert direction on ~
-rwxr-xr-xclient.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/client.c b/client.c
index 464568b..2c95468 100755
--- a/client.c
+++ b/client.c
@@ -80,7 +80,7 @@ static struct {
     int8_t dx;
     int8_t dy;
     uint8_t len;
-} insert;
+} insert = { .dx = 1 };
 static char drawChar;
 
 static void insertMode(int8_t dx, int8_t dy) {
@@ -168,7 +168,11 @@ static void readInput(void) {
         case 'r': mode = MODE_REPLACE; break;
         case 'R': mode = MODE_DRAW; drawChar = 0; break;
         case 'x': clientPut(CH_COLOR(inch()), ' '); break;
-        case '~': clientPut(inputColor, inch() & 0x7F); clientMove(1, 0); break;
+
+        case '~':
+            clientPut(inputColor, inch() & 0x7F);
+            clientMove(insert.dx, insert.dy);
+            break;
 
         case '[': if (moveSpeed > 1) moveSpeed--; break;
         case ']': if (moveSpeed < 4) moveSpeed++; break;