Hi Bram,
I just noticed there is an error when using :g command with folded lines.

take this file:
#v+
~$ cat vim_bug.txt
1
1
2
2
1
1
1
1
vim:fdm=expr fdl=0 fde=getline(v\:lnum)==1
~$ vim -u NONE -U NONE -N -i NONE -c 'folddoclosed m$' vim_bug.txt
E315: ml_get: invalid lnum: 11
#v-

This patch fixes it. Please check and include.

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -819,7 +819,12 @@
        curwin->w_cursor.lnum = dest + (line2 - line1) + 1;
 
     if (line1 < dest)
-       changed_lines(line1, 0, dest + num_lines + 1, 0L);
+    {
+        if (dest + num_lines + 1 > curwin->w_buffer->b_ml.ml_line_count)
+           changed_lines(line1, 0, curwin->w_buffer->b_ml.ml_line_count + 1, 
0L);
+       else
+           changed_lines(line1, 0, dest + num_lines + 1, 0L);
+    }
     else
        changed_lines(dest + 1, 0, line1 + num_lines, 0L);
 

regards,
Christian

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui