From b961d72bba0eb19a4b87cd1076f5e9c683461cba Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 21 Nov 2009 15:54:39 +0100 Subject: [PATCH] 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. --- src/MacVim/gui_macvim.m | 5 +++++ src/ui.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index ed658206..07e9a1e1 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -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. diff --git a/src/ui.c b/src/ui.c index 2e18638c..d0a26fba 100644 --- a/src/ui.c +++ b/src/ui.c @@ -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(); -- 2.11.4.GIT