Closed ogier closed 12 years ago
Sorry, I'm not a fan. If you're resorting to guesswork based upon ratios, it strongly suggests that your indenting style is screwed up and inconsistent. If that's the case, automatic detection is a lost cause.
Fair enough. In my experience, the most common time for indentation to be messed up is when someone who is less anal about whitespace than I am commits a few lines with wonky indentation. At that point, I don't want my indentation checker to suddenly switch to adjusting tabstop and using tabs or suddenly switch to adjusting softtabstop and using spaces.
It's a big change, and I can understand having different preferences, so I guess it will have to just live on as a fork.
@ogier FYI, #20 has been merged and may provide an alternative solution to your problem: add options to use the "preferred" setting when mixed indentation is found.
In my experience this plugin gets the indentation wrong too often to be useful in its current state, and it adjusts different settings depending on what it finds. So I modified it to only ever adjust shiftwidth, softtabstop and of course expandtab, and only when it can make a reasonable guess about what's going on.
I'm not sure whether this is an appropriate pull request to actually be merged in upstream, because it does change behavior in some noticeable ways. In any case, here it is, and here's what I changed: