]> git.lyx.org Git - features.git/commitdiff
FindAdv: Handle latex-output for comment-environment
authorKornel Benko <kornel@lyx.org>
Fri, 1 Apr 2022 18:14:47 +0000 (20:14 +0200)
committerKornel Benko <kornel@lyx.org>
Fri, 1 Apr 2022 18:14:47 +0000 (20:14 +0200)
Disable if in search-adv modus and not searching in not-printed contents,
enable otherwise

src/insets/InsetText.cpp

index a4521848c310f280d9a0cbb6c9a42fdc9bf2ba75..af1847cbaf0a72787eebd443ff4248ab6d9f491a 100644 (file)
@@ -485,6 +485,13 @@ 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;
        bool needendgroup = false;