To: Alexey Marinichev <[email protected]>
Cc: [email protected]
Subject: Patch 5.4n.8 (was: vim 5.4n .viminfo bug)
In-Reply-To: <[email protected]>
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Alexey Marinichev wrote:

> The bug:
>       assume viminfo is set
>       modify '0 entry in .viminfo file to, say,
>               '0  99999  0  /usr/local/share/vim/vim54n/doc/version5.txt
>       run vim and say '0
>
> The result is tons of "ml_get: invalid lnum: 99999"-like messages.

Yep.  Only for '0 though, not for `0.  Strange that this error slipt by.  I
always have ' mapped to `, thus never noticed this problem.

Eigth patch on 5.4n already, after two days :-(.  Well, at least they were
found and got fixed.  Next one please!


Patch 5.4n.8
Problem:    When a mark was on a non existing line (e.g., when the .viminfo
           was edited), jumping to it caused ml_get errors. (Alexey
           Marinichev).
Solution:   Added check_cursor_lnum() in nv_gomark().
Files:      src/normal.c


*** ../vim-5.4n/src/normal.c    Sun Jul  4 20:36:01 1999
--- src/normal.c        Tue Jul  6 19:55:06 1999
***************
*** 4693,4699 ****
--- 4693,4702 ----
     if (pos == (FPOS *)-1)        /* jumped to other file */
     {
       if (flag)
+       {
+           check_cursor_lnum();
           beginline(BL_WHITE | BL_FIX);
+       }
       else
           adjust_cursor();
     }

--
BRIDGEKEEPER: What is your favorite colour?
LAUNCELOT:    Blue.
BRIDGEKEEPER: Right.  Off you go.
                "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

--/-/---- Bram Moolenaar ---- [email protected] ---- [email protected] ---\-\--
 \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /