mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
TextEditor: Prevent pasting with empty clipboard
Prevent erasing selected text when pasting with empty clipboard
This commit is contained in:
parent
282d0ebbec
commit
76a07b31e4
Notes:
sideshowbarker
2024-07-18 17:31:36 +09:00
Author: https://github.com/pakerwreah Commit: https://github.com/SerenityOS/serenity/commit/76a07b31e43 Pull-request: https://github.com/SerenityOS/serenity/pull/7397
1 changed files with 4 additions and 0 deletions
|
@ -1286,6 +1286,10 @@ void TextEditor::paste()
|
|||
return;
|
||||
|
||||
auto paste_text = Clipboard::the().data();
|
||||
|
||||
if (paste_text.is_empty())
|
||||
return;
|
||||
|
||||
printf("Paste: \"%s\"\n", String::copy(paste_text).characters());
|
||||
|
||||
TemporaryChange change(m_automatic_indentation_enabled, false);
|
||||
|
|
Loading…
Reference in a new issue