commit d87511308bdcca7545cef5f9c63a7fbde6ccf9b0
Author: Juergen Spitzmueller <[email protected]>
Date: Tue Jan 12 16:11:58 2021 +0100
Ignore tracked deletions in simple find (#11051)
---
src/Paragraph.cpp | 9 +++++++--
src/lyxfind.cpp | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 1b6a766..8181b1c 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4388,6 +4388,13 @@ int Paragraph::find(docstring const & str, bool cs, bool
mw,
int i = 0;
pos_type const parsize = d->text_.size();
for (i = 0; i < strsize && pos < parsize; ++i, ++pos) {
+ // ignore deleted matter
+ if (!del && isDeleted(pos)) {
+ if (pos == parsize - 1)
+ break;
+ pos++;
+ continue;
+ }
// Ignore "invisible" letters such as ligature breaks
// and hyphenation chars while searching
while (pos < parsize - 1 && isInset(pos)) {
@@ -4404,8 +4411,6 @@ int Paragraph::find(docstring const & str, bool cs, bool
mw,
break;
if (!cs && uppercase(str[i]) != uppercase(d->text_[pos]))
break;
- if (!del && isDeleted(pos))
- break;
}
if (i != strsize)
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index abbabf9..677b382 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -464,7 +464,7 @@ bool lyxfind(BufferView * bv, FuncRequest const & ev)
bool matchword = parse_bool(howto);
bool forward = parse_bool(howto);
- return findOne(bv, search, casesensitive, matchword, forward, true,
true);
+ return findOne(bv, search, casesensitive, matchword, forward, false,
true);
}
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs