Make 'Remove consecutive duplicate lines' support more line break

Fix #13474, close #13519
pull/13553/head
ArkadiuszMichalski 2023-04-11 04:22:00 +02:00 committed by Don Ho
parent 87e34c1f7b
commit 15decdb3d9
1 changed files with 2 additions and 2 deletions

View File

@ -1679,7 +1679,7 @@ void Notepad_plus::removeDuplicateLines()
// whichPart : line head or line tail
FindOption env;
env._str2Search = TEXT("^(.*(\\r?\\n|\\r))(\\1)+");
env._str2Search = TEXT("^([^\\r\\n]*(?>\\r?\\n|\\r))(?>\\1)+");
env._str4Replace = TEXT("\\1");
env._searchType = FindRegex;
auto mainSelStart = _pEditView->execute(SCI_GETSELECTIONSTART);
@ -1690,7 +1690,7 @@ void Notepad_plus::removeDuplicateLines()
_findReplaceDlg.processAll(ProcessReplaceAll, &env, isEntireDoc);
// remove the last line if it's a duplicate line.
env._str2Search = TEXT("^(.+)(\\r?\\n|\\r)(\\1)$");
env._str2Search = TEXT("^([^\\r\\n]+)(?>\\r?\\n|\\r)(?>\\1)$");
_findReplaceDlg.processAll(ProcessReplaceAll, &env, isEntireDoc);
}