+26
-15
lines changedFilter options
+26
-15
lines changed Original file line number Diff line number Diff line change
@@ -148,14 +148,14 @@ endfunction
148
148
149
149
function! s:get_tmux_option(option) abort
150
150
let cmd = 'tmux show-option -qvg '.a:option " try global scope
151
-
let out = system(cmd)
151
+
let out = system(split(cmd))
152
152
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
153
153
if v:shell_error
154
154
call health#report_error('command failed: '.cmd."\n".out)
155
155
return 'error'
156
156
elseif empty(val)
157
157
let cmd = 'tmux show-option -qvgs '.a:option " try session scope
158
-
let out = system(cmd)
158
+
let out = system(split(cmd))
159
159
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
160
160
if v:shell_error
161
161
call health#report_error('command failed: '.cmd."\n".out)
@@ -202,11 +202,11 @@ function! s:check_tmux() abort
202
202
" check default-terminal and $TERM
203
203
call health#report_info('$TERM: '.$TERM)
204
204
let cmd = 'tmux show-option -qvg default-terminal'
205
-
let out = system(cmd)
205
+
let out = system(split(cmd))
206
206
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
207
207
if empty(tmux_default_term)
208
208
let cmd = 'tmux show-option -qvgs default-terminal'
209
-
let out = system(cmd)
209
+
let out = system(split(cmd))
210
210
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
211
211
endif
212
212
@@ -225,7 +225,7 @@ function! s:check_tmux() abort
225
225
endif
226
226
227
227
" check for RGB capabilities
228
-
let info = system('tmux server-info')
228
+
let info = system(['tmux', 'server-info'])
229
229
let has_tc = stridx(info, " Tc: (flag) true") != -1
230
230
let has_rgb = stridx(info, " RGB: (flag) true") != -1
231
231
if !has_tc && !has_rgb
@@ -242,7 +242,7 @@ function! s:check_terminal() abort
242
242
endif
243
243
call health#report_start('terminal')
244
244
let cmd = 'infocmp -L'
245
-
let out = system(cmd)
245
+
let out = system(split(cmd))
246
246
let kbs_entry = matchstr(out, 'key_backspace=[^,[:space:]]*')
247
247
let kdch1_entry = matchstr(out, 'key_dc=[^,[:space:]]*')
248
248
Original file line number Diff line number Diff line change
@@ -565,7 +565,7 @@ function! s:check_ruby() abort
565
565
\ ['Install Ruby and verify that `ruby` and `gem` commands work.'])
566
566
return
567
567
endif
568
-
call health#report_info('Ruby: '. s:system('ruby -v'))
568
+
call health#report_info('Ruby: '. s:system(['ruby', '-v']))
569
569
570
570
let [host, err] = provider#ruby#Detect()
571
571
if empty(host)
@@ -588,11 +588,11 @@ function! s:check_ruby() abort
588
588
endif
589
589
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 0, 'not found')
590
590
591
-
let current_gem_cmd = host .' --version'
591
+
let current_gem_cmd = [host, '--version']
592
592
let current_gem = s:system(current_gem_cmd)
593
593
if s:shell_error
594
-
call health#report_error('Failed to run: '. current_gem_cmd,
595
-
\ ['Report this issue with the output of: ', current_gem_cmd])
594
+
call health#report_error('Failed to run: '. join(current_gem_cmd),
595
+
\ ['Report this issue with the output of: ', join(current_gem_cmd)])
596
596
return
597
597
endif
598
598
@@ -619,7 +619,7 @@ function! s:check_node() abort
619
619
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
620
620
return
621
621
endif
622
-
let node_v = get(split(s:system('node -v'), "\n"), 0, '')
622
+
let node_v = get(split(s:system(['node', '-v']), "\n"), 0, '')
623
623
call health#report_info('Node.js: '. node_v)
624
624
if s:shell_error || s:version_cmp(node_v[1:], '6.0.0') < 0
625
625
call health#report_warn('Nvim node.js host does not support '.node_v)
@@ -660,8 +660,8 @@ function! s:check_node() abort
660
660
let current_npm_cmd = ['node', host, '--version']
661
661
let current_npm = s:system(current_npm_cmd)
662
662
if s:shell_error
663
-
call health#report_error('Failed to run: '. string(current_npm_cmd),
664
-
\ ['Report this issue with the output of: ', string(current_npm_cmd)])
663
+
call health#report_error('Failed to run: '. join(current_npm_cmd),
664
+
\ ['Report this issue with the output of: ', join(current_npm_cmd)])
665
665
return
666
666
endif
667
667
@@ -734,8 +734,8 @@ function! s:check_perl() abort
734
734
let current_cpan_cmd = [perl_exec, '-W', '-MNeovim::Ext', '-e', 'print $Neovim::Ext::VERSION']
735
735
let current_cpan = s:system(current_cpan_cmd)
736
736
if s:shell_error
737
-
call health#report_error('Failed to run: '. string(current_cpan_cmd),
738
-
\ ['Report this issue with the output of: ', string(current_cpan_cmd)])
737
+
call health#report_error('Failed to run: '. join(current_cpan_cmd),
738
+
\ ['Report this issue with the output of: ', join(current_cpan_cmd)])
739
739
return
740
740
endif
741
741
Original file line number Diff line number Diff line change
@@ -230,3 +230,14 @@ describe('health.vim', function()
230
230
end)
231
231
end)
232
232
end)
233
+
234
+
describe(':checkhealth provider', function()
235
+
it("works correctly with a wrongly configured 'shell'", function()
236
+
clear()
237
+
command([[set shell=echo\ WRONG!!!]])
238
+
command('let g:loaded_perl_provider = 0')
239
+
command('let g:loaded_python3_provider = 0')
240
+
command('checkhealth provider')
241
+
eq(nil, string.match(curbuf_contents(), 'WRONG!!!'))
242
+
end)
243
+
end)
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4