Skip to content
Myr

[vim] Consistent exit status handling

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 545370d · Browse files · 1 file+16 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−16 removed

  • other:+16 added−16 removed

1 file+16 added−16 removed

modified:plugin/fzf.vim+16 added-16 removed
220 unmodified lines
221endfunction222unlet! s:launcher223let s:launcher = function('s:xterm_launcher')224225function! s:exit_handler(code, command, ...)226 if a:code == 130227 return 0228 elseif a:code > 1229 call s:error('Error running ' . a:command)230 if !empty(a:000)231 sleep232 endif233 return 0234 endif235 return 1236endfunction237238function! s:execute(dict, command, temps)239 call s:pushd(a:dict)240 silent! !clear 2> /dev/null241 let escaped = escape(substitute(a:command, '\n', '\\n', 'g'), '%#')
5 unmodified lines
247 let command = escaped248 endif249 execute 'silent !'.command250 redraw!238 if v:shell_error == 0 || v:shell_error == 1239 return s:callback(a:dict, a:temps)240 " Do not print error message on exit status 130 (interrupt)241 elseif v:shell_error == 130242 return []243 else244 call s:error('Error running ' . command)245 endif251 return s:exit_handler(v:shell_error, command) ? s:callback(a:dict, a:temps) : []252endfunction253254function! s:execute_tmux(dict, command, temps)255 let command = a:command
3 unmodified lines
259 endif260261 call system(command)262 redraw!257 if v:shell_error == 2258 call s:error('Error running ' . command)259 return []260 endif261 return s:callback(a:dict, a:temps)263 return s:exit_handler(v:shell_error, command) ? s:callback(a:dict, a:temps) : []264endfunction265266function! s:calc_size(max, val, dict)267 if a:val =~ '%$'
67 unmodified lines
335 wincmd p336 endif337 endif338337 if a:code == 2338 call s:error('Error running ' . s:command)339 sleep339 if !s:exit_handler(a:code, s:command, 1)340 return341 endif342343 call s:pushd(self.dict)
93 unmodified lines