From a1adfdc7d59979824addce2f519a527f9a5c0290 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 29 Nov 2017 01:50:11 -0500 Subject: ci: nodejs client acceptance-test #7706 ci: install nodejs 8 in Appveyor, Travis provider: check node version for debug support Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix. provider: test if nodejs in ci supports --inspect-brk nodejs host for neovim requires nodejs 6+ to work properly. nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`. provider: run cli.js of nodejs host directly npm shims are useless because the user cannot set node to debug mode via --inspect-brk. This is problematic on Windows which use batchfiles and shell scripts to compensate for not supporting shebang. The patch uses `npm root -g` to get the absolute path of the global npm modules. If that fails, then the user did not install neovim npm package globally. Use that absolute path to find `neovim/bin/cli.js`, which is what the npm shim actually runs with node. glob() is for a simple file check in case bin/ is removed because the npm shims are ignored now. --- runtime/autoload/health/provider.vim | 15 ++++++++++---- runtime/autoload/provider/node.vim | 40 +++++++++++++++++++++++++++--------- 2 files changed, 41 insertions(+), 14 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 0201ed8062..188b67c4c1 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -488,7 +488,7 @@ function! s:check_ruby() abort endfunction function! s:check_node() abort - call health#report_start('Node provider (optional)') + call health#report_start('Node.js provider (optional)') let loaded_var = 'g:loaded_node_provider' if exists(loaded_var) && !exists('*provider#node#Call') @@ -502,7 +502,14 @@ function! s:check_node() abort \ ['Install Node.js and verify that `node` and `npm` commands work.']) return endif - call health#report_info('Node: '. s:system('node -v')) + let node_v = get(split(s:system('node -v'), "\n"), 0, '') + call health#report_info('Node.js: '. node_v) + if !s:shell_error && s:version_cmp(node_v[1:], '6.0.0') < 0 + call health#report_warn('Neovim node.js host does not support '.node_v) + endif + if !provider#node#can_inspect() + call health#report_warn('node.js on this system does not support --inspect-brk so $NVIM_NODE_HOST_DEBUG is ignored.') + endif let host = provider#node#Detect() if empty(host) @@ -511,7 +518,7 @@ function! s:check_node() abort \ 'Is the npm bin directory in $PATH?']) return endif - call health#report_info('Host: '. host) + call health#report_info('Neovim node.js host: '. host) let latest_npm_cmd = has('win32') ? 'cmd /c npm info neovim --json' : 'npm info neovim --json' let latest_npm = s:system(split(latest_npm_cmd)) @@ -530,7 +537,7 @@ function! s:check_node() abort let latest_npm = get(get(pkg_data, 'dist-tags', {}), 'latest', 'unable to parse') endif - let current_npm_cmd = host .' --version' + let current_npm_cmd = ['node', host, '--version'] let current_npm = s:system(current_npm_cmd) if s:shell_error call health#report_error('Failed to run: '. current_npm_cmd, diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim index b08ad4f316..67b54c6439 100644 --- a/runtime/autoload/provider/node.vim +++ b/runtime/autoload/provider/node.vim @@ -5,8 +5,32 @@ let g:loaded_node_provider = 1 let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')} +" Support for --inspect-brk requires node 6.12+ or 7.6+ or 8+ +" Return 1 if it is supported +" Return 0 otherwise +function! provider#node#can_inspect() + if !executable('node') + return 0 + endif + let node_v = get(split(system(['node', '-v']), "\n"), 0, '') + if v:shell_error || node_v[0] !=# 'v' + return 0 + endif + " [major, minor, patch] + let node_v = split(node_v[1:], '\.') + return len(node_v) == 3 && ( + \ (node_v[0] > 7) || + \ (node_v[0] == 7 && node_v[1] >= 6) || + \ (node_v[0] == 6 && node_v[1] >= 12) + \ ) +endfunction + function! provider#node#Detect() abort - return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host') + let global_modules = get(split(system('npm root -g'), "\n"), 0, '') + if v:shell_error || !isdirectory(global_modules) + return '' + endif + return glob(global_modules . '/neovim/bin/cli.js') endfunction function! provider#node#Prog() @@ -19,18 +43,14 @@ function! provider#node#Require(host) abort return endif - if has('win32') - let args = provider#node#Prog() - else - let args = ['node'] - - if !empty($NVIM_NODE_HOST_DEBUG) - call add(args, '--inspect-brk') - endif + let args = ['node'] - call add(args , provider#node#Prog()) + if !empty($NVIM_NODE_HOST_DEBUG) && provider#node#can_inspect() + call add(args, '--inspect-brk') endif + call add(args, provider#node#Prog()) + try let channel_id = jobstart(args, s:job_opts) if rpcrequest(channel_id, 'poll') ==# 'ok' -- cgit From e0054fef7d351b0f8af3a04bb22d6e6ee8bae63f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 17 Dec 2017 15:03:07 +0100 Subject: health.vim: nodejs: skip if nodejs is too old --- runtime/autoload/health/provider.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 188b67c4c1..205a23dcbd 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -506,6 +506,8 @@ function! s:check_node() abort call health#report_info('Node.js: '. node_v) if !s:shell_error && s:version_cmp(node_v[1:], '6.0.0') < 0 call health#report_warn('Neovim node.js host does not support '.node_v) + " Skip further checks, they are nonsense if nodejs is too old. + return endif if !provider#node#can_inspect() call health#report_warn('node.js on this system does not support --inspect-brk so $NVIM_NODE_HOST_DEBUG is ignored.') @@ -540,8 +542,8 @@ function! s:check_node() abort let current_npm_cmd = ['node', host, '--version'] let current_npm = s:system(current_npm_cmd) if s:shell_error - call health#report_error('Failed to run: '. current_npm_cmd, - \ ['Report this issue with the output of: ', current_npm_cmd]) + call health#report_error('Failed to run: '. string(current_npm_cmd), + \ ['Report this issue with the output of: ', string(current_npm_cmd)]) return endif @@ -551,7 +553,7 @@ function! s:check_node() abort \ current_npm, latest_npm), \ ['Run in shell: npm update neovim']) else - call health#report_ok('Latest "neovim" npm is installed: '. current_npm) + call health#report_ok('Latest "neovim" npm package is installed: '. current_npm) endif endfunction -- cgit From 103ff26c0ae76491c73a6c078b52f2e56af16fb8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 17 Dec 2017 15:53:11 +0100 Subject: provider/nodejs: check version in Detect() --- runtime/autoload/provider/node.vim | 44 ++++++++++++++++++++++++----------- runtime/autoload/provider/python.vim | 6 ++--- runtime/autoload/provider/python3.vim | 6 ++--- runtime/autoload/provider/ruby.vim | 6 ++--- 4 files changed, 40 insertions(+), 22 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim index 67b54c6439..f75d2632be 100644 --- a/runtime/autoload/provider/node.vim +++ b/runtime/autoload/provider/node.vim @@ -5,24 +5,35 @@ let g:loaded_node_provider = 1 let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')} +function! s:is_minimum_version(version, min_major, min_minor) abort + let nodejs_version = a:version + if !a:version + let nodejs_version = get(split(system(['node', '-v']), "\n"), 0, '') + if v:shell_error || nodejs_version[0] !=# 'v' + return 0 + endif + endif + " [major, minor, patch] + let v_list = !!a:version ? a:version : split(nodejs_version[1:], '\.') + return len(v_list) == 3 + \ && ((str2nr(v_list[0]) > str2nr(a:min_major)) + \ || (str2nr(v_list[0]) == str2nr(a:min_major) + \ && str2nr(v_list[1]) >= str2nr(a:min_minor))) +endfunction + " Support for --inspect-brk requires node 6.12+ or 7.6+ or 8+ " Return 1 if it is supported " Return 0 otherwise -function! provider#node#can_inspect() +function! provider#node#can_inspect() abort if !executable('node') return 0 endif - let node_v = get(split(system(['node', '-v']), "\n"), 0, '') - if v:shell_error || node_v[0] !=# 'v' + let ver = get(split(system(['node', '-v']), "\n"), 0, '') + if v:shell_error || ver[0] !=# 'v' return 0 endif - " [major, minor, patch] - let node_v = split(node_v[1:], '\.') - return len(node_v) == 3 && ( - \ (node_v[0] > 7) || - \ (node_v[0] == 7 && node_v[1] >= 6) || - \ (node_v[0] == 6 && node_v[1] >= 12) - \ ) + return (ver[1] ==# '6' && s:is_minimum_version(ver, 6, 12)) + \ || s:is_minimum_version(ver, 7, 6) endfunction function! provider#node#Detect() abort @@ -30,10 +41,17 @@ function! provider#node#Detect() abort if v:shell_error || !isdirectory(global_modules) return '' endif - return glob(global_modules . '/neovim/bin/cli.js') + if !s:is_minimum_version(v:null, 6, 0) + return '' + endif + let entry_point = glob(global_modules . '/neovim/bin/cli.js') + if !filereadable(entry_point) + return '' + endif + return entry_point endfunction -function! provider#node#Prog() +function! provider#node#Prog() abort return s:prog endfunction @@ -69,7 +87,7 @@ function! provider#node#Require(host) abort throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE') endfunction -function! provider#node#Call(method, args) +function! provider#node#Call(method, args) abort if s:err != '' echoerr s:err return diff --git a/runtime/autoload/provider/python.vim b/runtime/autoload/provider/python.vim index 81fe194cb9..a06cbe4814 100644 --- a/runtime/autoload/provider/python.vim +++ b/runtime/autoload/provider/python.vim @@ -11,11 +11,11 @@ let g:loaded_python_provider = 1 let [s:prog, s:err] = provider#pythonx#Detect(2) -function! provider#python#Prog() +function! provider#python#Prog() abort return s:prog endfunction -function! provider#python#Error() +function! provider#python#Error() abort return s:err endfunction @@ -29,7 +29,7 @@ endif call remote#host#RegisterClone('legacy-python-provider', 'python') call remote#host#RegisterPlugin('legacy-python-provider', 'script_host.py', []) -function! provider#python#Call(method, args) +function! provider#python#Call(method, args) abort if s:err != '' return endif diff --git a/runtime/autoload/provider/python3.vim b/runtime/autoload/provider/python3.vim index 0c3b75b73d..242a224cb3 100644 --- a/runtime/autoload/provider/python3.vim +++ b/runtime/autoload/provider/python3.vim @@ -11,11 +11,11 @@ let g:loaded_python3_provider = 1 let [s:prog, s:err] = provider#pythonx#Detect(3) -function! provider#python3#Prog() +function! provider#python3#Prog() abort return s:prog endfunction -function! provider#python3#Error() +function! provider#python3#Error() abort return s:err endfunction @@ -29,7 +29,7 @@ endif call remote#host#RegisterClone('legacy-python3-provider', 'python3') call remote#host#RegisterPlugin('legacy-python3-provider', 'script_host.py', []) -function! provider#python3#Call(method, args) +function! provider#python3#Call(method, args) abort if s:err != '' return endif diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim index da73a0dfc0..3fb65fecdf 100644 --- a/runtime/autoload/provider/ruby.vim +++ b/runtime/autoload/provider/ruby.vim @@ -7,7 +7,7 @@ let g:loaded_ruby_provider = 1 let s:stderr = {} let s:job_opts = {'rpc': v:true} -function! s:job_opts.on_stderr(chan_id, data, event) +function! s:job_opts.on_stderr(chan_id, data, event) abort let stderr = get(s:stderr, a:chan_id, ['']) let last = remove(stderr, -1) let a:data[0] = last.a:data[0] @@ -23,7 +23,7 @@ function! provider#ruby#Detect() abort end endfunction -function! provider#ruby#Prog() +function! provider#ruby#Prog() abort return s:prog endfunction @@ -50,7 +50,7 @@ function! provider#ruby#Require(host) abort throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_RUBY_LOG_FILE') endfunction -function! provider#ruby#Call(method, args) +function! provider#ruby#Call(method, args) abort if s:err != '' echoerr s:err return -- cgit From c162bc629440afaf8910f1a29f1dfdb03f898101 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 16 Dec 2017 21:50:20 -0500 Subject: vim-patch:8.0.0420: text garbled when the system encoding differs from 'encoding' Problem: When running :make the output may be in the system encoding, different from 'encoding'. Solution: Add the 'makeencoding' option. (Ken Takata) https://github.com/vim/vim/commit/2c7292dc5bbf155fe2192d417363b8c085759cad --- runtime/doc/options.txt | 17 +++++++++++++++++ runtime/doc/quickfix.txt | 21 +++++++++++++++++++++ runtime/doc/quickref.txt | 1 + 3 files changed, 39 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index d3072d83e2..f70ec32bd8 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3809,6 +3809,23 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. + *'makeencoding'* *'menc'* +'makeencoding' 'menc' string (default "") + global or local to buffer |global-local| + {only available when compiled with the |+multi_byte| + feature} + {not in Vi} + Encoding used for reading the output of external commands. When empty, + encoding is not converted. + This is used for `:make`, `:lmake`, `:grep`, `:lgrep`, `:grepadd`, + `:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`, + and `:laddfile`. + + This would be mostly useful when you use MS-Windows. If |+iconv| is + enabled and GNU libiconv is used, setting 'makeencoding' to "char" has + the same effect as setting to the system locale encoding. Example: > + :set makeencoding=char " system locale is used +< *'makeprg'* *'mp'* 'makeprg' 'mp' string (default "make") global or local to buffer |global-local| diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index da167c0f5b..74f82b2c65 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -165,6 +165,9 @@ processing a quickfix or location list command, it will be aborted. keep Vim running while compiling. If you give the name of the errorfile, the 'errorfile' option will be set to [errorfile]. See |:cc| for [!]. + If the encoding of the error file differs from the + 'encoding' option, you can use the 'makeencoding' + option to specify the encoding. *:lf* *:lfile* :lf[ile][!] [errorfile] Same as ":cfile", except the location list for the @@ -176,6 +179,9 @@ processing a quickfix or location list command, it will be aborted. :cg[etfile] [errorfile] *:cg* *:cgetfile* Read the error file. Just like ":cfile" but don't jump to the first error. + If the encoding of the error file differs from the + 'encoding' option, you can use the 'makeencoding' + option to specify the encoding. :lg[etfile] [errorfile] *:lg* *:lgetfile* @@ -186,6 +192,9 @@ processing a quickfix or location list command, it will be aborted. :caddf[ile] [errorfile] Read the error file and add the errors from the errorfile to the current quickfix list. If a quickfix list is not present, then a new list is created. + If the encoding of the error file differs from the + 'encoding' option, you can use the 'makeencoding' + option to specify the encoding. *:laddf* *:laddfile* :laddf[ile] [errorfile] Same as ":caddfile", except the location list for the @@ -322,6 +331,7 @@ use this code: > endfunction au QuickfixCmdPost make call QfMakeConv() +Another option is using 'makeencoding'. EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: *:cdo* @@ -586,6 +596,9 @@ lists, use ":cnewer 99" first. like |:cnext| and |:cprevious|, see above. This command does not accept a comment, any " characters are considered part of the arguments. + If the encoding of the program output differs from the + 'encoding' option, you can use the 'makeencoding' + option to specify the encoding. *:lmak* *:lmake* :lmak[e][!] [arguments] @@ -645,6 +658,7 @@ read the error messages: > au QuickfixCmdPost make call QfMakeConv() (Example by Faque Cheng) +Another option is using 'makeencoding'. ============================================================================== 5. Using :vimgrep and :grep *grep* *lid* @@ -759,6 +773,9 @@ id-utils) in a similar way to its compiler integration (see |:make| above). When 'grepprg' is "internal" this works like |:vimgrep|. Note that the pattern needs to be enclosed in separator characters then. + If the encoding of the program output differs from the + 'encoding' option, you can use the 'makeencoding' + option to specify the encoding. *:lgr* *:lgrep* :lgr[ep][!] [arguments] Same as ":grep", except the location list for the @@ -783,6 +800,10 @@ id-utils) in a similar way to its compiler integration (see |:make| above). \ | catch /E480:/ \ | endtry" < + If the encoding of the program output differs from the + 'encoding' option, you can use the 'makeencoding' + option to specify the encoding. + *:lgrepa* *:lgrepadd* :lgrepa[dd][!] [arguments] Same as ":grepadd", except the location list for the diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index b22d2afa7e..902b0175a2 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -762,6 +762,7 @@ Short explanation of each option: *option-list* 'loadplugins' 'lpl' load plugin scripts when starting up 'magic' changes special characters in search patterns 'makeef' 'mef' name of the errorfile for ":make" +'makeencoding' 'menc' encoding of external make/grep commands 'makeprg' 'mp' program to use for the ":make" command 'matchpairs' 'mps' pairs of characters that "%" can match 'matchtime' 'mat' tenths of a second to show matching paren -- cgit From f3d7eeff7736b10e43b52016fe9de5daa000a585 Mon Sep 17 00:00:00 2001 From: quinoa42 Date: Sat, 30 Sep 2017 16:08:32 -0700 Subject: health.vim: Try `pyenv root` #7341 --- runtime/autoload/health/provider.vim | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 205a23dcbd..fbd8d50f1b 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -253,14 +253,18 @@ function! s:check_python(version) abort if !empty(pyenv) if empty(pyenv_root) - call health#report_warn( - \ 'pyenv was found, but $PYENV_ROOT is not set.', - \ ['Did you follow the final install instructions?', - \ 'If you use a shell "framework" like Prezto or Oh My Zsh, try without.', - \ 'Try a different shell (bash).'] + call health#report_info( + \ 'pyenv was found, but $PYENV_ROOT is not set. `pyenv root` will be used.' + \ .' If you run into problems, try setting $PYENV_ROOT explicitly.' \ ) + let pyenv_root = s:trim(s:system([pyenv, 'root'])) + endif + + if !isdirectory(pyenv_root) + call health#report_error('Invalid pyenv root: '.pyenv_root) else - call health#report_ok(printf('pyenv found: "%s"', pyenv)) + call health#report_info(printf('pyenv: %s', pyenv)) + call health#report_info(printf('pyenv root: %s', pyenv_root)) endif endif -- cgit From 2851bb9effafda599e21e3b639e99c636ce70ba6 Mon Sep 17 00:00:00 2001 From: Alex Genco Date: Sun, 17 Dec 2017 08:47:52 -0800 Subject: health.vim: mention g:ruby_host_prog #7737 --- runtime/autoload/health/provider.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index fbd8d50f1b..39e592c471 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -455,10 +455,11 @@ function! s:check_ruby() abort let host = provider#ruby#Detect() if empty(host) - call health#report_warn('Missing "neovim" gem.', - \ ['Run in shell: gem install neovim', - \ 'Is the gem bin directory in $PATH? Check `gem environment`.', - \ 'If you are using rvm/rbenv/chruby, try "rehashing".']) + call health#report_warn("`neovim-ruby-host` not found.", + \ ['Run `gem install neovim` to ensure the neovim RubyGem is installed.', + \ 'Run `gem environment` to ensure the gem bin directory is in $PATH.', + \ 'If you are using rvm/rbenv/chruby, try "rehashing".', + \ 'See :help g:ruby_host_prog for non-standard gem installations.']) return endif call health#report_info('Host: '. host) -- cgit From cca6d4b2674304d544b3880a616fd2ca7df2b891 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 18 Dec 2017 01:48:30 +0100 Subject: provider/nodejs: more robust version-check (#7738) --- runtime/autoload/provider/node.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim index f75d2632be..4e737fb51c 100644 --- a/runtime/autoload/provider/node.vim +++ b/runtime/autoload/provider/node.vim @@ -6,15 +6,18 @@ let g:loaded_node_provider = 1 let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')} function! s:is_minimum_version(version, min_major, min_minor) abort - let nodejs_version = a:version - if !a:version + if empty(a:version) let nodejs_version = get(split(system(['node', '-v']), "\n"), 0, '') if v:shell_error || nodejs_version[0] !=# 'v' return 0 endif + else + let nodejs_version = a:version endif + " Remove surrounding junk. Example: 'v4.12.0' => '4.12.0' + let nodejs_version = matchstr(nodejs_version, '\(\d\.\?\)\+') " [major, minor, patch] - let v_list = !!a:version ? a:version : split(nodejs_version[1:], '\.') + let v_list = split(nodejs_version, '\.') return len(v_list) == 3 \ && ((str2nr(v_list[0]) > str2nr(a:min_major)) \ || (str2nr(v_list[0]) == str2nr(a:min_major) -- cgit From fb8592b7ba673f230f144dc8c29e5dffc33fc50a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 18 Dec 2017 14:26:49 -0500 Subject: vim-patch:8.0.0517: there is no way to remove quickfix lists Problem: There is no way to remove quickfix lists (for testing). Solution: Add the 'f' action to setqflist(). Add tests. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/b6fa30ccc39cdb7f1d07b99fe2f4c6b61671dac2 --- runtime/doc/eval.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e337c5d6d5..efc8775d0a 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6855,16 +6855,19 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* Note that the list is not exactly the same as what |getqflist()| returns. - *E927* - If {action} is set to 'a', then the items from {list} are - added to the existing quickfix list. If there is no existing - list, then a new list is created. + {action} values: *E927* + 'a' The items from {list} are added to the existing + quickfix list. If there is no existing list, then a + new list is created. - If {action} is set to 'r', then the items from the current - quickfix list are replaced with the items from {list}. This - can also be used to clear the list: > - :call setqflist([], 'r') + 'r' The items from the current quickfix list are replaced + with the items from {list}. This can also be used to + clear the list: > + :call setqflist([], 'r') < + 'f' All the quickfix lists in the quickfix stack are + freed. + If {action} is not present or is set to ' ', then a new list is created. -- cgit From 4d2d844c12e1a94a5d3cbe93794bb04ef6fb8377 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 18 Dec 2017 21:40:34 -0500 Subject: vim-patch:8.0.0580: cannot set the valid flag with setqflist() Problem: Cannot set the valid flag with setqflist(). Solution: Add the "valid" argument. (Yegappan Lakshmanan, closes vim/vim#1642) https://github.com/vim/vim/commit/f1d21c8cc83f40c815b6bf13cd2043152db533ee --- runtime/doc/eval.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index efc8775d0a..0b50340dee 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6841,6 +6841,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* nr error number text description of the error type single-character error type, 'E', 'W', etc. + valid recognized error message The "col", "vcol", "nr", "type" and "text" entries are optional. Either "lnum" or "pattern" entry can be used to @@ -6850,6 +6851,8 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* item will not be handled as an error line. If both "pattern" and "lnum" are present then "pattern" will be used. + If the "valid" entry is not supplied, then the valid flag is + set when "bufnr" is a valid buffer or "filename" exists. If you supply an empty {list}, the quickfix list will be cleared. Note that the list is not exactly the same as what -- cgit