Xinqi Bao's Git
projects
/
st.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
cf147ae
)
correct buffering
author
Matthias-Christian Ott <
[email protected]
>
Sun, 15 Jun 2008 07:19:22 +0000
(09:19 +0200)
committer
Matthias-Christian Ott <
[email protected]
>
Sun, 15 Jun 2008 07:19:22 +0000
(09:19 +0200)
std.c
diff
|
blob
|
history
diff --git
a/std.c
b/std.c
index
5e19245
..
b0142fe
100644
(file)
--- a/
std.c
+++ b/
std.c
@@
-85,7
+85,7
@@
movea(int x, int y) {
y = MAX(y, lines);
cx = x;
cy = y;
y = MAX(y, lines);
cx = x;
cy = y;
- cmd("s
%d,%d
", x, y);
+ cmd("s
eek(%d,%d)
", x, y);
}
void
}
void
@@
-186,10
+186,10
@@
parseesc(void) {
case 0:
case 22:
if(bold)
case 0:
case 22:
if(bold)
- cmd("b");
+ cmd("b
old
");
case 1:
if(!bold)
case 1:
if(!bold)
- cmd("b");
+ cmd("b
old
");
break;
}
}
break;
}
}
@@
-204,7
+204,7
@@
parseesc(void) {
void
scroll(int l) {
void
scroll(int l) {
- cmd("s
%d, %d
", cx, cy + l);
+ cmd("s
eek(%d,%d)
", cx, cy + l);
}
void
}
void
@@
-279,17
+279,18
@@
main(int argc, char *argv[]) {
r = select(ptm + 1, &rfds, NULL, NULL, NULL);
if(r == -1)
eprintn("error, cannot select");
r = select(ptm + 1, &rfds, NULL, NULL, NULL);
if(r == -1)
eprintn("error, cannot select");
- if(FD_ISSET(ptm, &rfds)) {
- c = getch();
- switch(c) {
- case '\033':
- parseesc();
- break;
- default:
- putchar(c);
- }
- fflush(stdout);
- }
+ if(FD_ISSET(ptm, &rfds))
+ do {
+ c = getch();
+ switch(c) {
+ case '\033':
+ parseesc();
+ break;
+ default:
+ putchar(c);
+ }
+ fflush(stdout);
+ } while(rbuf.i < rbuf.n);
}
return 0;
}
}
return 0;
}