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.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index de4b806..185033f 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1254,6 +1254,16 @@
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