diff src/ex_cmds.c @ 22812:1ef3b04875ff v8.2.1954

patch 8.2.1954: Vim9: not all command modifiers are tested Commit: https://github.com/vim/vim/commit/f65b35b4465d3622128bd82bd3775f833542eb1f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 4 18:02:44 2020 +0100 patch 8.2.1954: Vim9: not all command modifiers are tested Problem: Vim9: not all command modifiers are tested. Solution: Add tests for "keep" modifiers. Fix that marks are lost even though ":lockmarks" is used.
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Nov 2020 18:15:03 +0100
parents 3e4981de5636
children 7c1e2e3f2d8d
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1254,6 +1254,16 @@ do_filter(
 		if (read_linecount >= linecount)
 		    // move all marks from old lines to new lines
 		    mark_adjust(line1, line2, linecount, 0L);
+		else if (save_cmod_flags & CMOD_LOCKMARKS)
+		{
+		    // Move marks from the lines below the new lines down by
+		    // the number of lines lost.
+		    // Move marks from the lines that will be deleted to the
+		    // new lines and below.
+		    mark_adjust(line2 + 1, (linenr_T)MAXLNUM,
+					       linecount - read_linecount, 0L);
+		    mark_adjust(line1, line2, linecount, 0L);
+		}
 		else
 		{
 		    // move marks from old lines to new lines, delete marks