vim-indent-detect

A Vim plugin for handeling indentation.
git clone https://git.ce9e.org/vim-indent-detect.git

commit
8feee4653ce6460506dc66806fe1f5f00f25f574
parent
9e851a2d5c7acbd2c6a5f955cfac553be2a50137
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-05-20 05:44
refactor optional args

Diffstat

M autoload/detectindent.vim 13 ++-----------

1 files changed, 2 insertions, 11 deletions


diff --git a/autoload/detectindent.vim b/autoload/detectindent.vim

@@ -1,15 +1,6 @@
    1     1 function! detectindent#Set(...)
    2    -1 	if a:0 < 1
    3    -1 		let &l:expandtab = g:detectindent_preferred_expandtab
    4    -1 	else
    5    -1 		let &l:expandtab = a:1
    6    -1 	endif
    7    -1 
    8    -1 	if a:0 < 2
    9    -1 		let l:width = g:detectindent_preferred_indent
   10    -1 	else
   11    -1 		let l:width = a:2
   12    -1 	endif
   -1     2 	let &l:expandtab = get(a:, 1, g:detectindent_preferred_expandtab)
   -1     3 	let l:width = get(a:, 2, g:detectindent_preferred_indent)
   13     4 
   14     5 	let &l:tabstop = l:width
   15     6 	let &l:shiftwidth = l:width