#include "buffer_funcs.h"
#include "BufferView.h"
#include "Changes.h"
-#include "support/debug.h"
#include "FuncRequest.h"
-#include "support/gettext.h"
#include "Text.h"
#include "Paragraph.h"
#include "ParIterator.h"
#include "frontends/alert.h"
#include "support/convert.h"
+#include "support/debug.h"
#include "support/docstream.h"
+#include "support/gettext.h"
#include "support/lstrings.h"
using namespace std;
}
-void find(BufferView * bv, FuncRequest const & ev)
+bool find(BufferView * bv, FuncRequest const & ev)
{
if (!bv || ev.action != LFUN_WORD_FIND)
- return;
+ return false;
//lyxerr << "find called, cmd: " << ev << endl;
bool matchword = parse_bool(howto);
bool forward = parse_bool(howto);
- bool const found = find(bv, search,
- casesensitive, matchword, forward);
-
- if (!found)
- // emit message signal.
- bv->message(_("String not found!"));
+ return find(bv, search, casesensitive, matchword, forward);
}
} else {
// if we have deleted characters, we do not replace at all, but
// rather search for the next occurence
- bool const found = find(bv, search,
- casesensitive, matchword, forward);
-
- if (!found)
- // emit message signal.
+ if (find(bv, search, casesensitive, matchword, forward))
+ bv->showCursor();
+ else
bv->message(_("String not found!"));
}
}