mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +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
1 changed files with 4 additions and 0 deletions
|
@ -1286,6 +1286,10 @@ void TextEditor::paste()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto paste_text = Clipboard::the().data();
|
auto paste_text = Clipboard::the().data();
|
||||||
|
|
||||||
|
if (paste_text.is_empty())
|
||||||
|
return;
|
||||||
|
|
||||||
printf("Paste: \"%s\"\n", String::copy(paste_text).characters());
|
printf("Paste: \"%s\"\n", String::copy(paste_text).characters());
|
||||||
|
|
||||||
TemporaryChange change(m_automatic_indentation_enabled, false);
|
TemporaryChange change(m_automatic_indentation_enabled, false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue