]> git.lyx.org Git - features.git/commitdiff
* only remember the last selection if it didn't come by the cursor completion indicator
authorStefan Schimanski <sts@lyx.org>
Thu, 28 Feb 2008 12:43:24 +0000 (12:43 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 28 Feb 2008 12:43:24 +0000 (12:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23316 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiCompleter.cpp

index b5c223c1f9b774050b72e72f96464f6e2590b848..d3169948cb34d859854c727d9b329cf9f6a5c402 100644 (file)
@@ -341,11 +341,13 @@ void GuiCompleter::updatePrefix(Cursor & cur)
        // if popup is not empty, the new selection will
        // be our last valid one
        QString const & s = currentCompletion();
-       if (s.length() > 0)
-               last_selection_ = s;
-       else
-               last_selection_ = old;
-       
+       if (popupVisible() || inlineVisible()) {
+               if (s.length() > 0)
+                       last_selection_ = s;
+               else
+                       last_selection_ = old;
+       }
+
        // update inline completion because the default
        // completion string might have changed
        if (inlineVisible())
@@ -460,11 +462,13 @@ void GuiCompleter::updateModel(Cursor & cur, bool popupUpdate, bool inlineUpdate
        
        // if popup is not empty, the new selection will
        // be our last valid one
-       QString const & s = currentCompletion();
-       if (s.length() > 0)
-               last_selection_ = s;
-       else
-               last_selection_ = old;
+       if (popupVisible() || inlineVisible()) {
+               QString const & s = currentCompletion();
+               if (s.length() > 0)
+                       last_selection_ = s;
+               else
+                       last_selection_ = old;
+       }
 
        // show inline completion
        if (inlineUpdate)