Closed danielfalk closed 9 years ago
This is a pretty severe unintended consequence of b6b4c3b237678f1214ea2eca0e3e50eaafb30e3a. I'll revert.
(I do believe this is due to vim-javascript
using &sw
instead of the recommended shiftwidth()
.)
Yes, but shiftwidth()
is brand new as of 7.4, while 'shiftwidth'
is as old as vi itself. The transition will take years.
For the record: https://github.com/fatih/vim-go had the same problem: https://github.com/fatih/vim-go/pull/308, I proposed to use shiftwidth()
, which was accepted.
The notes for sleuth are quite clear: if a file is indented by tabs, then shiftwidth is set to 0. This creates a problem when I want to use vim-javascript. It seems that it wants to use the shiftwidth to indent, hence no indent at all.
So this is partly an issue, and partly a question. Which is the correct behavior? vim-javascript, or vim-sleuth? I don't know myself, but looking here: http://vim.wikia.com/wiki/Indenting_source_code suggests that shiftwidth should be the same value as tabstop (see section "Indentation purely with hard tabs").
Incidentally, I have ts=4 and sw=4 in my vimrc, but sleuth overwrites this value for the js file I'm trying to edit.
Thank you for your attention.