Am Fri, 1 Apr 2022 13:52:15 +0200
schrieb Kornel Benko <kor...@lyx.org>:

> Am Fri, 01 Apr 2022 11:35:58 +0200
> schrieb Jürgen Spitzmüller <sp...@lyx.org>:
> 
> > Am Freitag, dem 01.04.2022 um 11:33 +0200 schrieb Kornel Benko:  
> > > This will take a while :(    
> > 
> > No problem.
> > 
> > Jürgen  
> 
> Now at least one can search the string inside a comment, but
> the feature is ignored.
> This will need more work.
> 
>       Kornel

The attached seems to halfway work. Using
        search-ignore non-output-content true
does not find anything in comment. while
        search-ignore non-output-content false
searches in comment _and_ in normal text.

What is missing is the search in comments only.

        Kornel

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index a4521848c3..af1847cbaf 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -483,10 +483,17 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
 	// This implements the standard way of handling the LaTeX
 	// output of a text inset, either a command or an
 	// 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;
 	if (!il.latexname().empty()) {
 		if (il.latextype() == InsetLaTeXType::COMMAND) {

Attachment: pgpUnIFY5XGx_.pgp
Description: Digitale Signatur von OpenPGP

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to