Fix "Remove Consecutive Duplicate Lines" not working on old Macintosh EOL
Close #5467
This commit is contained in:
parent
0467b7d6cd
commit
a7d2b6ea6e
@ -1408,13 +1408,13 @@ void Notepad_plus::removeDuplicateLines()
|
|||||||
// whichPart : line head or line tail
|
// whichPart : line head or line tail
|
||||||
FindOption env;
|
FindOption env;
|
||||||
|
|
||||||
env._str2Search = TEXT("^(.*\\r?\\n)(\\1)+");
|
env._str2Search = TEXT("^(.*(\\r?\\n|\\r))(\\1)+");
|
||||||
env._str4Replace = TEXT("\\1");
|
env._str4Replace = TEXT("\\1");
|
||||||
env._searchType = FindRegex;
|
env._searchType = FindRegex;
|
||||||
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true);
|
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true);
|
||||||
|
|
||||||
// remove the last line if it's a duplicate line.
|
// 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._str4Replace = TEXT("\\1");
|
||||||
env._searchType = FindRegex;
|
env._searchType = FindRegex;
|
||||||
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true);
|
_findReplaceDlg.processAll(ProcessReplaceAll, &env, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user