commit d96135a9dcc54ab1e6283863f4534ef5530c2faa
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Apr 2 11:19:55 2022 +0200

    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 adacef3..05253de 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 af1847c..1767f2c 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;
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to