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
This commit is contained in:
xomx 2025-04-22 17:58:19 +02:00 committed by Don Ho
parent 51449b09de
commit 13b08d0a5c

View File

@ -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<LPARAM>(""));
checkClipboard(); // for enabling possible Paste command
}
break;