aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/indent.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/autoload/indent.vim')
-rw-r--r--vim/autoload/indent.vim20
1 files changed, 5 insertions, 15 deletions
diff --git a/vim/autoload/indent.vim b/vim/autoload/indent.vim
index d597653f..19a9f03d 100644
--- a/vim/autoload/indent.vim
+++ b/vim/autoload/indent.vim
@@ -10,7 +10,7 @@ function! indent#Spaces(...) abort
" If we have the patch that supports it, set 'softtabstop' to dynamically
" mirror the value of 'shiftwidth'; failing that, just copy it
- let &l:softtabstop = has#('patch-7.3.693')
+ let &l:softtabstop = patch#('7.3.693')
\ ? -1
\ : &l:shiftwidth
@@ -19,27 +19,17 @@ endfunction
" Set the current buffer to tab indent
function! indent#Tabs() abort
- setlocal noexpandtab
- setlocal shiftwidth< softtabstop<
+ setlocal noexpandtab shiftwidth< softtabstop<
call indent#Undo()
endfunction
" Add commands to b:undo_indent to clean up buffer-local indentation changes
" on a change of filetype
function! indent#Undo() abort
-
- " Check and set a flag so that we only do this once per buffer
- if exists('b:undo_indent_type_set')
- return
- endif
- let b:undo_indent_type_set = 1
-
- " Either set or append relevant commands to b:undo_indent
- let l:undo = 'setlocal expandtab< shiftwidth< softtabstop< tabstop<'
+ let undo = 'setlocal expandtab< shiftwidth< softtabstop<'
if exists('b:undo_indent')
- let b:undo_indent .= '|'.l:undo
+ let b:undo_indent .= '|'.undo
else
- let b:undo_indent = l:undo
+ let b:undo_indent = undo
endif
-
endfunction