Skip to content

Commit

Permalink
Enhance multi-select
Browse files Browse the repository at this point in the history
1. Make "Multi-select all" expand the word only when there's no selection.
2. Make multi-select commands set macro-able.

Ref: notepad-plus-plus#14295 (comment)
  • Loading branch information
donho committed Nov 3, 2023
1 parent c5477ee commit 8267838
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion PowerEditor/src/NppCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,9 @@ void Notepad_plus::command(int id)
(id == IDM_EDIT_MULTISELECTALLMATCHCASE ? SCFIND_MATCHCASE :
(id == IDM_EDIT_MULTISELECTALLWHOLEWORD ? SCFIND_WHOLEWORD: SCFIND_MATCHCASE| SCFIND_WHOLEWORD));

_pEditView->expandWordSelection();
bool hasSelection = (_pEditView->execute(SCI_GETSELECTIONSTART) != _pEditView->execute(SCI_GETSELECTIONEND));
if (!hasSelection)
_pEditView->expandWordSelection();

_pEditView->execute(SCI_TARGETWHOLEDOCUMENT);

Expand Down Expand Up @@ -4289,6 +4291,14 @@ void Notepad_plus::command(int id)
case IDM_VIEW_IN_IE :
case IDM_EDIT_COPY_ALL_NAMES:
case IDM_EDIT_COPY_ALL_PATHS:
case IDM_EDIT_MULTISELECTALLWHOLEWORD:
case IDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD:
case IDM_EDIT_MULTISELECTNEXT:
case IDM_EDIT_MULTISELECTNEXTMATCHCASE:
case IDM_EDIT_MULTISELECTNEXTWHOLEWORD:
case IDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD:
case IDM_EDIT_MULTISELECTUNDO:
case IDM_EDIT_MULTISELECTSSKIP:
_macro.push_back(recordedMacroStep(id));
break;

Expand Down

0 comments on commit 8267838

Please sign in to comment.