diff options
author | Russ Cox <rsc@swtch.com> | 2011-04-27 13:18:07 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2011-04-27 13:18:07 -0400 |
commit | ba31ab3044765270d40c9da934dfc11e5f8b63c5 (patch) | |
tree | b9b8bb263f822e990b53eb97384ba338a0036a66 /src/cmd/9term/9term.c | |
parent | 42ef984cf2514fedc4f9e2efe2876aa95d2d8579 (diff) | |
download | plan9port-ba31ab3044765270d40c9da934dfc11e5f8b63c5.tar.gz plan9port-ba31ab3044765270d40c9da934dfc11e5f8b63c5.tar.bz2 plan9port-ba31ab3044765270d40c9da934dfc11e5f8b63c5.zip |
9term, acme: autoscroll
Ignore scroll/noscroll window setting.
Instead, scroll when the write begins in
or immediately after the displayed window content.
In the new scrolling discipline, executing
"Noscroll" is replaced by typing Page Up or
using the mouse to scroll higher in the buffer,
and executing "Scroll" is replaced by typing End
or using the mouse to scroll to the bottom of
the buffer.
R=r, r2
http://codereview.appspot.com/4433060
Diffstat (limited to 'src/cmd/9term/9term.c')
-rw-r--r-- | src/cmd/9term/9term.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index 806215df..344a7b55 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -67,7 +67,7 @@ threadmain(int argc, char *argv[]) fontname = EARGF(usage()); break; case 's': - scrolling = TRUE; + /* no-op */ break; case 'c': cooked = TRUE; @@ -114,7 +114,7 @@ threadmain(int argc, char *argv[]) timerinit(); servedevtext(); rcpid = rcstart(argc, argv, &rcfd, &sfd); - w = new(screen, FALSE, scrolling, rcpid, ".", nil, nil); + w = new(screen, FALSE, rcpid, ".", nil, nil); threadcreate(keyboardthread, nil, STACK); threadcreate(mousethread, nil, STACK); @@ -241,7 +241,7 @@ wpointto(Point pt) } Window* -new(Image *i, int hideit, int scrollit, int pid, char *dir, char *cmd, char **argv) +new(Image *i, int hideit, int pid, char *dir, char *cmd, char **argv) { Window *w; Mousectl *mc; @@ -258,7 +258,7 @@ new(Image *i, int hideit, int scrollit, int pid, char *dir, char *cmd, char **ar *mc = *mousectl; /* mc->image = i; */ mc->c = cm; - w = wmk(i, mc, ck, cctl, scrollit); + w = wmk(i, mc, ck, cctl); free(mc); /* wmk copies *mc */ window = erealloc(window, ++nwindow*sizeof(Window*)); window[nwindow-1] = w; @@ -288,7 +288,6 @@ enum Snarf, Plumb, Send, - Scroll, Cook }; @@ -298,7 +297,6 @@ char *menu2str[] = { "snarf", "plumb", "send", - "scroll", "cook", nil }; @@ -317,10 +315,6 @@ button2menu(Window *w) if(w->deleted) return; incref(&w->ref); - if(w->scrolling) - menu2str[Scroll] = "noscroll"; - else - menu2str[Scroll] = "scroll"; if(cooked) menu2str[Cook] = "nocook"; else @@ -364,11 +358,6 @@ button2menu(Window *w) wsetselect(w, w->nr, w->nr); wshow(w, w->nr); break; - - case Scroll: - if(w->scrolling ^= 1) - wshow(w, w->nr); - break; case Cook: cooked ^= 1; |