From 89a58051e1c860a0e8d3cd00daa8b8d53993a505 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Wed, 26 Mar 2008 19:20:17 +0000 Subject: [PATCH] Make Richard happy (Find Next via LFUN_WORD_FIND). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23983 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 9b3ae322bb..4c4cc6afe0 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -263,6 +263,9 @@ struct BufferView::Private /** Not owned, so don't delete. */ frontend::GuiBufferViewDelegate * gui_; + + /// Cache for Find Next + FuncRequest search_request_cache_; }; @@ -1182,12 +1185,17 @@ bool BufferView::dispatch(FuncRequest const & cmd) buffer_.text().acceptOrRejectChanges(d->cursor_, Text::REJECT); break; - case LFUN_WORD_FIND: - if (find(this, cmd)) + case LFUN_WORD_FIND: { + FuncRequest req = cmd; + if (cmd.argument().empty() && !d->search_request_cache_.argument().empty()) + req = d->search_request_cache_; + if (find(this, req)) showCursor(); else message(_("String not found!")); + d->search_request_cache_ = req; break; + } case LFUN_WORD_REPLACE: { bool has_deleted = false;