Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use s:shell_error not v:shell_error, especially for the subprocess created by python. #864

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions autoload/tagbar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -680,16 +680,16 @@ function! s:CheckForExCtags(silent) abort
let ctags_output = s:ExecuteCtags(ctags_cmd)

call tagbar#debug#log("Command output:\n" . ctags_output)
call tagbar#debug#log('Exit code: ' . v:shell_error)
call tagbar#debug#log('Exit code: ' . s:shell_error)

if v:shell_error || ctags_output !~# '\(Exuberant\|Universal\) Ctags'
if s:shell_error || ctags_output !~# '\(Exuberant\|Universal\) Ctags'
let l:errmsg = 'Tagbar: Ctags doesn''t seem to be Exuberant Ctags!'
let l:infomsg = 'BSD ctags will NOT WORK.' .
\ ' Please download Exuberant Ctags from ctags.sourceforge.net' .
\ ' and install it in a directory in your $PATH' .
\ ' or set g:tagbar_ctags_bin.'
call s:CtagsErrMsg(l:errmsg, l:infomsg, a:silent,
\ ctags_cmd, ctags_output, v:shell_error)
\ ctags_cmd, ctags_output, s:shell_error)
let s:checked_ctags = 2
return 0
elseif !s:CheckExCtagsVersion(ctags_output)
Expand Down Expand Up @@ -798,7 +798,7 @@ function! s:GetSupportedFiletypes() abort

let ctags_output = s:ExecuteCtags(ctags_cmd)

if v:shell_error
if s:shell_error
" this shouldn't happen as potential problems would have already been
" caught by the previous ctags checking
return
Expand Down Expand Up @@ -1453,10 +1453,10 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort

let ctags_output = s:ExecuteCtags(ctags_cmd)

if v:shell_error || ctags_output =~? 'Warning: cannot open \(source\|input\) file'
if s:shell_error || ctags_output =~? 'Warning: cannot open \(source\|input\) file'
call tagbar#debug#log('Command output:')
call tagbar#debug#log(ctags_output)
call tagbar#debug#log('Exit code: ' . v:shell_error)
call tagbar#debug#log('Exit code: ' . s:shell_error)
" Only display an error message if the Tagbar window is open and we
" haven't seen the error before.
if bufwinnr(s:TagbarBufName()) != -1 &&
Expand All @@ -1470,7 +1470,7 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
echomsg line
endfor
endif
echomsg 'Exit code: ' . v:shell_error
echomsg 'Exit code: ' . s:shell_error
endif
return -1
endif
Expand Down Expand Up @@ -3158,8 +3158,9 @@ function! s:ExecuteCtags(ctags_cmd) abort

if tagbar#debug#enabled()
silent 5verbose let ctags_output = system(a:ctags_cmd)
let s:shell_error = v:shell_error
call tagbar#debug#log(v:statusmsg)
call tagbar#debug#log('Exit code: ' . v:shell_error)
call tagbar#debug#log('Exit code: ' . s:shell_error)
redraw!
else
let py_version = get(g:, 'tagbar_python', 1)
Expand Down
Loading