]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Fix display of single-char macro names
[lyx.git] / src / BufferView.cpp
index d2f324d168b15a9661c826fe0f8cc8713bcf916e..ac5c318909b7e74a69a97f05d24fd5e1d56cf152 100644 (file)
@@ -476,6 +476,14 @@ void BufferView::processUpdateFlags(Update::flags flags)
        if (flags == Update::None)
                return;
 
+       /* FIXME We would like to avoid doing this here, since it is very
+        * expensive and is called in updateBuffer already. However, even
+        * inserting a plain character can invalidate the overly fragile
+        * tables of child documents built by updateMacros. Some work is
+        * needed to avoid doing that when not necessary.
+        */
+       buffer_.updateMacros();
+
        // SinglePar is ignored for now (this should probably change). We
        // set it ourselves below, at the price of always rebreaking the
        // paragraph at cursor. This can be expensive for large tables.
@@ -844,7 +852,7 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
                d->cursor_.setCurrentFont();
                // Do not forget to reset the anchor (see #9912)
                d->cursor_.resetAnchor();
-               processUpdateFlags(Update::FitCursor);
+               processUpdateFlags(Update::Force | Update::FitCursor);
        }
 
        return success;
@@ -1342,7 +1350,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                //  without calling recordUndo. Fix this before using
                //  recordUndoBufferParams().
                cur.recordUndoFullBuffer();
-               buffer_.params().setBaseClass(argument);
+               buffer_.params().setBaseClass(argument, buffer_.layoutPos());
                makeDocumentClass();
                dr.screenUpdate(Update::Force);
                dr.forceBufferUpdate();
@@ -1366,7 +1374,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
        case LFUN_LAYOUT_RELOAD: {
                LayoutFileIndex bc = buffer_.params().baseClassID();
                LayoutFileList::get().reset(bc);
-               buffer_.params().setBaseClass(bc);
+               buffer_.params().setBaseClass(bc, buffer_.layoutPos());
                makeDocumentClass();
                dr.screenUpdate(Update::Force);
                dr.forceBufferUpdate();