Skip to content

Commit

Permalink
Restore freezing cut/copy menu items for synchronizing
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Feb 2, 2024
1 parent b87eb99 commit caa68f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2570,8 +2570,8 @@ void Notepad_plus::checkClipboard()

if (!NppParameters::getInstance().getSVP()._lineCopyCutWithoutSelection)
{
enableCommand(IDM_EDIT_CUT, hasSelection, TOOLBAR);
enableCommand(IDM_EDIT_COPY, hasSelection, TOOLBAR);
enableCommand(IDM_EDIT_CUT, hasSelection, MENU | TOOLBAR);
enableCommand(IDM_EDIT_COPY, hasSelection, MENU | TOOLBAR);
}
enableCommand(IDM_EDIT_PASTE, canPaste, MENU | TOOLBAR);
enableCommand(IDM_EDIT_DELETE, hasSelection, MENU | TOOLBAR);
Expand Down
8 changes: 4 additions & 4 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2291,16 +2291,16 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (nppParam.getSVP()._lineCopyCutWithoutSelection) // "Disable Copy Cut Line Without Selection" is just unchecked: From NOT using it to using this feature
{
// Enable Copy & Cut unconditionally
enableCommand(IDM_EDIT_CUT, true, TOOLBAR);
enableCommand(IDM_EDIT_COPY, true, TOOLBAR);
enableCommand(IDM_EDIT_CUT, true, MENU | TOOLBAR);
enableCommand(IDM_EDIT_COPY, true, MENU | TOOLBAR);

}
else // "Disable Copy Cut Line Without Selection" is just checked: From using this feature to NOT using it
{
// Check the current selection to disable/enable Copy & Cut
bool hasSelection = _pEditView->hasSelection();
enableCommand(IDM_EDIT_CUT, hasSelection, TOOLBAR);
enableCommand(IDM_EDIT_COPY, hasSelection, TOOLBAR);
enableCommand(IDM_EDIT_CUT, hasSelection, MENU | TOOLBAR);
enableCommand(IDM_EDIT_COPY, hasSelection, MENU | TOOLBAR);
}
return TRUE;
}
Expand Down

0 comments on commit caa68f8

Please sign in to comment.