FindAdv: Search also if layout of the searched paragraph has 'inpreamble' set

Using 'force' in call to TeXOnePar() enables the search of any string in document.
This commit is contained in:
Kornel Benko 2022-04-23 20:33:47 +02:00
parent 40a331abfd
commit c7b6bf4519

View File

@ -1108,7 +1108,7 @@ static docstring buffer_to_latex(Buffer & buffer)
}
pit_type const endpit = buffer.paragraphs().size();
for (pit_type pit = 0; pit != endpit; ++pit) {
TeXOnePar(buffer, buffer.text(), pit, os, runparams);
TeXOnePar(buffer, buffer.text(), pit, os, runparams, string(), -1, -1, true);
LYXERR(Debug::FINDVERBOSE, "searchString up to here: " << ods.str());
}
return ods.str();
@ -4019,7 +4019,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
if (len != -1 && endpos > cur.pos() + len)
endpos = cur.pos() + len;
TeXOnePar(buf, *cur.innerText(), cur.pit(), os, runparams,
string(), cur.pos(), endpos);
string(), cur.pos(), endpos, true);
LYXERR(Debug::FIND, "Latexified text from pos(" << cur.pos() << ") len(" << len << "): " << ods.str());
return(ods.str());
} else if (cur.inMathed()) {
@ -4612,7 +4612,7 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma
runparams.flavor = Flavor::XeTeX;
runparams.linelen = 8000; //lyxrc.plaintext_linelen;
runparams.dryrun = true;
TeXOnePar(repl_buffer, repl_buffer.text(), 0, os, runparams);
TeXOnePar(repl_buffer, repl_buffer.text(), 0, os, runparams, string(), -1, -1, true);
//repl_buffer.getSourceCode(ods, 0, repl_buffer.paragraphs().size(), false);
docstring repl_latex = ods.str();
LYXERR(Debug::FINDVERBOSE, "Latexified replace_buffer: '" << repl_latex << "'");