From 375a2e6e1c7137fa0ec91be643f81a9081376262 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Mon, 8 Sep 2008 00:24:47 +0000 Subject: [PATCH] Add completion-accept lfun. Fixes first part of http://bugzilla.lyx.org/show_bug.cgi?id=5062 . http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg143281.html git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26331 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/FuncCode.h | 1 + src/LyXAction.cpp | 9 +++++++++ src/frontends/qt4/GuiView.cpp | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/src/FuncCode.h b/src/FuncCode.h index 992a73f5af..54d2217a9d 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -405,6 +405,7 @@ enum FuncCode LFUN_GRAPHICS_GROUPS_UNIFY, LFUN_SET_GRAPHICS_GROUP, LFUN_COMPLETION_CANCEL, + LFUN_COMPLETION_ACCEPT, LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index bcd72be266..21f6490a29 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3011,6 +3011,15 @@ void LyXAction::init() * \endvar */ { LFUN_COMPLETION_CANCEL, "completion-cancel", SingleParUpdate, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_COMPLETION_ACCEPT + * \li Action: Accept suggested completion. + * \li Syntax: completion-accept + * \li Origin: sanda, Sep 08 2008 + * \endvar + */ + { LFUN_COMPLETION_ACCEPT, "completion-accept", SingleParUpdate, Edit }, + /*! * \var lyx::FuncCode lyx::LFUN_BRANCH_ACTIVATE diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 7d17028c21..a034a6e82d 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1212,6 +1212,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag) enable = false; break; + case LFUN_COMPLETION_ACCEPT: case LFUN_COMPLETION_CANCEL: if (!d.current_work_area_ || (!d.current_work_area_->completer().popupVisible() @@ -2022,6 +2023,12 @@ bool GuiView::dispatch(FuncRequest const & cmd) } break; + case LFUN_COMPLETION_ACCEPT: + if (d.current_work_area_) + d.current_work_area_->completer().activate(); + break; + + default: dispatched = false; break; -- 2.39.5