This commit is contained in:
rsc 2005-11-11 00:37:14 +00:00
parent c935adc6a2
commit c21d0ab45b
2 changed files with 8 additions and 6 deletions

View file

@ -103,13 +103,13 @@ threadmain(int argc, char *argv[])
deletechan = chancreate(sizeof(char*), 0);
timerinit();
servedevtext();
rcpid = rcstart(argc, argv, &rcfd, &sfd);
w = new(screen, FALSE, scrolling, rcpid, ".", nil, nil);
threadcreate(keyboardthread, nil, STACK);
threadcreate(mousethread, nil, STACK);
threadcreate(resizethread, nil, STACK);
servedevtext();
proccreate(rcoutputproc, nil, STACK);
proccreate(rcinputproc, nil, STACK);
@ -606,6 +606,10 @@ textproc(void *arg)
fd = (int)arg;
p = buf;
ep = buf+sizeof buf;
if(w == nil){
close(fd);
return;
}
end = w->org+w->nr; /* avoid possible output loop */
for(i=w->org;; i++){
if(i >= end || ep-p < UTFmax){

View file

@ -328,7 +328,8 @@ winctl(void *arg)
recv(cwm.cw, &pair);
rp = pair.s;
nr = pair.ns;
up = bp = rp;
bp = rp;
up = rp;
initial = 0;
for(i=0; i<nr; i++){
switch(*bp){
@ -340,7 +341,6 @@ winctl(void *arg)
else
--up;
break;
/*
case '\r':
while(i<nr-1 && *(bp+1) == '\r'){
bp++;
@ -354,7 +354,6 @@ winctl(void *arg)
}else if(i == nr-1)
*up = '\n';
break;
*/
default:
*up++ = *bp;
break;
@ -368,8 +367,7 @@ winctl(void *arg)
wdelete(w, qh, qh+initial);
w->qh = qh;
}
nr = rp - up;
rp[nr] = 0;
nr = up - rp;
w->qh = winsert(w, rp, nr, w->qh)+nr;
if(w->scrolling || w->mouseopen)
wshow(w, w->qh);