}
if (isVerbatim(params()) || isListings(params())) {
- os << '[' << screenLabel() << '\n'
- // FIXME: We don't know the encoding of the file, default to UTF-8.
- << includedFileName(buffer(), params()).fileContents("UTF-8")
- << "\n]";
+ if (op.for_search) {
+ os << '[' << screenLabel() << ']';
+ }
+ else {
+ os << '[' << screenLabel() << '\n'
+ // FIXME: We don't know the encoding of the file, default to UTF-8.
+ << includedFileName(buffer(), params()).fileContents("UTF-8")
+ << "\n]";
+ }
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
}
runparams.linelen = 10000; //lyxrc.plaintext_linelen;
// No side effect of file copying and image conversion
runparams.dryrun = true;
+ runparams.for_search = true;
LYXERR(Debug::FIND, "Stringifying with cur: "
<< cur << ", from pos: " << cur.pos() << ", end: " << end);
- docstring result = par.asString(cur.pos(), end,
+ return par.asString(cur.pos(), end,
AS_STR_INSETS | AS_STR_SKIPDELETE | AS_STR_PLAINTEXT,
&runparams);
- return result;
} else if (cur.inMathed()) {
CursorSlice cs = cur.top();
MathData md = cs.cell();
MatchResult mres = match(cur, -1, false);
int match_len = mres.match_len;
LYXERR(Debug::FIND, "match_len: " << match_len);
- if ((mres.pos > 10000) || (mres.match2end > 10000) || (match_len > 10000)) {
+ if ((mres.pos > 100000) || (mres.match2end > 100000) || (match_len > 100000)) {
LYXERR0("BIG LENGTHS: " << mres.pos << ", " << match_len << ", " << mres.match2end);
match_len = 0;
}
while (mres.pos > 5 && (increment > 5)) {
DocIterator old_cur = cur;
for (int i = 0; i < increment && cur; cur.forwardPos(), i++) {
- /*
- while (cur && cur.depth() != old_cur.depth())
- cur.forwardPos();
- */
}
if (! cur) {
cur = old_cur;
return docstring();
if (!opt.ignoreformat)
return latexifyFromCursor(cur, len);
- else
- return stringifyFromCursor(cur, len);
+ else {
+ if (len < 0) {
+ return stringifyFromCursor(cur, len);
+ }
+ else {
+ return stringifyFromCursor(cur, len);
+ }
+ }
}