diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-09 16:48:49 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-09 16:48:49 +0200 |
commit | 2e1a9806326445c5cbdbb3b0cc7d82c7a16881b0 (patch) | |
tree | 234734b2c6cbb14f718945e408f8bea7faf566b7 | |
parent | cecfb5dd10497d09fc46e85c15c383166d9fb22a (diff) | |
download | vim-polyglot-2e1a9806326445c5cbdbb3b0cc7d82c7a16881b0.tar.gz vim-polyglot-2e1a9806326445c5cbdbb3b0cc7d82c7a16881b0.zip |
Add missing functions from Sleuth, #541
-rw-r--r-- | ftdetect/polyglot.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 7b243901..fd1dd3d7 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1923,10 +1923,24 @@ if !has_key(s:disabled_packages, 'autoindent') setglobal smarttab + function! SleuthIndicator() abort + let sw = &shiftwidth ? &shiftwidth : &tabstop + if &expandtab + return 'sw='.sw + elseif &tabstop == sw + return 'ts='.&tabstop + else + return 'sw='.sw.',ts='.&tabstop + endif + endfunction + augroup polyglot autocmd! autocmd FileType * call s:detect_indent() + autocmd User Flags call Hoist('buffer', 5, 'SleuthIndicator') augroup END + + command! -bar -bang Sleuth call s:detect_indent() endif " restore Vi compatibility settings |