patch 7.4.745
Problem: The entries added by matchaddpos() are returned by getmatches()
but can't be set with setmatches(). (Lcd)
Solution: Fix setmatches(). (Christian Brabandt)
diff --git a/src/testdir/test63.in b/src/testdir/test63.in
index 1f073a7..03b2197 100644
--- a/src/testdir/test63.in
+++ b/src/testdir/test63.in
@@ -187,7 +187,12 @@
:else
: let @r .= "FAILED: " . v4 . "/" . v5 . "/" . v6 . "/" . v7 . "/" . v8 . "/" . v9 . "/" . v10 . "\n"
:endif
+:" Check, that setmatches() can correctly restore the matches from matchaddpos()
+:call matchadd('MyGroup1', '\%2lmatchadd')
+:let m=getmatches()
:call clearmatches()
+:call setmatches(m)
+:let @r .= string(getmatches())."\n"
G"rp
:/^Results/,$wq! test.out
ENDTEST
diff --git a/src/testdir/test63.ok b/src/testdir/test63.ok
index 5d61939..7016daf 100644
--- a/src/testdir/test63.ok
+++ b/src/testdir/test63.ok
@@ -14,3 +14,4 @@
OK
[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}]
OK
+[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}]