commit - 5af29cd3a94477ec79f36ac200dc5322b6ea6df6
commit + d2a414f28d7e224b1d89e6ac56990895304ff17e
blob - 9ba8d22c8eb042da2c6286ddf76953abbf534dee
blob + 6df15fe23cf231cdae7d7c3d707e75883719cad0
--- src/cmd/9term/9term.c
+++ src/cmd/9term/9term.c
Rectangle scrollr; /* scroll bar rectangle */
Rectangle lastsr; /* used for scroll bar */
int holdon; /* hold mode */
-int rawon; /* raw mode */
+int rawon(void); /* raw mode */
int scrolling; /* window scrolls */
int clickmsec; /* time of last click */
uint clickq0; /* point of last click */
proccreate(hostproc, hostc, 32*1024);
}
+int crawon = -1;
+
+int
+rawon(void)
+{
+ if(crawon != -1)
+ return crawon;
+ return 0;
+}
+
void
loop(void)
{
a[2].op = CHANRCV;
if(!scrolling && t.qh > t.org+t.f->nchars)
a[2].op = CHANNOP;;
-
+ crawon = -1;
switch(alt(a)) {
default:
fatal("impossible");
return;
}
- if(rawon && t.q0==t.nr){
+ if(rawon() && t.q0==t.nr){
addraw(&r, 1);
return;
}
if(holdon)
return 0;
- if(rawon)
+ if(rawon())
return t.nraw != 0;
/* look to see if there is a complete line */
c = *p;
p += width;
n -= width;
- if(!rawon && (c == '\n' || c == '\004'))
+ if(!rawon() && (c == '\n' || c == '\004'))
break;
}
/* take out control-d when not doing a zero length write */
n2--;
q++;
}
-
runewrite(buf2, q-buf2);
}
if(n == 0)
return;
- /* get ride of backspaces */
+ /* get rid of backspaces */
initial = 0;
p = q = r;
for(i=0; i<n; i++) {
fill();
}
updatesel();
- return;
}
if(t.nr>HiWater && t.qh>=t.org){
uint m;
uint q0;
- if(rawon && t.q0==t.nr){
+ if(rawon() && t.q0==t.nr){
addraw(r, n);
return;
}