summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-05-15 21:56:34 +0200
committerBram Moolenaar <Bram@vim.org>2018-05-15 21:56:34 +0200
commit78ddc06bdd5c59cffdbb61eed7dcb5dcc4a17f19 (patch)
tree13144f5a3e548e7ed02527cfc14a7eca724bf9c9 /runtime
parent8776889b5befd8eba66f4ad32282db36f85392a6 (diff)
patch 8.0.1844: superfluous quickfix code, missing examplesv8.0.1844
Problem: Superfluous quickfix code, missing examples. Solution: Remove unneeded code. Add a few examples. Add a bit more testing. (Yegappan Lakshmanan, closes #2916)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/quickfix.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 83379b81a5..5f2a4ddf2b 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -608,6 +608,12 @@ using these functions are below:
" get the identifier of the current quickfix list
:let qfid = getqflist({'id' : 0}).id
+ " get the identifier of the fourth quickfix list in the stack
+ :let qfid = getqflist({'nr' : 4, 'id' : 0}).id
+
+ " check whether a quickfix list with a specific identifier exists
+ :if getqflist({'id' : qfid}).id == qfid
+
" get the index of the current quickfix list in the stack
:let qfnum = getqflist({'nr' : 0}).nr
@@ -653,6 +659,11 @@ The setqflist() and setloclist() functions can be used to set the various
attributes of a quickfix and location list respectively. Some examples for
using these functions are below:
>
+ " create an empty quickfix list with a title and a context
+ :let t = 'Search results'
+ :let c = {'cmd' : 'grep'}
+ :call setqflist([], ' ', {'title' : t, 'context' : c})
+
" set the title of the current quickfix list
:call setqflist([], 'a', {'title' : 'Mytitle'})
@@ -671,6 +682,9 @@ using these functions are below:
\ {'filename' : 'b.txt', 'lnum' : 20, 'text' : "Orange"}]
:call setqflist([], 'a', {'id' : qfid, 'items' : newItems})
+ " empty a quickfix list specified by an identifier
+ :call setqflist([], 'r', {'id' : qfid, 'items' : []})
+
" free all the quickfix lists in the stack
:call setqflist([], 'f')