roryokane / detectindent

Vim script for automatically detecting indent settings
21 stars 6 forks source link

Remove the `g:detectindent_preferred_expandtab` option #8

Closed roryokane closed 9 years ago

roryokane commented 9 years ago

That option seems completely redundant with the built-in global 'expandtab' option, which can be read with &g:expandtab.

As a reminder, the option is supposed to be the default value of 'expandtab' when the algorithm cannot decide whether the buffer uses spaces or tabs. Now that I have re-examined the option, I think there is no need for it. Compared to just reading the global value of 'expandtab', the only advantage of the option is that it lets the DetectIndent default be different from the global (new-buffer or non-DetectIndent-ed) default. I don’t see a reason anyone would want that.

I plan to remove the option. When the correct value of 'expandtab' cannot be determined, I will either explicitly use its global value, or just leave the buffer’s 'expandtab' value as it was before running :DetectIndent (in case some autocommand of the user’s has customized it for the current filetype, for example).

I am posting this Issue to give users a chance to sayno, I need g:detectindent_preferred_expandtab for my setup to work; don’t remove it”. If you think this option is necessary and not actually redundant, post a comment.