stef-levesque / vscode-multiclip

Multiple clipboards for VSCode
MIT License
47 stars 12 forks source link

New Feature: copy-merge and line-copy bug fix #5

Closed TimMensch closed 8 years ago

TimMensch commented 8 years ago

An editor I used to use had the ability to hit Shift-Ctrl-C to MERGE a line with the current copy buffer. I missed that feature in VS Code.

The basic idea is that you can collect a number of lines from one file or part of a file into a single copy buffer and then paste them all together. I find that I would like to use the feature periodically, but instead need to copy and paste into a temporary file or similar.

I'd already picked up this plug-in, and I realized that adding the ability to merge-copy would be really trivial. It will only work if you use Shift-Ctrl-V to do the paste from the clipboard ring at present, but I've run out of time to hack on it at the moment, and I personally am mapping Ctrl-V to the multiclip paste to get the feature to work by default.

I also remap Shift-Ctrl-X to cut-merge.

Please let me know your thoughts. I'd love to see this feature in the main Multiclip extension.

TimMensch commented 8 years ago

I found a bug in Multiclip. When you hit "ctrl-c" or "ctrl-x" with no selection in VS Code, it copies the current line. Multiclip sees an empty selection and copies nothing.

I've made a patch that fixes this. I'm adding it to THIS pull request instead of creating a new PR because the fix takes advantage of the refactor that I did as part of this PR.

stef-levesque commented 8 years ago

Thanks a lot for this feature!

I'll test it a bit before deploying it to the Visual Studio Marketplace (hopefully tomorrow)