fixes
This commit is contained in:
parent
c935adc6a2
commit
c21d0ab45b
2 changed files with 8 additions and 6 deletions
|
|
@ -103,13 +103,13 @@ threadmain(int argc, char *argv[])
|
||||||
deletechan = chancreate(sizeof(char*), 0);
|
deletechan = chancreate(sizeof(char*), 0);
|
||||||
|
|
||||||
timerinit();
|
timerinit();
|
||||||
|
servedevtext();
|
||||||
rcpid = rcstart(argc, argv, &rcfd, &sfd);
|
rcpid = rcstart(argc, argv, &rcfd, &sfd);
|
||||||
w = new(screen, FALSE, scrolling, rcpid, ".", nil, nil);
|
w = new(screen, FALSE, scrolling, rcpid, ".", nil, nil);
|
||||||
|
|
||||||
threadcreate(keyboardthread, nil, STACK);
|
threadcreate(keyboardthread, nil, STACK);
|
||||||
threadcreate(mousethread, nil, STACK);
|
threadcreate(mousethread, nil, STACK);
|
||||||
threadcreate(resizethread, nil, STACK);
|
threadcreate(resizethread, nil, STACK);
|
||||||
servedevtext();
|
|
||||||
|
|
||||||
proccreate(rcoutputproc, nil, STACK);
|
proccreate(rcoutputproc, nil, STACK);
|
||||||
proccreate(rcinputproc, nil, STACK);
|
proccreate(rcinputproc, nil, STACK);
|
||||||
|
|
@ -606,6 +606,10 @@ textproc(void *arg)
|
||||||
fd = (int)arg;
|
fd = (int)arg;
|
||||||
p = buf;
|
p = buf;
|
||||||
ep = buf+sizeof buf;
|
ep = buf+sizeof buf;
|
||||||
|
if(w == nil){
|
||||||
|
close(fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
end = w->org+w->nr; /* avoid possible output loop */
|
end = w->org+w->nr; /* avoid possible output loop */
|
||||||
for(i=w->org;; i++){
|
for(i=w->org;; i++){
|
||||||
if(i >= end || ep-p < UTFmax){
|
if(i >= end || ep-p < UTFmax){
|
||||||
|
|
|
||||||
|
|
@ -328,7 +328,8 @@ winctl(void *arg)
|
||||||
recv(cwm.cw, &pair);
|
recv(cwm.cw, &pair);
|
||||||
rp = pair.s;
|
rp = pair.s;
|
||||||
nr = pair.ns;
|
nr = pair.ns;
|
||||||
up = bp = rp;
|
bp = rp;
|
||||||
|
up = rp;
|
||||||
initial = 0;
|
initial = 0;
|
||||||
for(i=0; i<nr; i++){
|
for(i=0; i<nr; i++){
|
||||||
switch(*bp){
|
switch(*bp){
|
||||||
|
|
@ -340,7 +341,6 @@ winctl(void *arg)
|
||||||
else
|
else
|
||||||
--up;
|
--up;
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
case '\r':
|
case '\r':
|
||||||
while(i<nr-1 && *(bp+1) == '\r'){
|
while(i<nr-1 && *(bp+1) == '\r'){
|
||||||
bp++;
|
bp++;
|
||||||
|
|
@ -354,7 +354,6 @@ winctl(void *arg)
|
||||||
}else if(i == nr-1)
|
}else if(i == nr-1)
|
||||||
*up = '\n';
|
*up = '\n';
|
||||||
break;
|
break;
|
||||||
*/
|
|
||||||
default:
|
default:
|
||||||
*up++ = *bp;
|
*up++ = *bp;
|
||||||
break;
|
break;
|
||||||
|
|
@ -368,8 +367,7 @@ winctl(void *arg)
|
||||||
wdelete(w, qh, qh+initial);
|
wdelete(w, qh, qh+initial);
|
||||||
w->qh = qh;
|
w->qh = qh;
|
||||||
}
|
}
|
||||||
nr = rp - up;
|
nr = up - rp;
|
||||||
rp[nr] = 0;
|
|
||||||
w->qh = winsert(w, rp, nr, w->qh)+nr;
|
w->qh = winsert(w, rp, nr, w->qh)+nr;
|
||||||
if(w->scrolling || w->mouseopen)
|
if(w->scrolling || w->mouseopen)
|
||||||
wshow(w, w->qh);
|
wshow(w, w->qh);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue