-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Ctrl-C when nothing selected clears clipboard #6281
Comments
In some experiments, it looks like if I copy with nothing selected, it copies the entire line. This is how it seems to work in upstream Codemirror as well (you can try it at https://codemirror.net/). When you did your second Ctrl-C, were you on a blank line? If so, it seems it was copying the blank line (i.e., it copies the line you were on). If you are on a line with some text, does it copy the entire line? |
Yeah, that seems to be what is happening. Nevertheless, from the UX perspective, at least this U, that still is "clearing the clipboard" since I hit this problem when I unintentionally hit Ctrl-C when my intent is to hit Ctrl-V. It would be nice if this could be configurable. |
I see your point. It appears this is an upstream Codemirror issue. I just searched there, are here are some relevant issues: codemirror/codemirror5#2824 I haven't read through the discussions there in detail. If you'd like to pursue this, would you read through those discussions and tell us what you think? |
My read of those issues and their associated ones is that there are some people that consider this a feature, and some that consider this a bug. I guess that suggests it should be configurable? It looks like the resolution in: adobe/brackets#9311 was to do that. |
Thanks for the high-level summary. It looks like adobe/brackets#11706 is where that was implemented in brackets. From that issue, we see that there is a codemirror preference to turn on and off the copy-line-when-no-selection behavior. We could expose that preference in our settings, just like the other codemirror preferences we are exposing. Our facility for changing codemirror preferences is in https://github.com/jupyterlab/jupyterlab/blob/master/packages/codemirror-extension/schema/commands.json and https://github.com/jupyterlab/jupyterlab/blob/master/packages/codemirror-extension/src/index.ts for text editor preferences. For notebooks, the preferences for the cell editors are exposed at https://github.com/jupyterlab/jupyterlab/blob/master/packages/notebook-extension/schema/tracker.json#L267-L331, and the generic options for an editor used in the notebook are at https://github.com/jupyterlab/jupyterlab/blob/master/packages/codeeditor/src/editor.ts#L579-L668 Changing to good first issue. I think what would be needed is picking one of the existing codemirror options that we expose, and doing something similar for this option. |
For reference, Sublime apparently has the |
Also for reference, it seems that Visual Studio Code has this setting: |
On Mac OSX and Chrome, Command-C, on a blank line, did not clear the buffer, and my previously copied line from Command-V was still in the buffer. So there could be some OS specific behavior here. |
Raised PR by making above changes mentioned. |
PR Merged.. |
fixed by #7842 @vincenzon and for anyone else who has the same issue, you can fix it by going to the "Notebook" section of the advanced settings editor and then setting the |
Describe the bug
In a notebook cell, hitting Ctrl-C when nothing is selected clears the clipboard.
To Reproduce
Expected behavior
The clip board does not get cleared when Ctrl-C is pressed and no text is selected.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: