aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2015-07-18 17:13:01 -0300
committerJustin M. Keyes <justinkz@gmail.com>2015-07-21 23:51:07 -0400
commit6048e95f33161420f9d863a2ce5ccf9464df2dba (patch)
treeba634ac71dc2441d40547941f4f4d946f0141863
parent6571c84d54a93e186bccf298bf4a3d0a45ddf28c (diff)
downloadrneovim-6048e95f33161420f9d863a2ce5ccf9464df2dba.tar.gz
rneovim-6048e95f33161420f9d863a2ce5ccf9464df2dba.tar.bz2
rneovim-6048e95f33161420f9d863a2ce5ccf9464df2dba.zip
tui: send resize sequences to the terminal
Neither setting the 'columns' and 'lines' options nor using the `:winsize` command resized the terminal window, which caused display glitches. Re: #2863
-rw-r--r--src/nvim/tui/tui.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 1deab23b05..c8565a1e5a 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -350,6 +350,11 @@ static void tui_resize(UI *ui, int width, int height)
data->scroll_region.left = 0;
data->scroll_region.right = width - 1;
data->row = data->col = 0;
+
+ // try to resize the terminal window
+ char r[16]; // enough for 9999x9999
+ snprintf(r, sizeof(r), "\x1b[8;%d;%dt", height, width);
+ out(ui, r, strlen(r));
}
static void tui_clear(UI *ui)