mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 05:13:53 -05:00
Add error message when editing after Vim exit
I don't think it's possible to see this, but we can use this error delivery system for other purposes.
This commit is contained in:
@@ -2542,7 +2542,7 @@ augroup fugitive_job
|
||||
autocmd BufDelete * call s:RunBufDelete(expand('<abuf>'))
|
||||
autocmd VimLeave *
|
||||
\ for s:jobbuf in keys(s:edit_jobs) |
|
||||
\ call writefile([], s:edit_jobs[s:jobbuf][0].file . '.exit') |
|
||||
\ call writefile(['Aborting edit due to Vim exit.'], s:edit_jobs[s:jobbuf][0].file . '.exit') |
|
||||
\ redraw! |
|
||||
\ call call('s:RunWait', remove(s:edit_jobs, s:jobbuf)) |
|
||||
\ endfor
|
||||
@@ -2706,7 +2706,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
||||
\ 'escape': ''}
|
||||
let env.FUGITIVE = state.file
|
||||
let editor = 'sh ' . s:TempScript(
|
||||
\ '[ -f "$FUGITIVE.exit" ] && exit 1',
|
||||
\ '[ -f "$FUGITIVE.exit" ] && cat "$FUGITIVE.exit" >&2 && exit 1',
|
||||
\ 'echo "$1" > "$FUGITIVE.edit"',
|
||||
\ 'printf "\033]51;fugitive:edit\007" >&2',
|
||||
\ 'while [ -f "$FUGITIVE.edit" -a ! -f "$FUGITIVE.exit" ]; do sleep 0.05 2>/dev/null || sleep 1; done',
|
||||
|
||||
Reference in New Issue
Block a user