9term: fix insert

R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4952066
This commit is contained in:
David Swasey 2011-09-12 12:36:30 -04:00 committed by Russ Cox
parent a287dbab23
commit 53000799be

View file

@ -1621,10 +1621,10 @@ winsert(Window *w, Rune *r, int n, uint q0)
w->q0 += n;
if(q0 < w->qh)
w->qh += n;
if(q0 < w->org)
w->org += n;
if(q0 < w->iq1)
w->iq1 += n;
if(q0 < w->org)
w->org += n;
else if(q0 <= w->org+w->f.nchars)
frinsert(&w->f, r, r+n, q0-w->org);
return q0;