summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-11-30 17:01:58 +0100
committerBram Moolenaar <Bram@vim.org>2011-11-30 17:01:58 +0100
commit0612ec8d53ccc67f886dca470c10027336be959f (patch)
tree53310ad51dcf23555c6463bfab86b2609e8f76d1 /src/ex_cmds.c
parent89c7122c05c69222a22fe78f570264c6f91851b8 (diff)
downloadvim-git-7.3.362.tar.gz
updated for version 7.3.362v7.3.362
Problem: ml_get error when using ":g" with folded lines. Solution: Adjust the line number for changed_lines(). (Christian Brabandt)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 33021d295..e81b4a2be 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -820,7 +820,13 @@ do_move(line1, line2, dest)
curwin->w_cursor.lnum = dest + (line2 - line1) + 1;
if (line1 < dest)
- changed_lines(line1, 0, dest + num_lines + 1, 0L);
+ {
+ dest += num_lines + 1;
+ last_line = curbuf->b_ml.ml_line_count;
+ if (dest > last_line + 1)
+ dest = last_line + 1;
+ changed_lines(line1, 0, dest, 0L);
+ }
else
changed_lines(dest + 1, 0, line1 + num_lines, 0L);