From 5732340c203572715f3ef68d573f68a38447132c Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sat, 18 Jul 2015 20:37:10 -0300 Subject: tui: respect the 'co' and 'lines' options on startup `nvim --cmd "set co=... lines="` didn't work as expected, and forced to set those options on VimEnter or afterwards. --- src/nvim/tui/tui.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index c8565a1e5a..ae9e70e2e0 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -646,12 +646,20 @@ static void update_size(UI *ui) { TUIData *data = ui->data; int width = 0, height = 0; - // 1 - try from a system call(ioctl/TIOCGWINSZ on unix) + + // 1 - look for non-default 'columns' and 'lines' options during startup + if (starting && (Columns != 80 || Rows != 24)) { + width = (int)Columns; + height = (int)Rows; + goto end; + } + + // 2 - try from a system call(ioctl/TIOCGWINSZ on unix) if (!uv_tty_get_winsize(&data->output_handle, &width, &height)) { goto end; } - // 2 - use $LINES/$COLUMNS if available + // 3 - use $LINES/$COLUMNS if available const char *val; int advance; if ((val = os_getenv("LINES")) @@ -661,7 +669,7 @@ static void update_size(UI *ui) goto end; } - // 3- read from terminfo if available + // 4 - read from terminfo if available height = unibi_get_num(data->ut, unibi_lines); width = unibi_get_num(data->ut, unibi_columns); -- cgit