Stefan Schimanski wrote:
> I prefer a new LFUN because it is easier to bind and easier to get to know 
> about it in the mini buffer completion popup.

really easy.
i will wait for your commit.
pavel
diff --git a/src/FuncCode.h b/src/FuncCode.h
index 992a73f..54d2217 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 bcd72be..21f6490 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 7d17028..a034a6e 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;

Reply via email to