diff runtime/doc/quickfix.txt @ 15424:90c8ff9c19ee v8.1.0720

patch 8.1.0720: cannot easily change the current quickfx list index commit https://github.com/vim/vim/commit/5b69c22fd2bf0c0d32aab90ee4c7ef74259d2c4c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 11 14:50:06 2019 +0100 patch 8.1.0720: cannot easily change the current quickfx list index Problem: Cannot easily change the current quickfx list index. Solution: Add the "idx" argument to setqflist(). (Yegappan Lakshmanan, closes #3701)
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Jan 2019 15:00:08 +0100
parents 97b40b4c6911
children f0f06837a699
line wrap: on
line diff
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1,4 +1,4 @@
-*quickfix.txt*  For Vim version 8.1.  Last change: 2018 Dec 27
+*quickfix.txt*  For Vim version 8.1.  Last change: 2019 Jan 09
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -56,6 +56,7 @@ A location list is a window-local quickf
 like `:lvimgrep`, `:lgrep`, `:lhelpgrep`, `:lmake`, etc., which create a
 location list instead of a quickfix list as the corresponding `:vimgrep`,
 `:grep`, `:helpgrep`, `:make` do.
+						*location-list-file-window*
 A location list is associated with a window and each window can have a
 separate location list.  A location list can be associated with only one
 window.  The location list is independent of the quickfix list.
@@ -364,6 +365,23 @@ modify the title of a quickfix and locat
 	call setloclist(3, [], 'a', {'title' : 'Cmd output'})
 	echo getloclist(3, {'title' : 1})
 <
+							*quickfix-index*
+When you jump to a quickfix/location list entry using any of the quickfix
+commands (e.g. |cc|, |cnext|, |cprev|, etc.), that entry becomes the currently
+selected entry. The index of the currently selected entry in a
+quickfix/location list can be obtained using the getqflist()/getloclist()
+functions. Examples: >
+	echo getqflist({'idx' : 0}).idx
+	echo getqflist({'id' : qfid, 'idx' : 0}).idx
+	echo getloclist(2, {'idx' : 0}).idx
+<
+For a new quickfix list, the first entry is selected and the index is 1.  Any
+entry in any quickfix/location list can be set as the currently selected entry
+using the setqflist() function. Examples: >
+	call setqflist([], 'a', {'idx' : 12})
+	call setqflist([], 'a', {'id' : qfid, 'idx' : 7})
+	call setloclist(1, [], 'a', {'idx' : 7})
+<
 							*quickfix-size*
 You can get the number of entries (size) in a quickfix and a location list
 using the |getqflist()| and |getloclist()| functions respectively. Examples: >
@@ -657,6 +675,9 @@ using these functions are below:
 
     " get the location list window id of the third window
     :echo getloclist(3, {'winid' : 0}).winid
+
+    " get the file window id of a location list window (winnr: 4)
+    :echo getloclist(4, {'filewinid' : 0}).filewinid
 <
 							*setqflist-examples*
 The |setqflist()| and |setloclist()| functions can be used to set the various
@@ -671,6 +692,9 @@ using these functions are below:
     " set the title of the current quickfix list
     :call setqflist([], 'a', {'title' : 'Mytitle'})
 
+    " change the current entry in the list specified by an identifier
+    :call setqflist([], 'a', {'id' : qfid, 'idx' : 10})
+
     " set the context of a quickfix list specified by an identifier
     :call setqflist([], 'a', {'id' : qfid, 'context' : {'val' : 100}})
 
@@ -1551,7 +1575,7 @@ The backslashes before the pipe characte
 recognized as a command separator.  The backslash before each space is
 required for the set command.
 
-					    *cfilter-plugin* *:Cfilter* *:Lfilter*
+				    *cfilter-plugin* *:Cfilter* *:Lfilter*
 If you have too many matching messages, you can use the cfilter plugin to
 reduce the number of entries.  Load the plugin with: >
    packadd cfilter