mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fix LFUN_WORD_FIND
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22925 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d9669be4ec
commit
02e8322c79
@ -1108,7 +1108,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_WORD_FIND:
|
||||
find(this, cmd);
|
||||
if (find(this, cmd))
|
||||
showCursor();
|
||||
else
|
||||
message(_("String not found!"));
|
||||
break;
|
||||
|
||||
case LFUN_WORD_REPLACE: {
|
||||
|
@ -244,10 +244,10 @@ docstring const replace2string(docstring const & search, docstring const & repla
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
@ -261,12 +261,7 @@ void find(BufferView * bv, FuncRequest const & ev)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,8 +45,9 @@ docstring const replace2string(docstring const & search,
|
||||
/** Parse the string encoding of the find request that is found in
|
||||
* \c ev.argument and act on it.
|
||||
* The string is encoded by \c find2string.
|
||||
* \return true if the string was found.
|
||||
*/
|
||||
void find(BufferView * bv, FuncRequest const & ev);
|
||||
bool find(BufferView * bv, FuncRequest const & ev);
|
||||
|
||||
/** Parse the string encoding of the replace request that is found in
|
||||
* \c ev.argument and act on it.
|
||||
|
Loading…
Reference in New Issue
Block a user