From 4aeca0c56695f322463982d25cb6db21593f92c0 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 5 May 2021 16:15:50 -0400 Subject: [PATCH] Drop support for Vim older than 7.4 --- autoload/fugitive.vim | 64 ++++++++++--------------------------------- plugin/fugitive.vim | 12 ++++---- 2 files changed, 19 insertions(+), 57 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 7799520..1d8bff8 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -72,14 +72,11 @@ function! s:shellesc(arg) abort endif endfunction -let s:fnameescape = " \t\n*?[{`$\\%#'\"|!<" function! s:fnameescape(file) abort if type(a:file) == type([]) return join(map(copy(a:file), 's:fnameescape(v:val)')) - elseif exists('*fnameescape') - return fnameescape(a:file) else - return escape(a:file, s:fnameescape) + return fnameescape(a:file) endif endfunction @@ -88,8 +85,8 @@ function! s:throw(string) abort endfunction function! s:VersionCheck() abort - if v:version < 703 - return 'return ' . string('echoerr "fugitive: Vim 7.3 or newer required"') + if v:version < 704 + return 'return ' . string('echoerr "fugitive: Vim 7.4 or newer required"') elseif empty(fugitive#GitVersion()) let exe = get(s:GitCmd(), 0, '') if len(exe) && !executable(exe) @@ -227,21 +224,13 @@ function! s:TempScript(...) abort endfunction function! s:DoAutocmd(...) abort - if v:version >= 704 || (v:version == 703 && has('patch442')) - return join(map(copy(a:000), "'doautocmd ' . v:val"), '|') - elseif &modelines > 0 - return 'try|set modelines=0|' . join(map(copy(a:000), "'doautocmd ' . v:val"), '|') . '|finally|set modelines=' . &modelines . '|endtry' - else - return join(map(copy(a:000), "'doautocmd ' . v:val"), '|') - endif + return join(map(copy(a:000), "'doautocmd ' . v:val"), '|') endfunction -let s:nowait = v:version >= 704 ? '' : '' - function! s:Map(mode, lhs, rhs, ...) abort let maps = [] let defer = a:0 && a:1 =~# '' || get(g:, 'fugitive_defer_to_existing_maps') - let flags = substitute(a:0 ? a:1 : '', '', '', '') . (a:rhs =~# '' ? '' : '