From a7d2b6ea6ec2af096f29284e0effee2cdd17b7ac Mon Sep 17 00:00:00 2001 From: Don HO Date: Sat, 30 Mar 2019 09:33:17 +0100 Subject: [PATCH] Fix "Remove Consecutive Duplicate Lines" not working on old Macintosh EOL Close #5467 --- PowerEditor/src/Notepad_plus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 2469882d3..9ca59b24d 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -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);