summaryrefslogtreecommitdiff
path: root/runtime/doc/quickfix.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-11 14:50:06 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-11 14:50:06 +0100
commit5b69c22fd2bf0c0d32aab90ee4c7ef74259d2c4c (patch)
treedcbcdbcaeeba17cdb70d523f6192c65f53716fa8 /runtime/doc/quickfix.txt
parent870ba5f6dce974b6c1c47bf9d3b20db805d10b36 (diff)
downloadvim-git-5b69c22fd2bf0c0d32aab90ee4c7ef74259d2c4c.tar.gz
patch 8.1.0720: cannot easily change the current quickfx list indexv8.1.0720
Problem: Cannot easily change the current quickfx list index. Solution: Add the "idx" argument to setqflist(). (Yegappan Lakshmanan, closes #3701)
Diffstat (limited to 'runtime/doc/quickfix.txt')
-rw-r--r--runtime/doc/quickfix.txt28
1 files changed, 26 insertions, 2 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 471c5f96e..18372dda0 100644
--- 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 quickfix list. You get one after commands
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 location list respectively. Examples: >
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 character are required to avoid it to be
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