Fix Trim Operations not working on selection

Trim Operations works for entire document only.
Now selection for Trim Operations is supported.

Fix #12602, close #12626
This commit is contained in:
ArkadiuszMichalski 2022-12-11 03:46:52 +01:00 committed by Don Ho
parent 4e4d9d95ce
commit bf34ef0dd5
1 changed files with 4 additions and 2 deletions

View File

@ -1486,8 +1486,10 @@ void Notepad_plus::doTrim(trimOp whichPart)
else else
return; return;
env._str4Replace = TEXT(""); env._str4Replace = TEXT("");
env._searchType = FindRegex; env._searchType = FindRegex;
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true); bool isEntireDoc = _pEditView->execute(SCI_GETSELECTIONSTART) == _pEditView->execute(SCI_GETSELECTIONEND);
env._isInSelection = !isEntireDoc;
_findReplaceDlg.processAll(ProcessReplaceAll, &env, isEntireDoc);
} }
void Notepad_plus::removeEmptyLine(bool isBlankContained) void Notepad_plus::removeEmptyLine(bool isBlankContained)