diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2017-12-06 12:56:27 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2017-12-06 12:56:27 +0100 |
commit | dce9e8dec5ef51730291c7bbff3e3997433eabbd (patch) | |
tree | 1ca7140cd4244dfdff3d8d58f936d9dc159c9d4e /autoload/fish.vim | |
parent | 30c87b73deff05c7dd9590228c0615a3299f39ff (diff) | |
download | vim-polyglot-dce9e8dec5ef51730291c7bbff3e3997433eabbd.tar.gz vim-polyglot-dce9e8dec5ef51730291c7bbff3e3997433eabbd.zip |
Update
Diffstat (limited to 'autoload/fish.vim')
-rw-r--r-- | autoload/fish.vim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/autoload/fish.vim b/autoload/fish.vim index ac422a42..d4e63cdc 100644 --- a/autoload/fish.vim +++ b/autoload/fish.vim @@ -1,6 +1,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1 function! fish#Indent() + let l:shiftwidth = shiftwidth() let l:prevlnum = prevnonblank(v:lnum - 1) if l:prevlnum ==# 0 return 0 @@ -8,15 +9,15 @@ function! fish#Indent() let l:indent = 0 let l:prevline = getline(l:prevlnum) if l:prevline =~# '\v^\s*switch>' - let l:indent = &shiftwidth * 2 + let l:indent = l:shiftwidth * 2 elseif l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case)>' - let l:indent = &shiftwidth + let l:indent = l:shiftwidth endif let l:line = getline(v:lnum) if l:line =~# '\v^\s*end>' - return indent(v:lnum) - (l:indent ==# 0 ? &shiftwidth : l:indent) + return indent(v:lnum) - (l:indent ==# 0 ? l:shiftwidth : l:indent) elseif l:line =~# '\v^\s*%(case|else)>' - return indent(v:lnum) - &shiftwidth + return indent(v:lnum) - l:shiftwidth endif return indent(l:prevlnum) + l:indent endfunction |