]> git.lyx.org Git - lyx.git/commitdiff
Don't restart the blinking cursor inside WorkArea because some shortcuts can delete...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 11 Oct 2007 12:31:48 +0000 (12:31 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 11 Oct 2007 12:31:48 +0000 (12:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20900 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp
src/frontends/WorkArea.cpp

index b0493ac123fec8ae016babb3b376c67779f23cbe..1feb1c7cfa95825e8e1f7a500d7d4bdf9599a2c7 100644 (file)
@@ -314,6 +314,17 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
 }
 
 
+namespace {
+void restartCursor(LyXView * lv)
+{
+       /* When we move around, or type, it's nice to be able to see
+        * the cursor immediately after the keypress.
+        */
+       if (lv && lv->currentWorkArea())
+               lv->currentWorkArea()->startBlinkingCursor();
+}
+}
+
 void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
 {
        LYXERR(Debug::KEY) << "KeySym is " << keysym.getSymbolName() << endl;
@@ -322,11 +333,13 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
        if (!keysym.isOK()) {
                LYXERR(Debug::KEY) << "Empty kbd action (probably composing)"
                                   << endl;
+               restartCursor(lyx_view_);
                return;
        }
 
        if (keysym.isModifier()) {
                LYXERR(Debug::KEY) << "isModifier true" << endl;
+               restartCursor(lyx_view_);
                return;
        }
 
@@ -396,6 +409,7 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
                } else {
                        LYXERR(Debug::KEY) << "Unknown, !isText() - giving up" << endl;
                        lyx_view_->message(_("Unknown function."));
+                       restartCursor(lyx_view_);
                        return;
                }
        }
@@ -411,6 +425,8 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
        } else {
                dispatch(func);
        }
+
+       restartCursor(lyx_view_);
 }
 
 
index f1114df40df7f4b17cb95a7fc8289dbee3c6dc1e..86a4d93cf52880dd42e11ec304cd1d806d886b7a 100644 (file)
@@ -171,11 +171,6 @@ void WorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
 
        theLyXFunc().setLyXView(lyx_view_);
        theLyXFunc().processKeySym(key, mod);
-
-       /* When we move around, or type, it's nice to be able to see
-        * the cursor immediately after the keypress.
-        */
-       startBlinkingCursor();
 }