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.

ok?

-lum

Index: basic.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/basic.c,v
retrieving revision 1.35
diff -u -p -r1.35 basic.c
--- basic.c     8 Jun 2012 05:10:50 -0000       1.35
+++ basic.c     8 Jun 2012 15:09:22 -0000
@@ -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--;
        }

Reply via email to