On Monday, July 25, 2016 at 9:26:21 AM UTC-5, Rob Foehl wrote: > I've stumbled over the unfortunate tendency of 'preserveindent' to mix > spaces and tabs [1] -- as noted in the help [2], but nonetheless > unexpected -- enough times now that I've been looking into the history of > this feature and why this behavior exists, and I've found a couple of > interesting points: > > - 'preserveindent' doesn't seem to be widely used or understood. Trying > to find any information on its expected behavior is an exercise in > frustration, and almost every available piece of advice on using it > seems to be attached to a suggestion to enable 'copyindent', without any > explanation of the distinction between the two -- suggesting that all > such advice is of the cargo cult variety. An admittedly incomprehensive > set of searches appears to reinforce this hunch [3]. > > - There was a patch adding a 'leftindent' option, posted back in 2005 [4], > that works by only adding or removing indentation at the left end of a > line. This patch adds a somewhat complex dependency on 'softtabstop' > and 'preserveindent', but otherwise seems workable. > > It doesn't look like it'd be too much work to update that patch, add > tests, etc., but before I get too far down that path: would it make more > sense to just make 'preserveindent' work this way instead? I'm inclined > to think that's the obvious expectation, and can't think of any cases > where it wouldn't be, especially as "spaces before tabs is bad" is just > about the only thing widely agreed upon when it comes to indentation... >
Makefiles are the only place I can think of where I use 'preserveindent' and 'copyindent'. This way recipes always have the syntactically required leading TAB indent, but any spaces used for indent or alignment afterward are maintained when I add/remove indent or create a new line in the recipe. Currently >> and << on these lines will keep the leading TAB. If I understand your proposal correctly, this property could be lost, breaking the makefile. So, I'd say "no" to a change such as this, although as you say these options are a little hard to fully understand so I'm not 100% sure I'm accurately representing the problem. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
