diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-12-10 15:26:15 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-12-10 15:26:15 +0100 |
commit | 74240d3febd1e3bc7cf086c647c9348b20716c33 (patch) | |
tree | 39569da540c965ef7344342842d033684e25d42e /runtime | |
parent | 35c5e8155da797f14124d98fdc6189067b965688 (diff) |
patch 8.0.1384: not enough quickfix help; confusing winidv8.0.1384
Problem: Not enough quickfix help; confusing winid.
Solution: Add more examples in the help. When the quickfix window is not
present, return zero for getqflist() with 'winid'. Add more tests
for jumping to quickfix list entries. (Yegappan Lakshmanan, closes
#2427)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 21 | ||||
-rw-r--r-- | runtime/doc/quickfix.txt | 59 |
2 files changed, 72 insertions, 8 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 4d524679d3..93e818a442 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.0. Last change: 2017 Nov 24 +*eval.txt* For Vim version 8.0. Last change: 2017 Dec 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2031,7 +2031,7 @@ assert_true({actual} [, {msg}]) none assert {actual} is true asin({expr}) Float arc sine of {expr} atan({expr}) Float arc tangent of {expr} atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2} -balloon_show({msg}) none show {msg} inside the balloon +balloon_show({expr}) none show {expr} inside the balloon balloon_split({msg}) List split {msg} as used for a balloon browse({save}, {title}, {initdir}, {default}) String put up a file requester @@ -3056,12 +3056,16 @@ ch_open({address} [, {options}]) *ch_open()* ch_read({handle} [, {options}]) *ch_read()* Read from {handle} and return the received message. {handle} can be a Channel or a Job that has a Channel. + For a NL channel this waits for a NL to arrive, except when + there is nothing more to read (channel was closed). See |channel-more|. {only available when compiled with the |+channel| feature} ch_readraw({handle} [, {options}]) *ch_readraw()* Like ch_read() but for a JS and JSON channel does not decode - the message. See |channel-more|. + the message. For a NL channel it does not block waiting for + the NL to arrive, but otherwise works like ch_read(). + See |channel-more|. {only available when compiled with the |+channel| feature} ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()* @@ -4679,9 +4683,10 @@ getqflist([{what}]) *getqflist()* the last quickfix list size number of entries in the quickfix list title get the list title - winid get the |window-ID| (if opened) + 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 one. 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. @@ -4702,7 +4707,7 @@ getqflist([{what}]) *getqflist()* nr quickfix list number size number of entries in the quickfix list title quickfix list title text - winid quickfix |window-ID| (if opened) + winid quickfix |window-ID|. If not present, set to 0 Examples: > :echo getqflist({'all': 1}) @@ -8793,8 +8798,8 @@ writefile({list}, {fname} [, {flags}]) the file. This flushes the file to disk, if possible. This takes more time but avoids losing the file if the system crashes. - When {flags} does not contain "S" or "s" then fsync is called - if the 'fsync' option is set. + When {flags} does not contain "S" or "s" then fsync() is + called if the 'fsync' option is set. When {flags} contains "S" then fsync() is not called, even when 'fsync' is set. diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index cfbfe4c856..ff66582a00 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -341,6 +341,50 @@ use this code: > au QuickfixCmdPost make call QfMakeConv() Another option is using 'makeencoding'. + *quickfix-title* +Every quickfix and location list has a title. By default the title is set to +the command that created the list. The |getqflist()| and |getloclist()| +functions can be used to get the title of a quickfix and a location list +respectively. The |setqflist()| and |setloclist()| functions can be used to +modify the title of a quickfix and location list respectively. Examples: > + call setqflist([], 'a', {'title' : 'Cmd output'}) + echo getqflist({'title' : 1}) + call setloclist(3, [], 'a', {'title' : 'Cmd output'}) + echo getloclist(3, {'title' : 1}) +< + *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: > + echo getqflist({'size' : 1}) + echo getloclist(5, {'size' : 1}) +< + *quickfix-context* +Any Vim type can be associated as a context with a quickfix or location list. +The |setqflist()| and the |setloclist()| functions can be used to associate a +context with a quickfix and a location list respectively. The |getqflist()| +and the |getloclist()| functions can be used to retrieve the context of a +quickifx and a location list respectively. This is useful for a Vim plugin +dealing with multiple quickfix/location lists. +Examples: > + + let somectx = {'name' : 'Vim', 'type' : 'Editor'} + call setqflist([], 'a', {'context' : somectx}) + echo getqflist({'context' : 1}) + + let newctx = ['red', 'green', 'blue'] + call setloclist(2, [], 'a', {'id' : qfid, 'context' : newctx}) + echo getloclist(2, {'id' : qfid, 'context' : 1}) +< + *quickfix-parse* +You can parse a list of lines using 'erroformat' without creating or modifying +a quickfix list using the |getqflist()| function. Examples: > + echo getqflist({'lines' : ["F1:10:Line10", "F2:20:Line20"]}) + echo getqflist({'lines' : systemlist('grep -Hn quickfix *')}) +This returns a dictionary where the 'items' key contains the list of quickfix +entries parsed from lines. The following shows how to use a custom +'errorformat' to parse the lines without modifying the 'erroformat' option: > + echo getqflist({'efm' : '%f#%l#%m', 'lines' : ['F1#10#Line']}) +< EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: *:cdo* @@ -542,6 +586,13 @@ In all of the above cases, if the location list for the selected window is not yet set, then it is set to the location list displayed in the location list window. + *quickfix-window-ID* +You can use the |getqflist()| and |getloclist()| functions to obtain the +window ID of the quickfix window and location list window respectively (if +present). Examples: > + echo getqflist({'winid' : 1}).winid + echo getloclist(2, {'winid' : 1}).winid +< ============================================================================= 3. Using more than one list of errors *quickfix-error-lists* @@ -586,6 +637,14 @@ list, one newer list is overwritten. This is especially useful if you are browsing with ":grep" |grep|. If you want to keep the more recent error lists, use ":cnewer 99" first. +To get the number of lists in the quickfix and location list stack, you can +use the |getqflist()| and |getloclist()| functions respectively with the list +number set to the special value '$'. Examples: > + echo getqflist({'nr' : '$'}).nr + echo getloclist(3, {'nr' : '$'}).nr +To get the number of the current list in the stack: > + echo getqflist({'nr' : 0}).nr +< ============================================================================= 4. Using :make *:make_makeprg* |