]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
more cursor dispatch
[lyx.git] / src / BufferView_pimpl.C
index 27adc9dcfb9699d2e89532111ed2f659499eb5b7..2f136433d3c45c035a611ced279ec5f0b86b216f 100644 (file)
@@ -328,9 +328,6 @@ void BufferView::Pimpl::buffer(Buffer * b)
                if (bv_->text() == 0)
                        resizeCurrentBuffer();
 
-               // FIXME: needed when ?
-               fitCursor();
-
                // Buffer-dependent dialogs should be updated or
                // hidden. This should go here because some dialogs (eg ToC)
                // require bv_->text.
@@ -358,7 +355,6 @@ void BufferView::Pimpl::buffer(Buffer * b)
 
 bool BufferView::Pimpl::fitCursor()
 {
-       lyxerr << "BufferView::Pimpl::fitCursor." << endl;
        if (screen().fitCursor(bv_)) {
                updateScrollbar();
                return true;
@@ -905,10 +901,10 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
                if (inset) {
                        res = inset->dispatch(cur, cmd);
                } else {
-                       res = cur.innerText()->dispatch(cur, cmd);
+                       res = bv_->text()->dispatch(cur, cmd);
                }
 
-               if (bv_->fitCursor() || res.update()) {
+               if (fitCursor() || res.update()) {
                        bv_->update();
                        cur.updatePos();
                }
@@ -933,8 +929,8 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
 
                screen().hideCursor();
 
-               // either the inset under the cursor or the surrounding LyXText will
-               // handle this event.
+               // either the inset under the cursor or the
+               // surrounding LyXText will handle this event.
 
                // built temporary path to inset
                LyXText * text = bv_->text();
@@ -950,7 +946,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
                // if it wishes to do so.
                DispatchResult res = cur.dispatch(cmd);
 
-               if (bv_->fitCursor() || res.update())
+               if (fitCursor() || res.update())
                        bv_->update();
 
                // see workAreaKeyPress
@@ -1187,7 +1183,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
                cur.clearSelection();
                bv_->update();
                cur.resetAnchor();
-               cmd.message(N_("Mark off"));
+               cur.message(N_("Mark off"));
                break;
 
        case LFUN_MARK_ON:
@@ -1195,27 +1191,27 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
                cur.mark() = true;
                bv_->update();
                cur.resetAnchor();
-               cmd.message(N_("Mark on"));
+               cur.message(N_("Mark on"));
                break;
 
        case LFUN_SETMARK:
                cur.clearSelection();
                if (cur.mark()) {
-                       cmd.message(N_("Mark removed"));
+                       cur.message(N_("Mark removed"));
                } else {
                        cur.mark() = true;
-                       cmd.message(N_("Mark set"));
+                       cur.message(N_("Mark set"));
                }
                cur.resetAnchor();
                bv_->update();
                break;
 
        case LFUN_UNKNOWN_ACTION:
-               cmd.errorMessage(N_("Unknown function!"));
+               cur.errorMessage(N_("Unknown function!"));
                break;
 
        default:
-               return cur.dispatch(cmd).dispatched();
+               return false;
        }
 
        return true;