return true;
}
+} // namespace
+
bool findOne(BufferView * bv, docstring const & searchstr,
bool case_sens, bool whole, bool forward,
- bool find_del = true, bool check_wrap = false)
+ bool find_del, bool check_wrap)
{
if (!searchAllowed(searchstr))
return false;
}
+namespace {
+
int replaceAll(BufferView * bv,
docstring const & searchstr, docstring const & replacestr,
bool case_sens, bool whole)
*/
bool lyxfind(BufferView * bv, FuncRequest const & ev);
+bool findOne(BufferView * bv, docstring const & searchstr,
+ bool case_sens, bool whole, bool forward,
+ bool find_del = true, bool check_wrap = false);
+
/** Parse the string encoding of the replace request that is found in
* \c ev.argument and act on it.
* The string is encoded by \c replace2string.
--- /dev/null
+#include <config.h>
+#include <doctest.h>
+
+#include "Buffer.h"
+#include "BufferView.h"
+#include "Changes.h"
+#include "Font.h"
+#include "lyxfind.h"
+#include "Paragraph.h"
+#include "Text.h"
+
+using namespace lyx;
+
+
+TEST_CASE("no false matches in deleted text") {
+ Buffer b("noname");
+ BufferView bv(b);
+ b.paragraphs()[0].insert(0, from_utf8("some text"), Font(), Change(Change::DELETED));
+ CHECK_FALSE(findOne(&bv, from_utf8("abc"), false, false, true, false, false));
+}