Allow searching in notes and comments if non-output-content is true
This commit is contained in:
Juergen Spitzmueller 2022-04-02 11:19:55 +02:00
parent 50374e38e1
commit d96135a9dc
2 changed files with 11 additions and 7 deletions

View File

@ -206,9 +206,19 @@ bool InsetNote::isMacroScope() const
void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) 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; 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); OutputParams runparams(runparams_in);
if (params_.type == InsetNoteParams::Comment) { if (params_.type == InsetNoteParams::Comment) {
runparams.inComment = true; runparams.inComment = true;

View File

@ -485,12 +485,6 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
// environment. Standard collapsible insets should not // environment. Standard collapsible insets should not
// redefine this, non-standard ones may call this. // redefine this, non-standard ones may call this.
InsetLayout const & il = getLayout(); 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()) if (il.forceOwnlines())
os << breakln; os << breakln;