forked from msanders/snipmate.vim
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create undo point before expanding snippet in insert mode.
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create an undo point always, not just when a snippet gets expanded.
When trying to use an undefined snippet for example (which won't expand to anything) this will cause undo breakpoints that have changed nothing.
Can you insert the undo breakpoint only if something was changed? I was thinking about doing it in snipMate#expandSnip.
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BlueEyed Good catch. I've been using this for months now and have never noticed any issues in practice, so I don't think I will bother to look into it either, but I would be interested to see that fix if you do it.
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcWeber: I do not want to drop the feature altogether, just only create the undo point if there are any changes.
I was thinking about executing "u" in snipMate#expandSnip somewhere before any expansion will happen, instead of within the mapping.
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
73a7255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.