sublime-text-plugin
sublime-text-plugin copied to clipboard
After Running Wrap with Abbreviation, Multiple Selections are Lost
Thank you very much for adding multiple selections for Wrap with Abbreviation.
After running the Wrap with Abbreviation command, multiple selections are lost and the caret is located where the end of the top-most selection region was before running the command.
I would like to see each selection remain after running the Wrap with Abbreviation command. This will allow us to continue with multi-selection editing.
Let me also add to this issue that when using multiple selections, after running the Wrap with Abbreviation command, the carets were located in the appropriate location according to the type of wrapping tag.
For example, if multiple email addresses were selected and wrapped with "a" tags, the carets would be placed in the href="|" attribute.
Currently, this works as expected when using a Wrap with Abbreviation on a single selection region, however, it doesn't work with multiple selection regions.
@sergeche, the recent commit that adds "multicursor abbreviation expand" is a very nice addition. Thank you for that.
Can it be enhanced so that it retains all cursors after a multi-selection command has completed?
This would include the abbreviations as well as wrap with abbreviation commands.
Thank you again.
It should retain cursor positions after expand, except tabsops. Can you record a small GIF with example of invalid cursor behaviour?
As you noted, Emmet does retain multiple cursor positions after expanding multiple abbreviations. However, it does not retain multiple cursors after wrapping with a single abbreviation.
I also noticed that depending on how the selections were made, the cursor is placed in different locations after the abbreviation is expanded. In the capture, above, the second pair of lines are expanded and the cursor remains at the end of the line 12. When the third pair of lines are expanded, the cursor remains at the end of line 16.
Thank you for looking into this.
@michaelalandawson Oh, it's wrapping with abbreviation. Will take a look
Fixed multiple cursors in v2.2.4, please check if it works as expected
@sergeche, it works perfectly. Thank you for fixing this.