Fix undesired line wrap in :Git output

If Vim is 100 columns wide, and we echo a string exactly 100 characters
long, Vim will insert a line break that a terminal wouldn't.  This is
particularly noticeable with progress bars that Git erases with a screen
width's worth of whitespace.  Work around this by decreasing the number
of columns by 1.
This commit is contained in:
Tim Pope
2021-03-26 18:10:03 -04:00
parent 112310c026
commit 258dd16938

View File

@@ -2746,6 +2746,8 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
\ 'file': s:Resolve(tempname())}
if pager is# 1
call extend(env, {'COLUMNS': '' . get(g:, 'fugitive_columns', 80)}, 'keep')
else
call extend(env, {'COLUMNS': '' . &columns - 1}, 'keep')
endif
if s:RunJobs() && pager isnot# 1
let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim')))