aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-09-02 11:35:48 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-09-05 15:01:06 +0200
commit6c53c3ee55991d9b1ea61a8dc443038b478ca92a (patch)
treec3d752866b1c875db2d2329468d1cb4182f28e48
parentd47b538f39e3e9700a18f1cd72e561086f62d7f3 (diff)
downloadrneovim-6c53c3ee55991d9b1ea61a8dc443038b478ca92a.tar.gz
rneovim-6c53c3ee55991d9b1ea61a8dc443038b478ca92a.tar.bz2
rneovim-6c53c3ee55991d9b1ea61a8dc443038b478ca92a.zip
eventloop: restore redraw in cmdline K_EVENT handler
Restores behavior from commit: 02e86ef04cc1
-rw-r--r--src/nvim/ex_getln.c3
-rw-r--r--test/functional/terminal/tui_spec.lua34
2 files changed, 33 insertions, 4 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 9bfa9e22df..fd7ad7a4b5 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -441,7 +441,8 @@ static int command_line_execute(VimState *state, int key)
if (s->c == K_EVENT) {
multiqueue_process_events(main_loop.events);
- return command_line_not_changed(s);
+ redrawcmdline();
+ return 1;
}
if (KeyTyped) {
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 2621568a71..00a47e1ed0 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -260,8 +260,8 @@ describe('tui FocusGained/FocusLost', function()
end)
end)
- -- per 5cc87d4dabd02167117be7a978b5c8faaa975419 we decided to ignore :echo
- -- invoked from timers/events while the user is in cmdline-mode.
+ -- During cmdline-mode we ignore :echo invoked by timers/events.
+ -- See commit: 5cc87d4dabd02167117be7a978b5c8faaa975419.
it('in cmdline-mode does NOT :echo', function()
feed_data(':')
feed_data('\027[I')
@@ -286,7 +286,35 @@ describe('tui FocusGained/FocusLost', function()
]])
end)
- it('can handle focus events in terminal mode', function()
+ it('in cmdline-mode', function()
+ -- Set up autocmds that modify the buffer, instead of just calling :echo.
+ -- This is how we can test handling of focus gained/lost during cmdline-mode.
+ -- See commit: 5cc87d4dabd02167117be7a978b5c8faaa975419.
+ feed_data(":autocmd!\n")
+ feed_data(":autocmd FocusLost * call append(line('$'), 'lost')\n")
+ feed_data(":autocmd FocusGained * call append(line('$'), 'gained')\n")
+ -- Enter cmdline-mode.
+ feed_data(':')
+ screen:sleep(10)
+ -- Send focus lost/gained termcodes.
+ feed_data('\027[O')
+ feed_data('\027[I')
+ screen:sleep(10)
+ -- Exit cmdline-mode. Redraws from timers/events are blocked during
+ -- cmdline-mode, so the buffer won't be updated until we exit cmdline-mode.
+ feed_data('\n')
+ screen:expect([[
+ {1: } |
+ lost |
+ gained |
+ {4:~ }|
+ {5:[No Name] [+] }|
+ : |
+ {3:-- TERMINAL --} |
+ ]])
+ end)
+
+ it('in terminal-mode', function()
feed_data(':set shell='..nvim_dir..'/shell-test\n')
feed_data(':set noshowmode laststatus=0\n')