]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
fix reading the author field.
[lyx.git] / src / lyxfunc.C
index 5ed01e177f8468f08c44e66695f385ff943c4749..2103bdb1974c90d50d099b5e78544b08821198f7 100644 (file)
@@ -1422,9 +1422,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
 
                default: {
                        update = false;
-                       DispatchResult res = view()->cursor().dispatch(cmd);
-                       if (res.dispatched())
-                               update |= res.update();
+                       view()->cursor().dispatch(cmd);
+                       if (view()->cursor().result().dispatched())
+                               update |= view()->cursor().result().update();
                        else
                                update |= view()->dispatch(cmd);
 
@@ -1433,7 +1433,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
                }
 
                if (view()->available()) {
-                       if (view()->fitCursor() || update)
+                       // Redraw screen unless explicitly told otherwise.
+                       // This also initializes the position cache for all insets
+                       // in (at least partially) visible top-level paragraphs.
+                       if (update)
+                               view()->update();
+
+                       // fitCursor() needs valid inset position. The previous call to
+                       // update() makes sure we have such even for freshly created
+                       // insets.
+                       if (view()->fitCursor())
                                view()->update();
                        // if we executed a mutating lfun, mark the buffer as dirty
                        if (getStatus(cmd).enabled()