diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml
index 6b7e0ffcd..31cbbfefd 100644
--- a/PowerEditor/installer/nativeLang/english.xml
+++ b/PowerEditor/installer/nativeLang/english.xml
@@ -1155,7 +1155,7 @@ You can define several column markers by using white space to separate the diffe
-
+
diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml
index 55b5fed63..5e556ff65 100644
--- a/PowerEditor/installer/nativeLang/english_customizable.xml
+++ b/PowerEditor/installer/nativeLang/english_customizable.xml
@@ -1155,7 +1155,7 @@ You can define several column markers by using white space to separate the diffe
-
+
diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml
index eb19b6f99..ac5e06360 100644
--- a/PowerEditor/installer/nativeLang/french.xml
+++ b/PowerEditor/installer/nativeLang/french.xml
@@ -1156,7 +1156,7 @@ Vous pouvez définir plusieurs marqueurs de colonne en utilisant un espace pour
-
+
diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
index 805eb1b92..439685166 100644
--- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
+++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
@@ -1108,7 +1108,7 @@
-
+
diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp
index fddc26e17..f68cfb9dc 100644
--- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp
+++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp
@@ -559,8 +559,11 @@ bool Finder::notify(SCNotification *notification)
if (end > lineEndAbsPos)
end = lineEndAbsPos;
- _scintView.execute(SCI_SETSEL, begin, end);
- _scintView.execute(SCI_SCROLLRANGE, begin, end);
+ if (begin < end)
+ {
+ _scintView.execute(SCI_SETSEL, begin, end);
+ _scintView.execute(SCI_SCROLLRANGE, begin, end);
+ }
}
break;
@@ -4817,30 +4820,35 @@ const char* Finder::foundLine(FoundInfo fi, SearchResultMarkingLine miLine, cons
headerStr += foundline;
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
const char* text2AddUtf8 = wmc.wchar2char(headerStr.c_str(), SC_CP_UTF8, &miLine._segmentPostions[0].first, &miLine._segmentPostions[0].second); // certainly utf8 here
+ size_t text2AddUtf8Len = strlen(text2AddUtf8);
- if (isRepeatedLine) // if current line is the repeated line of previous one, and settings make per found line show once in the result even there are several found occurences in the same line
+ // if current line is the repeated line of previous one, and settings make per found line show ONCE in the result even there are several found occurences in the same line, for:
+ if ((isRepeatedLine &&
+ ((text2AddUtf8Len < SC_SEARCHRESULT_LINEBUFFERMAXLENGTH) || // 1. All displayed whole lines, in which it contains all the occurrences.
+ ((text2AddUtf8Len >= SC_SEARCHRESULT_LINEBUFFERMAXLENGTH && miLine._segmentPostions[0].second < SC_SEARCHRESULT_LINEBUFFERMAXLENGTH))))) // 2. or the cut lines but the segments are displayed. For the segments displayed beyond displayed (non-cut part), go to default mode.
{
// Add start and end markers into the previous line's info for colourizing
_pMainMarkings->back()._segmentPostions.push_back(std::pair(miLine._segmentPostions[0].first, miLine._segmentPostions[0].second));
_pMainFoundInfos->back()._ranges.push_back(fi._ranges.back());
+
return "";
}
else // default mode: allow same found line has several entries in search result if the searched occurrence is matched several times in the same line
{
_pMainFoundInfos->push_back(fi);
- size_t len = strlen(text2AddUtf8);
- if (len >= SC_SEARCHRESULT_LINEBUFFERMAXLENGTH)
+
+ if (text2AddUtf8Len >= SC_SEARCHRESULT_LINEBUFFERMAXLENGTH)
{
const char* endOfLongLine = " ...\r\n"; // perfectly Utf8-encoded already
size_t lenEndOfLongLine = strlen(endOfLongLine);
size_t cut = SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - lenEndOfLongLine - 1;
- while ((cut > 0) && (!Utf8::isValid(&text2AddUtf8[cut], (int)(len - cut))))
+ while ((cut > 0) && (!Utf8::isValid(&text2AddUtf8[cut], (int)(text2AddUtf8Len - cut))))
cut--;
memcpy((void*)&text2AddUtf8[cut], endOfLongLine, lenEndOfLongLine + 1);
- len = cut + lenEndOfLongLine;
+ text2AddUtf8Len = cut + lenEndOfLongLine;
}
_pMainMarkings->push_back(miLine);
diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc
index 577f7f03d..996711780 100644
--- a/PowerEditor/src/WinControls/Preference/preference.rc
+++ b/PowerEditor/src/WinControls/Preference/preference.rc
@@ -363,7 +363,7 @@ BEGIN
CONTROL "Find dialog remains open after search that outputs to results window", IDC_CHECK_FINDDLG_ALWAYS_VISIBLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 89, 350, 10
CONTROL "Confirm Replace All in All Opened Documents", IDC_CHECK_CONFIRMREPLOPENDOCS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 104, 350, 10
CONTROL "Replace: Don't move to the following occurrence", IDC_CHECK_REPLACEANDSTOP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 119, 350, 10
- CONTROL "Search Result window: show only one entry per found line", IDC_CHECK_SHOWONCEPERFOUNDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 134, 350, 10
+ CONTROL "Search Result window: show only one entry per found line if possible", IDC_CHECK_SHOWONCEPERFOUNDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 134, 350, 10
END