summaryrefslogtreecommitdiffstats
path: root/indent/gitconfig.vim
diff options
context:
space:
mode:
Diffstat (limited to 'indent/gitconfig.vim')
-rw-r--r--indent/gitconfig.vim7
1 files changed, 4 insertions, 3 deletions
diff --git a/indent/gitconfig.vim b/indent/gitconfig.vim
index 6fc4ba33..e0e4a456 100644
--- a/indent/gitconfig.vim
+++ b/indent/gitconfig.vim
@@ -22,17 +22,18 @@ if exists("*GetGitconfigIndent")
endif
function! GetGitconfigIndent()
+ let sw = exists('*shiftwidth') ? shiftwidth() : &sw
let line = getline(prevnonblank(v:lnum-1))
let cline = getline(v:lnum)
if line =~ '\\\@<!\%(\\\\\)*\\$'
" odd number of slashes, in a line continuation
- return 2 * &sw
+ return 2 * sw
elseif cline =~ '^\s*\['
return 0
elseif cline =~ '^\s*\a'
- return &sw
+ return sw
elseif cline == '' && line =~ '^\['
- return &sw
+ return sw
else
return -1
endif