Disable if in search-adv modus and not searching in not-printed contents,
enable otherwise
// 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;