diff options
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 67 |
1 files changed, 40 insertions, 27 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index eaf0b58e2b..1f3a3a8b67 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4315,6 +4315,7 @@ getqflist([{what}]) *getqflist()* list item is a dictionary with these entries: bufnr number of buffer that has the file name, use bufname() to get the name + module module name lnum line number in the buffer (first line is 1) col column number (first column is 1) vcol |TRUE|: "col" is visual column @@ -4339,51 +4340,63 @@ getqflist([{what}]) *getqflist()* If the optional {what} dictionary argument is supplied, then returns only the items listed in {what} as a dictionary. The following string items are supported in {what}: - context get the context stored with |setqflist()| + changedtick get the total number of changes made + to the list |quickfix-changedtick| + context get the |quickfix-context| efm errorformat to use when parsing "lines". If not present, then the 'errorformat' option value is used. id get information for the quickfix list with |quickfix-ID|; zero means the id for the current list or the list specified by "nr" + idx index of the current entry in the list items quickfix list entries - lines use 'errorformat' to extract items from a list - of lines and return the resulting entries. - Only a |List| type is accepted. The current - quickfix list is not modified. + lines parse a list of lines using 'efm' and return + the resulting entries. Only a |List| type is + accepted. The current quickfix list is not + modified. See |quickfix-parse|. nr get information for this quickfix list; zero means the current quickfix list and "$" means the last quickfix list - title get the list title - winid get the |window-ID| (if opened) + size number of entries in the quickfix list + title get the list title |quickfix-title| + winid get the quickfix |window-ID| all all of the above quickfix properties - Non-string items in {what} are ignored. + Non-string items in {what} are ignored. To get the value of a + particular item, set it to zero. If "nr" is not present then the current quickfix list is used. If both "nr" and a non-zero "id" are specified, then the list specified by "id" is used. - To get the number of lists in the quickfix stack, set 'nr' to - '$' in {what}. The 'nr' value in the returned dictionary + To get the number of lists in the quickfix stack, set "nr" to + "$" in {what}. The "nr" value in the returned dictionary contains the quickfix stack size. - When 'text' is specified, all the other items are ignored. The - returned dictionary contains the entry 'items' with the list - of entries. - In case of error processing {what}, an empty dictionary is - returned. + When "lines" is specified, all the other items except "efm" + are ignored. The returned dictionary contains the entry + "items" with the list of entries. The returned dictionary contains the following entries: - context context information stored with |setqflist()| - id quickfix list ID |quickfix-ID| - items quickfix list entries - nr quickfix list number - title quickfix list title text - winid quickfix |window-ID| (if opened) - - Examples: > + changedtick total number of changes made to the + list |quickfix-changedtick| + context quickfix list context. See |quickfix-context| + If not present, set to "". + id quickfix list ID |quickfix-ID|. If not + present, set to 0. + idx index of the current entry in the list. If not + present, set to 0. + items quickfix list entries. If not present, set to + an empty list. + nr quickfix list number. If not present, set to 0 + size number of entries in the quickfix list. If not + present, set to 0. + title quickfix list title text. If not present, set + to "". + winid quickfix |window-ID|. If not present, set to 0 + + Examples (See also |getqflist-examples|): > :echo getqflist({'all': 1}) :echo getqflist({'nr': 2, 'title': 1}) :echo getqflist({'lines' : ["F1:10:L10"]}) < - getreg([{regname} [, 1 [, {list}]]]) *getreg()* The result is a String, which is the contents of register {regname}. Example: > @@ -6938,7 +6951,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* only the items listed in {what} are set. The first {list} argument is ignored. The following items can be specified in {what}: - context any Vim type can be stored as a context + context quickfix list context. See |quickfix-context| efm errorformat to use when parsing text from "lines". If this is not present, then the 'errorformat' option value is used. @@ -6960,10 +6973,10 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* list is modified, "id" should be used instead of "nr" to specify the list. - Examples: > + Examples (See also |setqflist-examples|): > :call setqflist([], 'r', {'title': 'My search'}) :call setqflist([], 'r', {'nr': 2, 'title': 'Errors'}) - :call setqflist([], 'a', {'id':myid, 'lines':["F1:10:L10"]}) + :call setqflist([], 'a', {'id':qfid, 'lines':["F1:10:L10"]}) < Returns zero for success, -1 for failure. |