diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-04-21 04:11:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 04:11:45 +0200 |
commit | fe5f38d8bd54248e4ea327a7f6ca52646799f3a4 (patch) | |
tree | f4d01757f617e06c9fb0682ab42a28cc8c801f2f | |
parent | be2a3ddd58f79e87c2bd87a3a2cd1b42176895c9 (diff) | |
download | rneovim-fe5f38d8bd54248e4ea327a7f6ca52646799f3a4.tar.gz rneovim-fe5f38d8bd54248e4ea327a7f6ca52646799f3a4.tar.bz2 rneovim-fe5f38d8bd54248e4ea327a7f6ca52646799f3a4.zip |
terminal: do not call redraw_buf_later() (#8306)
fixes #8290
-rw-r--r-- | src/nvim/terminal.c | 1 | ||||
-rw-r--r-- | test/functional/ui/searchhl_spec.lua | 37 |
2 files changed, 37 insertions, 1 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index cec2e2913f..5a05847197 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1097,7 +1097,6 @@ static void refresh_terminal(Terminal *term) refresh_size(term, buf); refresh_scrollback(term, buf); refresh_screen(term, buf); - redraw_buf_later(buf, NOT_VALID); }); long ml_added = buf->b_ml.ml_line_count - ml_before; adjust_topline(term, buf, ml_added); diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua index 9f273e8dc9..f241a9fc44 100644 --- a/test/functional/ui/searchhl_spec.lua +++ b/test/functional/ui/searchhl_spec.lua @@ -4,6 +4,7 @@ local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local feed_command = helpers.feed_command local eq = helpers.eq local eval = helpers.eval +local iswin = helpers.iswin describe('search highlighting', function() local screen @@ -91,6 +92,42 @@ describe('search highlighting', function() ]]) end) + it('#x is preserved during :terminal activity', function() + -- Because this test verifies a _lack_ of activity after screen:sleep(), we + -- must wait the full timeout. So make it reasonable. + screen.timeout = 1000 + + if iswin() then + feed([[:terminal for /L \%I in (1,1,5000) do @(echo xxx & echo xxx & echo xxx)<cr>]]) + else + feed([[:terminal for i in $(seq 1 5000); do printf 'xxx\nxxx\nxxx\n'; sleep 0.1; done<cr>]]) + end + + feed([[<C-\><C-N>gg]]) + feed(':file term<CR>') + feed(':vnew<CR>') + insert([[ + foo bar baz + bar baz foo + bar foo baz + ]]) + feed('/foo') + screen:expect([[ + {3:foo} bar baz {3:│}xxx | + bar baz {2:foo} {3:│}xxx | + bar {2:foo} baz {3:│}xxx | + {3:│}xxx | + {1:~ }{3:│}xxx | + {5:[No Name] [+] }{3:term }| + /foo^ | + ]], { [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {background = Screen.colors.Yellow}, + [3] = {reverse = true}, + [4] = {foreground = Screen.colors.Red}, + [5] = {bold = true, reverse = true}, + }) + end) + it('works with incsearch', function() feed_command('set hlsearch') feed_command('set incsearch') |