-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 TextEdit option to prevent copying without a selection #90743
Add TextEdit option to prevent copying without a selection #90743
Conversation
c5beb9d
to
9b1e1f7
Compare
9b1e1f7
to
b5a32d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a test for it, for copy and cut in test_text_edit
and for cut in test_code_edit
.
if (!empty_selection_clipboard_enabled) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably needed in CodeEdit::_cut_internal
as well so it doesn't delete empty lines that aren't copied.
b5a32d3
to
bf1d06c
Compare
Added tests and fixed cut behavior in CodeEdit. |
bf1d06c
to
504e065
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! (expected behavior with both single and multicaret editing)
Code looks fine too.
Thanks! |
Closes godotengine/godot-proposals#9527
Copying current line if nothing is selected is a common code editor feature. But it's usually not expected in normal multiline input boxes. So this behavior should be optional for
TextEdit
.This option affects both copying and cutting. Name resembles
editor.emptySelectionClipboard
in VS Code.empty_selection_clipboard_enabled
toTextEdit
.text_editor/behavior/general/empty_selection_clipboard
to Editor Settings.