motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit f4acdcc5b4de9a4bfb2d71b7587f165a5be9c148 (tree)
parent f7321f6d5b3c6838b9cf05e8f3df3a275f2f528b
Author: Tim Pope <code@tpope.net>
Date:   Sat, 27 Mar 2021 20:43:19 -0400

Eliminate blank line after resuming from GIT_EDITOR

Also add has_key(a:tmp, 'echo') checks to allow for future async
workflows.

Diffstat:
Mautoload/fugitive.vim | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim @@ -2490,6 +2490,9 @@ function! s:RunSend(job, str) abort endfunction function! s:RunEcho(tmp) abort + if !has_key(a:tmp, 'echo') + return + endif let data = a:tmp.echo let a:tmp.echo = matchstr(data, "[\r\n]\\+$") if len(a:tmp.echo) @@ -2541,7 +2544,10 @@ function! s:RunWait(state, tmp, job) abort throw 'fugitive: close callback did not fire; this should never happen' endif call s:RunEcho(a:tmp) - echo + if has_key(a:tmp, 'echo') + let a:tmp.echo = substitute(a:tmp.echo, "^\r\\=\n", '', '') + echo + endif call s:RunEdit(a:state, a:tmp, a:job) let finished = 1 finally