]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / BufferView_pimpl.C
index 0617392056861d20d56d9dc64254e6141044e978..bf2bc7a40d6ebfa73b88e47395049fca36efc028 100644 (file)
@@ -520,12 +520,8 @@ void BufferView::Pimpl::workAreaKeyPress(LyXKeySymPtr key,
         * of the cursor. Note we cannot do this inside
         * dispatch() itself, because that's called recursively.
         */
-       if (available()) {
-               screen().prepareCursor();
-               cursor_timeout.setTimeout(100);
-               cursor_timeout.restart();
-               cursor_timeout.setTimeout(400);
-       }
+       if (available())
+               screen().showCursor(*bv_);
 }
 
 
@@ -623,9 +619,9 @@ void BufferView::Pimpl::update(Update::flags flags)
 
                CoordCache backup;
                std::swap(theCoords, backup);
-               
+
                // This, together with doneUpdating(), verifies (using
-               // asserts) that screen redraw is not called from 
+               // asserts) that screen redraw is not called from
                // within itself.
                theCoords.startUpdating();
 
@@ -976,7 +972,6 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd)
        case LFUN_FONT_STATE:
        case LFUN_INSERT_LABEL:
        case LFUN_BOOKMARK_SAVE:
-       case LFUN_LABEL_GOTO:
        case LFUN_GOTO_PARAGRAPH:
        case LFUN_GOTOERROR:
        case LFUN_GOTONOTE:
@@ -991,6 +986,12 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd)
                flag.enabled(true);
                break;
 
+       case LFUN_LABEL_GOTO: {
+               flag.enabled(!cmd.argument.empty()
+                   || getInsetByCode<InsetRef>(cursor_, InsetBase::REF_CODE));
+               break;
+       }
+
        case LFUN_BOOKMARK_GOTO:
                flag.enabled(isSavedPosition(convert<unsigned int>(cmd.argument)));
                break;