diff options
author | lum <lum@cvs.openbsd.org> | 2012-06-01 11:22:07 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2012-06-01 11:22:07 +0000 |
commit | 23945a45b9fe39597600a1bf76dc6c2e5fa955cd (patch) | |
tree | 44235c0a8fb4c5567027486eba46f9e932c22cdd /usr.bin/mg | |
parent | 8449a2259cd39a9a87f5f93c88abb9373a73635d (diff) |
While scrolling, show a message and beep when you reach either end of
a buffer.
Diffstat (limited to 'usr.bin/mg')
-rw-r--r-- | usr.bin/mg/basic.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/mg/basic.c b/usr.bin/mg/basic.c index 390a04a6b1b..932649166ae 100644 --- a/usr.bin/mg/basic.c +++ b/usr.bin/mg/basic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: basic.c,v 1.33 2012/05/31 10:55:53 lum Exp $ */ +/* $OpenBSD: basic.c,v 1.34 2012/06/01 11:22:06 lum Exp $ */ /* This file is in the public domain */ @@ -269,8 +269,11 @@ forwpage(int f, int n) lp = curwp->w_linep; while (n--) - if ((lp = lforw(lp)) == curbp->b_headp) + if ((lp = lforw(lp)) == curbp->b_headp) { + ttbeep(); + ewprintf("End of buffer"); return(TRUE); + } curwp->w_linep = lp; curwp->w_rflag |= WFFULL; @@ -315,6 +318,10 @@ backpage(int f, int n) while (n-- && lback(lp) != curbp->b_headp) { lp = lback(lp); } + if (lp == curwp->w_linep) { + ttbeep(); + ewprintf("Beginning of buffer"); + } curwp->w_linep = lp; curwp->w_rflag |= WFFULL; |