From b3d4271e78b02ecc59dd4bd7924e9ea6065f9d68 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Tue, 15 Dec 2020 18:08:02 +0100 Subject: [PATCH] Adv-Find: Try to use some more unicode chars (instead of latex macros) --- src/Paragraph.cpp | 2 +- src/lyxfind.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index bd16ca4402..6373b2cde5 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1129,7 +1129,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os, { char_type const c = owner_->getUChar(bparams, runparams, i); - if (style.pass_thru || runparams.pass_thru + if (style.pass_thru || runparams.pass_thru || runparams.for_search || contains(style.pass_thru_chars, c) || contains(runparams.pass_thru_chars, c)) { if (c != '\0') { diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index cda82db4d3..20e1104aa6 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -944,9 +944,9 @@ static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions co AS_STR_INSETS | AS_STR_SKIPDELETE | AS_STR_PLAINTEXT, &runparams); } - // Even in ignore-format we have to remove "\text{}" parts + // Even in ignore-format we have to remove "\text{}, \lyxmathsym{}" parts string t = to_utf8(str); - while (regex_replace(t, t, "\\\\text\\{([^\\}]*)\\}", "$1")); + while (regex_replace(t, t, "\\\\(text|lyxmathsym)\\{([^\\}]*)\\}", "$2")); str = from_utf8(t); } return str; @@ -1320,8 +1320,6 @@ static void buildAccentsMap() accents["negmedspace"] = u8"\uf0005"; accents["thickspace"] = u8"\uf0006"; accents["negthickspace"] = u8"\uf0007"; - accents["lyxmathsym{ß}"] = "ß"; - accents["text{ß}"] = "ß"; accents["ddot{\\imath}"] = "ï"; buildaccent("ddot", "aAeEhHiIioOtuUwWxXyY", "äÄëËḧḦïÏïöÖẗüÜẅẄẍẌÿŸ"); // umlaut @@ -1358,7 +1356,7 @@ static void buildAccentsMap() buildaccent("ogonek|k", "AaEeIiUuOo", "ĄąĘęĮįŲųǪǫ"); // ogonek buildaccent("cedilla|c", "CcGgKkLlNnRrSsTtEeDdHh", - "ÇçĢĢĶķĻļŅņŖŗŞşŢţȨȩḐḑḨḩ"); // cedilla + "ÇçĢģĶķĻļŅņŖŗŞşŢţȨȩḐḑḨḩ"); // cedilla buildaccent("subring|textsubring", "Aa", "Ḁḁ"); // subring buildaccent("subhat|textsubcircum", "DdEeLlNnTtUu", -- 2.39.5