summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorlum <lum@cvs.openbsd.org>2012-06-08 21:21:58 +0000
committerlum <lum@cvs.openbsd.org>2012-06-08 21:21:58 +0000
commit195aa61615f0ee6cce004ddb09337f77d2eb3301 (patch)
treebb8c2c6bacd7c0b3926ed6159359594a65780c98 /usr.bin/mg
parentf4791327de9483427c07421414369b8d683f28fd (diff)
From an email to tech@:
Bit difficult to explain this one. If you have a file open that is 3 or 4 times longer than the length of the viewable window and are at the bottom of the buffer then scroll up to the top using M-v, your cursor should remain at the bottom left of the window once you reach the top of the buffer. mg behaves like this since the last couple of scrolling diffs I've committed. However, and as an example, if you start with the window viewing the top of a buffer and press C-v twice, then C-p four times then M-v twice to scroll back to the top, you will find your cursor is NOT at the bottom left of the window. tut tut. This diff makes the cursor stay at the bottom left, like emacs.
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/basic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mg/basic.c b/usr.bin/mg/basic.c
index c6e5abc5fbe..48969cdf7e5 100644
--- a/usr.bin/mg/basic.c
+++ b/usr.bin/mg/basic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basic.c,v 1.35 2012/06/08 05:10:50 lum Exp $ */
+/* $OpenBSD: basic.c,v 1.36 2012/06/08 21:21:57 lum Exp $ */
/* This file is in the public domain */
@@ -334,6 +334,8 @@ backpage(int f, int n)
/* Move the dot the slow way, for line nos */
while (curwp->w_dotp != lp2) {
+ if (curwp->w_dotline <= curwp->w_ntrows)
+ return (TRUE);
curwp->w_dotp = lback(curwp->w_dotp);
curwp->w_dotline--;
}