mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-07 20:54:33 +08:00
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:
@@ -2746,6 +2746,8 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
\ 'file': s:Resolve(tempname())}
|
\ 'file': s:Resolve(tempname())}
|
||||||
if pager is# 1
|
if pager is# 1
|
||||||
call extend(env, {'COLUMNS': '' . get(g:, 'fugitive_columns', 80)}, 'keep')
|
call extend(env, {'COLUMNS': '' . get(g:, 'fugitive_columns', 80)}, 'keep')
|
||||||
|
else
|
||||||
|
call extend(env, {'COLUMNS': '' . &columns - 1}, 'keep')
|
||||||
endif
|
endif
|
||||||
if s:RunJobs() && pager isnot# 1
|
if s:RunJobs() && pager isnot# 1
|
||||||
let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim')))
|
let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim')))
|
||||||
|
|||||||
Reference in New Issue
Block a user