From 13b08d0a5c3b81df6f36c72208d520bf62419ad0 Mon Sep 17 00:00:00 2001 From: xomx Date: Tue, 22 Apr 2025 17:58:19 +0200 Subject: [PATCH] Fix disabled Paste command with no previous text-data in clipboard Previously, a Notepad++ editor user activity or focus switching was needed for enabling possible clipboard Paste after a successful Copy command. Fix #16456, close #16458 --- PowerEditor/src/NppCommands.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index c585c318d..f75be00d3 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -379,6 +379,7 @@ void Notepad_plus::command(int id) { ::SendMessage(focusedHwnd, WM_CUT, 0, 0); } + checkClipboard(); // for enabling possible Paste command break; } @@ -395,7 +396,6 @@ void Notepad_plus::command(int id) { _pEditView->execute(SCI_COPYALLOWLINE); // Copy without selected text, it will copy the whole line with EOL, for pasting before any line where the caret is. } - } else { @@ -405,7 +405,7 @@ void Notepad_plus::command(int id) else ::SendMessage(focusedHwnd, WM_COPY, 0, 0); } - + checkClipboard(); // for enabling possible Paste command break; } @@ -499,6 +499,8 @@ void Notepad_plus::command(int id) if (id == IDM_EDIT_CUT_BINARY) _pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast("")); + + checkClipboard(); // for enabling possible Paste command } break;