patch 9.1.0785: cannot preserve error position when setting quickfix list
Problem: cannot preserve error position when setting quickfix lists
Solution: Add the 'u' action for setqflist()/setloclist() and try
to keep the closes target position (Jeremy Fleischman)
fixes: #15839
closes: #15841
Signed-off-by: Jeremy Fleischman <jeremyfleischman@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 15de27d..32167d6 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 12
+*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -9766,6 +9766,8 @@
clear the list: >
:call setqflist([], 'r')
<
+ 'u' Like 'r', but tries to preserve the current selection
+ in the quickfix list.
'f' All the quickfix lists in the quickfix stack are
freed.
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index a943433..400ccd7 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2024 Oct 08
+*version9.txt* For Vim version 9.1. Last change: 2024 Oct 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41598,6 +41598,8 @@
- the regex engines match correctly case-insensitive multi-byte characters
(and apply proper case folding)
- |:keeppatterns| preserves the last substitute pattern when used with |:s|
+- |setqflist()| and |setloclist()| can optionally try to preserve the current
+ selection in the quickfix list with the "u" action.
*added-9.2*
Added ~