scrolling
This commit is contained in:
parent
d7037d6280
commit
038aa0220a
2 changed files with 7 additions and 4 deletions
|
|
@ -556,9 +556,10 @@ get(Text *et, Text *t, Text *argt, int flag1, int _0, Rune *arg, int narg)
|
||||||
d = dirstat(name);
|
d = dirstat(name);
|
||||||
isdir = (d!=nil && (d->qid.type & QTDIR));
|
isdir = (d!=nil && (d->qid.type & QTDIR));
|
||||||
free(d);
|
free(d);
|
||||||
if(isdir)
|
if(isdir){
|
||||||
warning(nil, "%s is a directory; can't read with multiple windows on it\n", name);
|
warning(nil, "%s is a directory; can't read with multiple windows on it\n", name);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r = bytetorune(name, &n);
|
r = bytetorune(name, &n);
|
||||||
for(i=0; i<t->file->ntext; i++){
|
for(i=0; i<t->file->ntext; i++){
|
||||||
|
|
|
||||||
|
|
@ -659,7 +659,9 @@ texttype(Text *t, Rune r)
|
||||||
n = t->fr.maxlines/3;
|
n = t->fr.maxlines/3;
|
||||||
goto case_Down;
|
goto case_Down;
|
||||||
case Kscrollonedown:
|
case Kscrollonedown:
|
||||||
n = 1;
|
n = mousescrollsize(t->fr.maxlines)-1; /* -1 counters a bug somewhere else */
|
||||||
|
if(n <= 0)
|
||||||
|
n = 1;
|
||||||
goto case_Down;
|
goto case_Down;
|
||||||
case Kpgdown:
|
case Kpgdown:
|
||||||
n = 2*t->fr.maxlines/3;
|
n = 2*t->fr.maxlines/3;
|
||||||
|
|
@ -671,7 +673,7 @@ texttype(Text *t, Rune r)
|
||||||
n = t->fr.maxlines/3;
|
n = t->fr.maxlines/3;
|
||||||
goto case_Up;
|
goto case_Up;
|
||||||
case Kscrolloneup:
|
case Kscrolloneup:
|
||||||
n = 2; /* feels like this should be n=1, but that does nothing */
|
n = mousescrollsize(t->fr.maxlines)+1; /* +1 counters a bug somewhere else */
|
||||||
goto case_Up;
|
goto case_Up;
|
||||||
case Kpgup:
|
case Kpgup:
|
||||||
n = 2*t->fr.maxlines/3;
|
n = 2*t->fr.maxlines/3;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue