From 56a48ab94066983df730b2aaf4257c8f2de879c0 Mon Sep 17 00:00:00 2001 From: tyru Date: Tue, 9 Feb 2016 01:28:26 +0900 Subject: [PATCH 1/2] Use shiftwidth() function instead of &sw See https://github.com/vim/vim/pull/578 --- indent/gitconfig.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indent/gitconfig.vim b/indent/gitconfig.vim index 7d5d44b..1d3a576 100644 --- a/indent/gitconfig.vim +++ b/indent/gitconfig.vim @@ -24,13 +24,13 @@ function! GetGitconfigIndent() let cline = getline(v:lnum) if line =~ '\\\@ Date: Thu, 11 Feb 2016 17:09:20 +0900 Subject: [PATCH 2/2] Use shiftwidth() in a backwards compatible way --- indent/gitconfig.vim | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/indent/gitconfig.vim b/indent/gitconfig.vim index 1d3a576..f951c73 100644 --- a/indent/gitconfig.vim +++ b/indent/gitconfig.vim @@ -19,18 +19,30 @@ if exists("*GetGitconfigIndent") finish endif +" The shiftwidth() exists since patch 7.3.694 +" Don't require it to exist. +if exists('*shiftwidth') + function s:sw() abort + return shiftwidth() + endfunction +else + function s:sw() abort + return &shiftwidth + endfunction +endif + function! GetGitconfigIndent() let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) if line =~ '\\\@