From: Juergen Spitzmueller Date: Mon, 17 Jul 2023 14:58:04 +0000 (+0200) Subject: Support protected and thin space in simple search (#12836) X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f6f936e3d049c05ad0795c32696df895d8b61313;p=features.git Support protected and thin space in simple search (#12836) --- diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 025acf157e..d7fa35ef2e 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -4669,7 +4669,7 @@ int Paragraph::find(docstring const & str, bool cs, bool mw, if (!inset->isLetter() && !inset->isChar()) break; odocstringstream os; - if (inset->lyxCode() == lyx::QUOTE_CODE) { + if (inset->lyxCode() == lyx::QUOTE_CODE || inset->lyxCode() == lyx::SPACE_CODE) { OutputParams op(0); op.find_set_feature(OutputParams::SearchQuick); inset->plaintext(os, op); diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index a5b04648f5..14db93fe55 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -703,7 +703,7 @@ void InsetSpace::latex(otexstream & os, OutputParams const & runparams) const int InsetSpace::plaintext(odocstringstream & os, - OutputParams const &, size_t) const + OutputParams const & rp, size_t) const { switch (params_.kind) { case InsetSpaceParams::HFILL: @@ -747,7 +747,11 @@ int InsetSpace::plaintext(odocstringstream & os, os.put(0x2003); return 2; case InsetSpaceParams::THIN: - os.put(0x202f); + if (rp.find_effective()) + // simple search + os << ' '; + else + os.put(0x202f); return 1; case InsetSpaceParams::MEDIUM: os.put(0x200b); // ZERO WIDTH SPACE, makes the unbreakable medium space breakable @@ -761,7 +765,11 @@ int InsetSpace::plaintext(odocstringstream & os, return 1; case InsetSpaceParams::PROTECTED: case InsetSpaceParams::CUSTOM_PROTECTED: - os.put(0x00a0); + if (rp.find_effective()) + // simple search + os << ' '; + else + os.put(0x00a0); return 1; case InsetSpaceParams::NEGTHIN: case InsetSpaceParams::NEGMEDIUM: