-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Feature request: Cut/copy line when selection is a cursor #2382
Comments
(BTW, this isn't a request for v4 specifically - I know you're trying to close that down :)) |
This could probably be hacked into the |
Try with attached patch. |
Thanks for implementing this :) I have tried it out in brackets now and I have the following feedback:
Thanks |
FWIW, looks like all those issues repro in the CodeMirror demo, so it's not due to Brackets-specific issues. |
Do any of these constitute actual problems, though? It seems sane to me that if you have a selection, cut/copy acts on that selection. And the flash of selection when cutting is something I am aware of, but which didn't seem like an issue (it mirrors the act of actually selecting and cutting the lines). |
Well, I do think it's confusing that only the selections get cut. Sublime and IntelliJ do cut all cursors (selections and non-selections). However, I do think it's sane to just copy the selections on copy. Similarly, I think only the selections should get copied on cut (the same way sublime behaves), but still all lines/selections should get removed. I can agree that the selection flash is okay, but I feel it should behave the same with copy also then. However, this is not really an issue to me. So I guess the real issue is that the lines with no selections do not get removed (does not need to be copied) on cut. If that gets fixed I believe CM would work in the same way as the other editors (except for the flashing highlight, which is okay). :) |
In many editors, when the selection is a cursor (or multiple cursors), copy and cut operate on the line(s) containing the cursor(s). This is a very handy feature for quickly moving code around, and we get this request a lot in Brackets.
Is this possible to implement in CodeMirror? I don't fully understand how CM manages the clipboard operations (since I know you can't directly mess with the clipboard from JS), but my understanding is that it's managed via the hidden input field. Would it be possible to make it so that when the selection is a cursor/cursors, the hidden input field contains the lines containing the cursors and selects them? Or would that mess up other logic that relies on the input field?
The text was updated successfully, but these errors were encountered: