]> git.lyx.org Git - features.git/commitdiff
Add completion-accept lfun.
authorPavel Sanda <sanda@lyx.org>
Mon, 8 Sep 2008 00:24:47 +0000 (00:24 +0000)
committerPavel Sanda <sanda@lyx.org>
Mon, 8 Sep 2008 00:24:47 +0000 (00:24 +0000)
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
src/LyXAction.cpp
src/frontends/qt4/GuiView.cpp

index 992a73f5af60d02f0ab8674bc7de884a17b60992..54d2217a9d5292c3e7dc9c937004d7f7f4e8744c 100644 (file)
@@ -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
 };
 
index bcd72be2666e39458a56d9fc745ded5fd205120e..21f6490a29c9a3c5dc34d137cd55909744e9fc29 100644 (file)
@@ -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
index 7d17028c211a554ac9270d2bd7d105b3495bb319..a034a6e82da92872cdbf7d34bf1df2261af8362c 100644 (file)
@@ -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;