From d96135a9dcc54ab1e6283863f4534ef5530c2faa Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 2 Apr 2022 11:19:55 +0200 Subject: [PATCH] Amend bcad19e504f845 Allow searching in notes and comments if non-output-content is true --- src/insets/InsetNote.cpp | 12 +++++++++++- src/insets/InsetText.cpp | 6 ------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index adacef3bae..05253de855 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -206,9 +206,19 @@ bool InsetNote::isMacroScope() const void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const { - if (params_.type == InsetNoteParams::Note) + if (params_.type != InsetNoteParams::Greyedout + && (runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) return; + if (params_.type == InsetNoteParams::Note) { + if ((runparams_in.for_searchAdv & OutputParams::SearchNonOutput) != 0) { + OutputParams runparams(runparams_in); + InsetCollapsible::latex(os, runparams); + runparams_in.encoding = runparams.encoding; + } + return; + } + OutputParams runparams(runparams_in); if (params_.type == InsetNoteParams::Comment) { runparams.inComment = true; diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index af1847cbaf..1767f2c31f 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -485,12 +485,6 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const // environment. Standard collapsible insets should not // redefine this, non-standard ones may call this. InsetLayout const & il = getLayout(); - if (runparams.for_searchAdv != OutputParams::NoSearch && - (runparams.for_searchAdv & OutputParams::SearchNonOutput) == 0 && - !il.latexname().empty() && - il.latextype() == InsetLaTeXType::ENVIRONMENT && - il.latexname() == "comment") - return; if (il.forceOwnlines()) os << breakln; -- 2.39.5