From 258dd16938ba0dde57c05d4ba871f53af8fe9386 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 26 Mar 2021 18:10:03 -0400 Subject: [PATCH] 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. --- autoload/fugitive.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 95e3d65..a8fd0c2 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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')))