Hi,
while looking why sometimes line numbers are wrong in mg I found this:
1) mg theo.c
2) move around in file
3) C-x C-f theo.c
4) the cursor will be at the end of the buffer (sometimes one line after
   the end of the buffer) and the line number is not updated.

If there is another file open this doesn't seem to happen, the cursor only
jumps to column 0. But this might be totaly random because def.h has this
to say (above struct buffer):
 *                            [...] There is a safe store for the
 * dot and mark in the header, but this is only valid if the buffer
 * is not being displayed (that is, if "b_nwnd" is 0). [...]

Maybe "wp->w_rflag |= flags;" should go, too.

diff --git usr.bin/mg/buffer.c usr.bin/mg/buffer.c
index 0a4254c..ef2a25b 100644
--- usr.bin/mg/buffer.c
+++ usr.bin/mg/buffer.c
@@ -611,8 +611,6 @@ showbuffer(struct buffer *bp, struct mgwin *wp, int flags)
 
        if (wp->w_bufp == bp) { /* Easy case! */
                wp->w_rflag |= flags;
-               wp->w_dotp = bp->b_dotp;
-               wp->w_doto = bp->b_doto;
                return (TRUE);
        }
        /* First, detach the old buffer from the window */

Thanks,
Florian
-- 
I'm not entirely sure you are real.

Reply via email to