Fix 1 entry per line in Search result UTF8 marked wronly issue
Fix CJK, Hebrew, Arabic and other Languages in UTF8 marked wronly issue in in Search result while "1 entry per line" option enabled. The option in question can be enabled in RTL mode now with this commit.pull/11864/head
parent
980cbcccc6
commit
059bca3315
|
@ -1078,7 +1078,7 @@ Pudete definisce parechji marcatori di culonna impieghendu un spaziu per staccà
|
|||
<Item id="6903" name="U dialogu di ricerca sta apertu dopu una ricerca chì s’affisseghja in a finestra di risultati"/>
|
||||
<Item id="6904" name="Cunfirmà tutti i rimpiazzamenti in tutti i ducumenti aperti"/>
|
||||
<Item id="6905" name="Rimpiazzà : ùn movesi micca à a prossima occurrenza"/>
|
||||
<Item id="6906" name="Risultati di ricerca : affissà un elementu unicu à a linea trova (ùn s’appieca micca à u modu RTL)"/>
|
||||
<Item id="6906" name="Risultati di ricerca : affissà un elementu unicu à a linea trova"/>
|
||||
</Searching>
|
||||
|
||||
<RecentFilesHistory title="Schedarii recenti">
|
||||
|
|
|
@ -1048,7 +1048,7 @@ You can define several column markers by using white space to separate the diffe
|
|||
<Item id="6903" name="Find dialog remains open after search that outputs to results window"/>
|
||||
<Item id="6904" name="Confirm Replace All in All Opened Documents"/>
|
||||
<Item id="6905" name="Replace: Don't move to the following occurrence"/>
|
||||
<Item id="6906" name="Search Result window: show only one entry per found line (not applied to RTL mode)"/>
|
||||
<Item id="6906" name="Search Result window: show only one entry per found line"/>
|
||||
</Searching>
|
||||
|
||||
<RecentFilesHistory title="Recent Files History">
|
||||
|
|
|
@ -1048,7 +1048,7 @@ Vous pouvez définir plusieurs marqueurs de colonne en utilisant un espace pour
|
|||
<Item id="6903" name="La boîte de dialogue "Rechercher" reste ouverte après la recherche qui affiche la fenêtre de résultats"/>
|
||||
<Item id="6904" name="Confirmer "Remplacer dans tous les documents ouverts""/>
|
||||
<Item id="6905" name=""Remplacer" : ne pas passer à l'occurrence suivante"/>
|
||||
<Item id="6906" name="Résultats de recherche : afficher une seule entrée par ligne trouvée (non applicable au mode RTL)"/>
|
||||
<Item id="6906" name="Résultats de recherche : afficher une seule entrée par ligne trouvée"/>
|
||||
</Searching>
|
||||
|
||||
<RecentFilesHistory title="Fichiers récents">
|
||||
|
|
|
@ -1057,7 +1057,7 @@ Mehrere Spaltenmarkierungen können definiert werden, indem die Zahlen durch Lee
|
|||
<Item id="6903" name="Der Suchdialog bleibt nach der Suche geöffnet, die im Ergebnisfenster ausgegeben wird"/>
|
||||
<Item id="6904" name="Bestätigung für 'Alle Ersetzen' in allen offenen Dokumenten"/>
|
||||
<Item id="6905" name="Ersetzen: Nach Ersetzung nicht zum nächsten Vorkommen springen"/>
|
||||
<Item id="6906" name="Suchergebnisfenster: Zeige nur einen Eintrag pro gefundener Zeile (nicht anwendbar im RTL Modus)"/>
|
||||
<Item id="6906" name="Suchergebnisfenster: Zeige nur einen Eintrag pro gefundener Zeile"/>
|
||||
</Searching>
|
||||
|
||||
<RecentFilesHistory title="Zuletzt geöffn. Dateien">
|
||||
|
|
|
@ -1052,7 +1052,7 @@
|
|||
<Item id="6903" name="検索結果を結果ウィンドウに表示する時に、検索画面を自動で閉じないようにする"/>
|
||||
<Item id="6904" name="「すべての文書で置換」を実行する前に、確認する"/>
|
||||
<Item id="6905" name="置換時に、次の出現箇所に移動しない"/>
|
||||
<Item id="6906" name="検索結果画面:複数回一致した行を 1行にまとめて表示する(書字方向が右から左の時は無効)"/>
|
||||
<Item id="6906" name="検索結果画面:複数回一致した行を 1行にまとめて表示する"/>
|
||||
</Searching>
|
||||
|
||||
|
||||
|
|
|
@ -1053,7 +1053,7 @@ Updated to v8.4.3:
|
|||
<Item id="6903" name="Оставлять окно Поиска открытым после окончания поиска"/>
|
||||
<Item id="6904" name="Запрашивать подтверждение операции "Заменить все во Всех Открытых Документах""/>
|
||||
<Item id="6905" name="Замена: не переходить к следующему совпадению, только при повторном нажатии"/>
|
||||
<Item id="6906" name="Результаты Поиска: показывать только одну запись в каждой найденной строке (кроме RTL)"/>
|
||||
<Item id="6906" name="Результаты Поиска: показывать только одну запись в каждой найденной строке"/>
|
||||
</Searching>
|
||||
<RecentFilesHistory title="История Открытия">
|
||||
<Item id="6304" name="История Последних Закрытых Файлов"/>
|
||||
|
|
|
@ -1036,7 +1036,7 @@
|
|||
<Item id="6903" name="搜尋結果輸出到結果視窗後,尋找與取代對話方塊繼續保持打開狀態"/>
|
||||
<Item id="6904" name="確認「在所有開啟的文件中取代」"/>
|
||||
<Item id="6905" name="替換:不要移動到下一個匹配項"/>
|
||||
<Item id="6906" name="搜尋結果視窗:每個找到的行只顯示一個條目(不用於文字由右至左模式)"/>
|
||||
<Item id="6906" name="搜尋結果視窗:每個找到的行只顯示一個條目"/>
|
||||
</Searching>
|
||||
|
||||
<RecentFilesHistory title="最近使用的檔案">
|
||||
|
|
|
@ -2709,6 +2709,9 @@ int FindReplaceDlg::processRange(ProcessOperation op, FindReplaceInfo & findRepl
|
|||
intptr_t start_mark = targetStart - lstart;
|
||||
intptr_t end_mark = targetEnd - lstart;
|
||||
|
||||
//intptr_t start_mark2 = start_mark;
|
||||
//intptr_t end_mark2 = end_mark;
|
||||
|
||||
pEditView->getGenericText(lineBuf, SC_SEARCHRESULT_LINEBUFFERMAXLENGTH, lstart, lend, &start_mark, &end_mark);
|
||||
|
||||
generic_string line = lineBuf;
|
||||
|
@ -4356,9 +4359,7 @@ void Finder::add(FoundInfo fi, SearchResultMarkingLine miLine, const TCHAR* foun
|
|||
NppParameters& nppParam = NppParameters::getInstance();
|
||||
NppGUI& nppGUI = nppParam.getNppGUI();
|
||||
|
||||
bool isRTL = _scintView.isTextDirectionRTL();
|
||||
|
||||
if (nppGUI._finderShowOnlyOneEntryPerFoundLine && !isRTL) // several occurrence colourizing in Search result doesn't support for RTL mode
|
||||
if (nppGUI._finderShowOnlyOneEntryPerFoundLine)
|
||||
{
|
||||
if (_previousLineNumber == -1)
|
||||
{
|
||||
|
@ -4387,31 +4388,23 @@ void Finder::add(FoundInfo fi, SearchResultMarkingLine miLine, const TCHAR* foun
|
|||
headerStr += lineNumberStr;
|
||||
headerStr += TEXT(": ");
|
||||
|
||||
miLine._segmentPostions[0].first += headerStr.length();
|
||||
miLine._segmentPostions[0].second += headerStr.length();
|
||||
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
|
||||
|
||||
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
|
||||
{
|
||||
std::string utf8Header = wmc.wchar2char(headerStr.c_str(), SC_CP_UTF8); // certainly utf8 here
|
||||
|
||||
miLine._segmentPostions[0].first += utf8Header.length();
|
||||
miLine._segmentPostions[0].second += utf8Header.length();
|
||||
|
||||
// Add start and end markers into the previous line's info for colourizing
|
||||
_pMainMarkings->back()._segmentPostions.push_back(std::pair<intptr_t, intptr_t>(miLine._segmentPostions[0].first, miLine._segmentPostions[0].second));
|
||||
_pMainFoundInfos->back()._ranges.push_back(fi._ranges.back());
|
||||
}
|
||||
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
|
||||
{
|
||||
miLine._segmentPostions[0].first += headerStr.length();
|
||||
miLine._segmentPostions[0].second += headerStr.length();
|
||||
|
||||
_pMainFoundInfos->push_back(fi);
|
||||
|
||||
headerStr += foundline;
|
||||
|
||||
const char* text2AddUtf8 = wmc.wchar2char(headerStr.c_str(), SC_CP_UTF8, &miLine._segmentPostions[0].first, &miLine._segmentPostions[0].second); // certainly utf8 here
|
||||
size_t len = strlen(text2AddUtf8);
|
||||
|
||||
if (len >= SC_SEARCHRESULT_LINEBUFFERMAXLENGTH)
|
||||
{
|
||||
const char* endOfLongLine = " ...\r\n"; // perfectly Utf8-encoded already
|
||||
|
@ -4571,7 +4564,6 @@ void Finder::beginNewFilesSearch()
|
|||
{
|
||||
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
|
||||
_prefixLineStr = pNativeSpeaker->getLocalizedStrFromID("find-result-line-prefix", TEXT("Line"));
|
||||
//_prefixLineStr = TEXT("Line");
|
||||
|
||||
// Use SCI_SETSEL(0, 0) instead of SCI_SETCURRENTPOS(0) to workaround
|
||||
// an eventual regression or a change of behaviour in Scintilla 4.4.6
|
||||
|
|
|
@ -334,7 +334,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,40,350,10
|
||||
CONTROL "Confirm Replace All in All Opened Documents",IDC_CHECK_CONFIRMREPLOPENDOCS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,37,55,350,10
|
||||
CONTROL "Replace: Don't move to the following occurrence", IDC_CHECK_REPLACEANDSTOP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 70, 350, 10
|
||||
CONTROL "Search Result window: show only one entry per found line (not applied to RTL mode)", IDC_CHECK_SHOWONCEPERFOUNDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 85, 350, 10
|
||||
CONTROL "Search Result window: show only one entry per found line", IDC_CHECK_SHOWONCEPERFOUNDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 85, 350, 10
|
||||
END
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue