]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
fix dialogs in LyX/Mac
[lyx.git] / src / lyxfunc.C
index f4fac34f66115f3050800e2d55a387f41d6c6c73..a2dadf5f933fb7ab3d7cc7e420bd87291b8fe6ec 100644 (file)
@@ -1334,7 +1334,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
                                       << (unknown_tokens == 1 ? "" : "s")
                                       << endl;
                        }
-                       
+
                        if (defaults.writeFile(defaults.fileName()))
                                setMessage(_("Document defaults saved in ")
                                           + MakeDisplayPath(fname));
@@ -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()