vim-indent-detect

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

commit
93d7839a4df53c2b540297cb9c145781f6f1a338
parent
4c3b7716ce118b562eae9fea8ba2981c7ecbb8eb
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-06-11 06:43
use &g:shiftwidth instead of g:detectindent_preferred_indent

Diffstat

M autoload/detectindent.vim 2 +-
M plugin/detectindent.vim 4 ----

2 files changed, 1 insertions, 5 deletions


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

@@ -1,6 +1,6 @@
    1     1 function! detectindent#Set(expandtab, ...)
    2     2 	let &l:expandtab = a:expandtab
    3    -1 	let l:width = get(a:, 1, g:detectindent_preferred_indent)
   -1     3 	let l:width = get(a:, 1, &g:shiftwidth)
    4     4 
    5     5 	let &l:tabstop = l:width
    6     6 	let &l:shiftwidth = l:width

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

@@ -1,7 +1,3 @@
    1    -1 if !exists('g:detectindent_preferred_indent')
    2    -1 	let g:detectindent_preferred_indent = 4
    3    -1 endif
    4    -1 
    5     1 command! -nargs=? Tabs call detectindent#Set(0, <f-args>)
    6     2 command! -nargs=? Spaces call detectindent#Set(1, <f-args>)
    7     3