On Mon, 25 Jul 2016, Ben Fritz wrote:
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.
Are you sure? Try adding indentation across lines with tabs-before-spaces
indentation and alignment, with 'listchars' set to some value that'll make
the tabs obvious. I don't think it does what you expect, which is kinda
my point here... ;)
Here's an example from Vim's own Makefile... If I visually select the
recipe for this rule and shift it once to the right:
prepare:
-------if test -f runtime/doc/uganda.nsis.txt; then \
------->-------rm runtime/doc/uganda.nsis.txt; fi
-------for name in $(IN_README_DIR); do \
------- cp READMEdir/"$$name" .; \
------- done
I get this result:
prepare:
------->-------if test -f runtime/doc/uganda.nsis.txt; then \
------->------->-------rm runtime/doc/uganda.nsis.txt; fi
------->-------for name in $(IN_README_DIR); do \
------- >----- cp READMEdir/"$$name" .; \
------- >----- done
That odd run of an extra copy of the spaces plus another tab is the
problem. My expectation here would've been for an extra tab to be
inserted at the beginning of each line, and nothing more.
(For reference, this was with ':set lcs=tab:>- ci pi noet ts=8 sw=8 sts=0'
in Vim 7.4.1868, as currently packaged in Fedora. The 'ci' setting
doesn't actually matter here, nor does the exact shift method used.)
Currently >> and << on these lines will keep the leading TAB. If I understand
your proposal correctly, this property could be lost, breaking the makefile.
Quite the contrary, modifying only the leading indentation (tabs, in this
case) when shifting is exactly the behavior I want. It's not what we get
from 'preserveindent' today, and it's what the 'leftindent' patch intended
to accomplish. It also seems like a reasonable expectation for what
'preserveindent' *should* do, hence the question...
-Rob
--
--
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.