Avoid 0x0 window when autosaved dimension missing

This fixes a bug where the first window would be tiny if no autosaved
dimensions existed on startup.
This commit is contained in:
Bjorn Winckler
2009-11-21 15:54:39 +01:00
parent 86d7c475d6
commit 5c9e4f17bc
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -133,6 +133,11 @@ gui_macvim_after_fork_init()
&& (rows > 4 && rows < 1000 && cols > 29 && cols < 4000)) {
gui.num_rows = rows;
gui.num_cols = cols;
} else {
// Use the defaults (typically 80x24), if there are no autosaved rows &
// columns.
gui.num_rows = Rows;
gui.num_cols = Columns;
}
// Check which code path to take for string drawing.
+3 -1
View File
@@ -310,7 +310,9 @@ ui_get_shellsize()
#ifdef FEAT_GUI
if (gui.in_use
# ifdef FEAT_GUI_MACVIM
|| gui.starting /* TODO: Do this check for all GUIs? */
/* Avoid using terminal dimensions for GUI window. MacVim
* autosaves the dimensions of the first window. */
|| gui.starting
# endif
)
retval = gui_get_shellsize();