aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/std.c b/std.c
index 5e19245..b0142fe 100644
--- a/std.c
+++ b/std.c
@@ -85,7 +85,7 @@ movea(int x, int y) {
85 y = MAX(y, lines); 85 y = MAX(y, lines);
86 cx = x; 86 cx = x;
87 cy = y; 87 cy = y;
88 cmd("s %d,%d", x, y); 88 cmd("seek(%d,%d)", x, y);
89} 89}
90 90
91void 91void
@@ -186,10 +186,10 @@ parseesc(void) {
186 case 0: 186 case 0:
187 case 22: 187 case 22:
188 if(bold) 188 if(bold)
189 cmd("b"); 189 cmd("bold");
190 case 1: 190 case 1:
191 if(!bold) 191 if(!bold)
192 cmd("b"); 192 cmd("bold");
193 break; 193 break;
194 } 194 }
195 } 195 }
@@ -204,7 +204,7 @@ parseesc(void) {
204 204
205void 205void
206scroll(int l) { 206scroll(int l) {
207 cmd("s %d, %d", cx, cy + l); 207 cmd("seek(%d,%d)", cx, cy + l);
208} 208}
209 209
210void 210void
@@ -279,17 +279,18 @@ main(int argc, char *argv[]) {
279 r = select(ptm + 1, &rfds, NULL, NULL, NULL); 279 r = select(ptm + 1, &rfds, NULL, NULL, NULL);
280 if(r == -1) 280 if(r == -1)
281 eprintn("error, cannot select"); 281 eprintn("error, cannot select");
282 if(FD_ISSET(ptm, &rfds)) { 282 if(FD_ISSET(ptm, &rfds))
283 c = getch(); 283 do {
284 switch(c) { 284 c = getch();
285 case '\033': 285 switch(c) {
286 parseesc(); 286 case '\033':
287 break; 287 parseesc();
288 default: 288 break;
289 putchar(c); 289 default:
290 } 290 putchar(c);
291 fflush(stdout); 291 }
292 } 292 fflush(stdout);
293 } while(rbuf.i < rbuf.n);
293 } 294 }
294 return 0; 295 return 0;
295} 296}