diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-05-31 11:53:08 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-05-31 11:53:08 -0400 |
commit | deb65188ac25e4d941b0304464befb8bd9d07c3b (patch) | |
tree | 140516e75a8d6b5cd8b4195e8ee164a1b68ba83c | |
parent | 8c84c124edf125ea7151488ccf8989a54e24da43 (diff) | |
parent | e61e4e3285dcbccf3709be49eccac79cc84909ff (diff) | |
download | rneovim-deb65188ac25e4d941b0304464befb8bd9d07c3b.tar.gz rneovim-deb65188ac25e4d941b0304464befb8bd9d07c3b.tar.bz2 rneovim-deb65188ac25e4d941b0304464befb8bd9d07c3b.zip |
Merge #2762 'terminal: don't set vterm size to 0'
-rw-r--r-- | src/nvim/terminal.c | 4 | ||||
-rw-r--r-- | src/nvim/window.c | 4 | ||||
-rw-r--r-- | test/functional/terminal/mouse_spec.lua | 50 |
3 files changed, 32 insertions, 26 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 9195004a54..0f7e04ace2 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -313,6 +313,10 @@ void terminal_resize(Terminal *term, uint16_t width, uint16_t height) return; } + if (height == 0 || width == 0) { + return; + } + vterm_set_size(term->vt, height, width); vterm_screen_flush_damage(term->vts); term->pending_resize = true; diff --git a/src/nvim/window.c b/src/nvim/window.c index ef6b53fe2e..302a957d87 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4745,7 +4745,9 @@ void win_new_width(win_T *wp, int width) wp->w_redr_status = TRUE; if (wp->w_buffer->terminal) { - terminal_resize(wp->w_buffer->terminal, wp->w_width, 0); + if (wp->w_height != 0) { + terminal_resize(wp->w_buffer->terminal, wp->w_width, 0); + } redraw_win_later(wp, CLEAR); } } diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua index 4def4dd7f8..ac61abebcb 100644 --- a/test/functional/terminal/mouse_spec.lua +++ b/test/functional/terminal/mouse_spec.lua @@ -110,39 +110,39 @@ describe('terminal mouse', function() before_each(function() feed('<c-\\><c-n>:vsp<cr>') screen:expect([[ - line21 |line21 | - line22 |line22 | - line23 |line23 | - line24 |line24 | - ^rows: 5, cols: 24 |rows: 5, cols: 24 | + line28 |line28 | + line29 |line29 | + line30 |line30 | + rows: 5, cols: 24 |rows: 5, cols: 24 | + {2:^ } |{2: } | ========== ========== | | ]]) feed(':enew | set number<cr>') screen:expect([[ - 1 ^ |line21 | - ~ |line22 | - ~ |line23 | - ~ |line24 | + 1 ^ |line28 | + ~ |line29 | + ~ |line30 | ~ |rows: 5, cols: 24 | + ~ |{2: } | ========== ========== | :enew | set number | ]]) feed('30iline\n<esc>') screen:expect([[ - 27 line |line21 | - 28 line |line22 | - 29 line |line23 | - 30 line |line24 | - 31 ^ |rows: 5, cols: 24 | + 27 line |line28 | + 28 line |line29 | + 29 line |line30 | + 30 line |rows: 5, cols: 24 | + 31 ^ |{2: } | ========== ========== | | ]]) feed('<c-w>li') screen:expect([[ - 27 line |line22 | - 28 line |line23 | - 29 line |line24 | + 27 line |line28 | + 28 line |line29 | + 29 line |line30 | 30 line |rows: 5, cols: 24 | 31 |{1: } | ========== ========== | @@ -152,8 +152,8 @@ describe('terminal mouse', function() thelpers.enable_mouse() thelpers.feed_data('mouse enabled\n') screen:expect([[ - 27 line |line23 | - 28 line |line24 | + 27 line |line29 | + 28 line |line30 | 29 line |rows: 5, cols: 24 | 30 line |mouse enabled | 31 |{1: } | @@ -165,8 +165,8 @@ describe('terminal mouse', function() it('wont lose focus if another window is scrolled', function() feed('<MouseDown><0,0><MouseDown><0,0>') screen:expect([[ - 21 line |line23 | - 22 line |line24 | + 21 line |line29 | + 22 line |line30 | 23 line |rows: 5, cols: 24 | 24 line |mouse enabled | 25 line |{1: } | @@ -175,8 +175,8 @@ describe('terminal mouse', function() ]]) feed('<S-MouseUp><0,0>') screen:expect([[ - 26 line |line23 | - 27 line |line24 | + 26 line |line29 | + 27 line |line30 | 28 line |rows: 5, cols: 24 | 29 line |mouse enabled | 30 line |{1: } | @@ -188,8 +188,8 @@ describe('terminal mouse', function() it('will lose focus if another window is clicked', function() feed('<LeftMouse><5,1>') screen:expect([[ - 27 line |line23 | - 28 l^ine |line24 | + 27 line |line29 | + 28 l^ine |line30 | 29 line |rows: 5, cols: 24 | 30 line |mouse enabled | 31 |{2: } | |