shepelevstas / dumb-copy-paste

VS Code implementation of Control+Shift+V from Sublime Text
MIT License
4 stars 1 forks source link

should trim indent from the first line of copied/pasted block #1

Closed lunelson closed 5 years ago

lunelson commented 5 years ago

This works very closely to Sublime's paste-and-indent but I notice one difference: if I copy an indented block by dragging a selection in the gutter, selecting entire lines, the pasted block will be indented by the position where I've pasted it PLUS however much the copied block was indented. The solution I believe, would be to note the indentation of the first line in the copied block, and subtract that from the indentation being applied. Any chance of this?

shepelevstas commented 5 years ago

Can you give an example here? In picture or code here

lunelson commented 5 years ago

Sure. In the following capture from sublime, I copy a block of code which is already indented by several spaces, and then place my cursor at a position indented another several spaces, and when I do sublime's indented paste my pasted block starts exactly where I put the cursor. Doing the same operation with your extension, the original indentation would also be kept, leaving the final block indented by the position of the cursor plus the copied block's original indentation.

indented-paste

shepelevstas commented 5 years ago

Thank you. Now I get it. I'll fix it next month, or month after the next, have no time for now=)

shepelevstas commented 5 years ago

Good News! Managed to scrape up couple hours to fix it!=D