Should VISUAL remove indentation first before insertion?
I've found one problem with existing snippets and also those that I am trying to creat. Consider this case: I have few indented lines:
test
one
more
I select them all with `V`, press tab and then use `if` standard snippet. I will get:
if (smith) {
test
one
more
}
So statements inside would be indented twice because I've "copied" those with indentations and then snippet has added it's own indentation once again. So I wonder, if there is an easy way to remove an indentation first before pasting visual selection into the snippet (inside the snippet engine). Should this behavior be the default?
I understand that probably I could make a shortcut for visual mode that would unindent selection first and then trigger UltiSnips function for capturing the selection. Would you suggest doing that?
Thanks,
Dima
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- UltiSnips Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask dima gorbik for more information if necessary.