mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -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 BufDelete * call s:RunBufDelete(expand('<abuf>'))
|
||||||
autocmd VimLeave *
|
autocmd VimLeave *
|
||||||
\ for s:jobbuf in keys(s:edit_jobs) |
|
\ 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! |
|
\ redraw! |
|
||||||
\ call call('s:RunWait', remove(s:edit_jobs, s:jobbuf)) |
|
\ call call('s:RunWait', remove(s:edit_jobs, s:jobbuf)) |
|
||||||
\ endfor
|
\ endfor
|
||||||
@@ -2706,7 +2706,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
\ 'escape': ''}
|
\ 'escape': ''}
|
||||||
let env.FUGITIVE = state.file
|
let env.FUGITIVE = state.file
|
||||||
let editor = 'sh ' . s:TempScript(
|
let editor = 'sh ' . s:TempScript(
|
||||||
\ '[ -f "$FUGITIVE.exit" ] && exit 1',
|
\ '[ -f "$FUGITIVE.exit" ] && cat "$FUGITIVE.exit" >&2 && exit 1',
|
||||||
\ 'echo "$1" > "$FUGITIVE.edit"',
|
\ 'echo "$1" > "$FUGITIVE.edit"',
|
||||||
\ 'printf "\033]51;fugitive:edit\007" >&2',
|
\ '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',
|
\ '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