diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-09-02 11:35:48 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-09-05 15:01:06 +0200 |
commit | 6c53c3ee55991d9b1ea61a8dc443038b478ca92a (patch) | |
tree | c3d752866b1c875db2d2329468d1cb4182f28e48 /test | |
parent | d47b538f39e3e9700a18f1cd72e561086f62d7f3 (diff) | |
download | rneovim-6c53c3ee55991d9b1ea61a8dc443038b478ca92a.tar.gz rneovim-6c53c3ee55991d9b1ea61a8dc443038b478ca92a.tar.bz2 rneovim-6c53c3ee55991d9b1ea61a8dc443038b478ca92a.zip |
eventloop: restore redraw in cmdline K_EVENT handler
Restores behavior from commit: 02e86ef04cc1
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 34 |
1 files changed, 31 insertions, 3 deletions
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') |