Skip to content
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

Option to disable line-wise copy & cut #15537

Open
hversteegzepp opened this issue Dec 15, 2023 · 2 comments
Open

Option to disable line-wise copy & cut #15537

hversteegzepp opened this issue Dec 15, 2023 · 2 comments

Comments

@hversteegzepp
Copy link

Problem

With the switch from CodeMirror 5 to CodeMirror 6, the option to enable/disable line-wise copying and cutting seems to have disappeared.
From looking at their documentation & codebase, apparently this is on the end of CM6 (the lineWiseCopyCut option from CM5 is no longer there, though I must say I also don't fully understand how different options for CM5 translate to CM6).
Personally, this is always an option that I disable as fast as I can in any editor, mainly to prevent overwriting my clipboard with an accidental Ctrl+C hit, for example if I just happen to miss Ctrl+V.
As an additional incredibly niche application, I also have some system-wide LaTeX-related macros set up that paste stuff like \left( \right) around selected text, which now include the whole line if nothing is selected, instead of leaving the middle empty.

Proposed Solution

I'm not sure if this is something that can be fixed on Jupyterlab's side, or if I need to take this to CodeMirror, but it would be really nice to have an option to disable line-wise copying & cutting again.

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Dec 15, 2023
@krassowski
Copy link
Member

I'm not sure if this is something that can be fixed on Jupyterlab's side

From a quick look at https://discuss.codemirror.net/t/make-linewise-copy-cut-configurable/3830/2 it sounds like we could have an optional logic which filters out things in DOM event handler of "copy". If you (or someone else) is wiling to contribute a pull request I would be happy to help with a review.

@hversteegzepp
Copy link
Author

Thanks for the reply! Unfortunately I wouldn't even know where to start with something like this, but if someone else is willing to pick it up, I'd be more than grateful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants