Browse code

Make tty_setcol 0-indexed

John Hawthorn authored on 17/08/2014 03:37:12
Showing 2 changed files

  • fzy.c index 7d09c5f..fa3e50f 100644
  • tty.c index 05edd76..9084456 100644
... ...
@@ -138,7 +138,7 @@ void draw(tty_t *tty){
138 138
 		line++;
139 139
 	}
140 140
 	tty_moveup(tty, line + 1);
141
-	tty_setcol(tty, strlen(prompt) + strlen(search) + 1);
141
+	tty_setcol(tty, strlen(prompt) + strlen(search));
142 142
 	tty_flush(tty);
143 143
 }
144 144
 
... ...
@@ -64,7 +64,7 @@ void tty_newline(tty_t *tty){
64 64
 }
65 65
 
66 66
 void tty_setcol(tty_t *tty, int col){
67
-	tty_printf(tty, "%c%c%iG", 0x1b, '[', col);
67
+	tty_printf(tty, "%c%c%iG", 0x1b, '[', col + 1);
68 68
 }
69 69
 
70 70
 void tty_moveup(tty_t *tty, int i){