Fix "Remove Consecutive Duplicate Lines" not working on old Macintosh EOL

Close #5467
This commit is contained in:
Don HO 2019-03-30 09:33:17 +01:00
parent 0467b7d6cd
commit a7d2b6ea6e
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -1408,13 +1408,13 @@ void Notepad_plus::removeDuplicateLines()
// whichPart : line head or line tail
FindOption env;
env._str2Search = TEXT("^(.*\\r?\\n)(\\1)+");
env._str2Search = TEXT("^(.*(\\r?\\n|\\r))(\\1)+");
env._str4Replace = TEXT("\\1");
env._searchType = FindRegex;
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true);
// remove the last line if it's a duplicate line.
env._str2Search = TEXT("^(.+)\\r?\\n(\\1)$");
env._str2Search = TEXT("^(.+)(\\r?\\n|\\r)(\\1)$");
env._str4Replace = TEXT("\\1");
env._searchType = FindRegex;
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true);