-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add editor command: Duplicate code #4
Comments
Aakash will look into this. |
need to handle block selection after paste |
Resolved the issue. Pls refer the screenshots in attachment of working version.! |
Nice work Aakash. |
Done with as you suggested and checked in |
Done with both Ctrl+D and Ctrl+Shift+D |
Is this closed? |
Justin should make a call. Its working fine for Text editors. Not for XML based files though. So, I feel we may close this now and open a new one for XML (or) just leave this open if fixing for XML is something very simple and if anyone could help with some pointers on it. |
Duplicate line works not so perfectly (as Resharper for example), I don't want get duplicated line in copy-paste buffer. Bug: put line in copy-paste buffer only if I don't have selection. If I select text and then press Ctrl+D, then my copy-paste buffer not overrides. |
Hey Nick. I agree about it not adding to the copy-paste buffer. In fact, I would say, even if there is no selection, it should still not add to the buffer. |
Ha well Justin. It getting added to copy-paste buffer is something we didn't think about earlier. I feel, we will be able to remove the recent item from that copy-paste buffer, and that shall resolve it. However, this is better than Resharper in some ways. For it supports block (horizontal block) selection , in addition to multi-line select. And works perfectly for forward and reverse selection too.! |
I think if we use: editorOperations.InsertText(selectedText); instead of
that should do the trick. Not sure about moving the position of the caret, though. I was trying to test it now, but I notice it is referencing Dev15 assemblies because I upgraded it to VS2017. |
The feature works really well, I must admit. Although, the code could probably be cleaned up a bit. |
This works perfectly for me so far 👍 |
@yannduran, Yes it's works, but replacing copy-paste buffer if you not select line. I'm really sad about this :( @justcla As I can see it's one if body with variable singleLine. When you can release fix? |
@verysimplenick I can release a fix as soon as you code it up for me! :-D |
Thanks for the pull request Nick. I've also had a go at fixing the caret position.
|
Once we've fixed the caret position and the Last-Line issue, I will merge it into Master. |
I've fixed the caret position issue. And I've included a hack to get around the issue of the last line not having a newline character. |
Suggested key binding: Ctrl+D
The text was updated successfully, but these errors were encountered: