| tscrolling - plan9port - [fork] Plan 9 from user space | |
| git clone git://src.adamsgaard.dk/plan9port | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit 038aa0220a3333ee49b19dcca9d084499d5a75e6 | |
| parent d7037d6280a74fd7baa53d39f3fb3b68e18a54f1 | |
| Author: rsc <devnull@localhost> | |
| Date: Fri, 11 Jun 2004 04:13:03 +0000 | |
| scrolling | |
| Diffstat: | |
| M src/cmd/acme/exec.c | 5 +++-- | |
| M src/cmd/acme/text.c | 6 ++++-- | |
| 2 files changed, 7 insertions(+), 4 deletions(-) | |
| --- | |
| diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c | |
| t@@ -556,9 +556,10 @@ get(Text *et, Text *t, Text *argt, int flag1, int _0, Run… | |
| d = dirstat(name); | |
| isdir = (d!=nil && (d->qid.type & QTDIR)); | |
| free(d); | |
| - if(isdir) | |
| + if(isdir){ | |
| warning(nil, "%s is a directory; can't read with multi… | |
| - return; | |
| + return; | |
| + } | |
| } | |
| r = bytetorune(name, &n); | |
| for(i=0; i<t->file->ntext; i++){ | |
| diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c | |
| t@@ -659,7 +659,9 @@ texttype(Text *t, Rune r) | |
| n = t->fr.maxlines/3; | |
| goto case_Down; | |
| case Kscrollonedown: | |
| - n = 1; | |
| + n = mousescrollsize(t->fr.maxlines)-1; /* -1 counters a… | |
| + if(n <= 0) | |
| + n = 1; | |
| goto case_Down; | |
| case Kpgdown: | |
| n = 2*t->fr.maxlines/3; | |
| t@@ -671,7 +673,7 @@ texttype(Text *t, Rune r) | |
| n = t->fr.maxlines/3; | |
| goto case_Up; | |
| case Kscrolloneup: | |
| - n = 2; /* feels like this should be n=1, but that does … | |
| + n = mousescrollsize(t->fr.maxlines)+1; /* +1 counters a… | |
| goto case_Up; | |
| case Kpgup: | |
| n = 2*t->fr.maxlines/3; |