Fix cannot paste issue after removing read-only via menu
Syncronize Paste and Undo commands with file buffer read-only status. Previously, after e.g. removing the read-only flag, file editing was possible immediately, but Ctrl-V was not. At least a cursor movement or switching between the N++ tabs or apps-switching was required (SCN_UPDATEUI message generated...). Fix https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13742#issuecomment-2233570312, close #15452pull/15466/head
parent
f05f4105de
commit
19ddb91a64
|
@ -6622,6 +6622,10 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
|
||||||
{
|
{
|
||||||
checkDocState();
|
checkDocState();
|
||||||
|
|
||||||
|
// enable/disable possible Undo and Paste commands according to the current R/O status
|
||||||
|
checkClipboard();
|
||||||
|
checkUndoState();
|
||||||
|
|
||||||
bool isSysReadOnly = buffer->getFileReadOnly();
|
bool isSysReadOnly = buffer->getFileReadOnly();
|
||||||
bool isUserReadOnly = buffer->getUserReadOnly();
|
bool isUserReadOnly = buffer->getUserReadOnly();
|
||||||
bool isDirty = buffer->isDirty();
|
bool isDirty = buffer->isDirty();
|
||||||
|
@ -6632,7 +6636,6 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
|
||||||
scnN.nmhdr.idFrom = (uptr_t) ((isSysReadOnly || isUserReadOnly? DOCSTATUS_READONLY : 0) | (isDirty ? DOCSTATUS_BUFFERDIRTY : 0));
|
scnN.nmhdr.idFrom = (uptr_t) ((isSysReadOnly || isUserReadOnly? DOCSTATUS_READONLY : 0) | (isDirty ? DOCSTATUS_BUFFERDIRTY : 0));
|
||||||
scnN.nmhdr.code = NPPN_READONLYCHANGED;
|
scnN.nmhdr.code = NPPN_READONLYCHANGED;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_pDocumentListPanel)
|
if (_pDocumentListPanel)
|
||||||
|
|
Loading…
Reference in New Issue