diff options
Diffstat (limited to 'test/functional/terminal')
| -rw-r--r-- | test/functional/terminal/api_spec.lua | 8 | ||||
| -rw-r--r-- | test/functional/terminal/buffer_spec.lua | 158 | ||||
| -rw-r--r-- | test/functional/terminal/channel_spec.lua | 96 | ||||
| -rw-r--r-- | test/functional/terminal/cursor_spec.lua | 71 | ||||
| -rw-r--r-- | test/functional/terminal/edit_spec.lua | 7 | ||||
| -rw-r--r-- | test/functional/terminal/ex_terminal_spec.lua | 59 | ||||
| -rw-r--r-- | test/functional/terminal/helpers.lua | 9 | ||||
| -rw-r--r-- | test/functional/terminal/mouse_spec.lua | 78 | ||||
| -rw-r--r-- | test/functional/terminal/scrollback_spec.lua | 75 | ||||
| -rw-r--r-- | test/functional/terminal/tui_spec.lua | 921 | ||||
| -rw-r--r-- | test/functional/terminal/window_spec.lua | 45 | ||||
| -rw-r--r-- | test/functional/terminal/window_split_tab_spec.lua | 4 |
12 files changed, 1126 insertions, 405 deletions
diff --git a/test/functional/terminal/api_spec.lua b/test/functional/terminal/api_spec.lua index 724791343d..93641fc576 100644 --- a/test/functional/terminal/api_spec.lua +++ b/test/functional/terminal/api_spec.lua @@ -66,10 +66,10 @@ describe('api', function() screen:expect([[ [tui] insert-mode | - [socket 1] this is more t{4: }| - han 25 columns {4: }| - [socket 2] input{1: } {4: }| - {4:~ }| + [socket 1] this is more t | + han 25 columns | + [socket 2] input{1: } | + {4:~ } | {3:-- INSERT --} | {3:-- TERMINAL --} | ]]) diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 9c8b983ff7..6fcd029a5b 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -17,14 +17,14 @@ local sleep = helpers.sleep local funcs = helpers.funcs local is_os = helpers.is_os local skip = helpers.skip +local nvim_prog = helpers.nvim_prog describe(':terminal buffer', function() local screen before_each(function() clear() - feed_command('set modifiable swapfile undolevels=20') - poke_eventloop() + command('set modifiable swapfile undolevels=20') screen = thelpers.screen_setup() end) @@ -197,12 +197,11 @@ describe(':terminal buffer', function() it('handles loss of focus gracefully', function() -- Change the statusline to avoid printing the file name, which varies. - nvim('set_option', 'statusline', '==========') - feed_command('set laststatus=0') + nvim('set_option_value', 'statusline', '==========', {}) -- Save the buffer number of the terminal for later testing. local tbuf = eval('bufnr("%")') - local exitcmd = helpers.is_os('win') + local exitcmd = is_os('win') and "['cmd', '/c', 'exit']" or "['sh', '-c', 'exit']" source([[ @@ -231,8 +230,6 @@ describe(':terminal buffer', function() neq(tbuf, eval('bufnr("%")')) feed_command('quit!') -- Should exit the new window, not the terminal. eq(tbuf, eval('bufnr("%")')) - - feed_command('set laststatus=1') -- Restore laststatus to the default. end) it('term_close() use-after-free #4393', function() @@ -281,6 +278,7 @@ describe(':terminal buffer', function() end) it('requires bang (!) to close a running job #15402', function() + skip(is_os('win'), "Test freezes the CI and makes it time out") eq('Vim(wqall):E948: Job still running', exc_exec('wqall')) for _, cmd in ipairs({ 'bdelete', '%bdelete', 'bwipeout', 'bunload' }) do matches('^Vim%('..cmd:gsub('%%', '')..'%):E89: term://.*tty%-test.* will be killed %(add %! to override%)$', @@ -412,14 +410,6 @@ describe('on_lines does not emit out-of-bounds line indexes when', function() feed_command('bdelete!') eq('', exec_lua([[return _G.cb_error]])) end) - - it('runs TextChangedT event', function() - meths.set_var('called', 0) - command('autocmd TextChangedT * ++once let g:called = 1') - feed_command('terminal') - feed('iaa') - eq(1, meths.get_var('called')) - end) end) it('terminal truncates number of composing characters to 5', function() @@ -429,3 +419,141 @@ it('terminal truncates number of composing characters to 5', function() meths.chan_send(chan, 'a' .. composing:rep(8)) retry(nil, nil, function() eq('a' .. composing:rep(5), meths.get_current_line()) end) end) + +describe('terminal input', function() + before_each(function() + clear() + exec_lua([[ + _G.input_data = '' + vim.api.nvim_open_term(0, { on_input = function(_, _, _, data) + _G.input_data = _G.input_data .. data + end }) + ]]) + feed('i') + poke_eventloop() + end) + + it('<C-Space> is sent as NUL byte', function() + feed('aaa<C-Space>bbb') + eq('aaa\0bbb', exec_lua([[return _G.input_data]])) + end) + + it('unknown special keys are not sent', function() + feed('aaa<Help>bbb') + eq('aaabbb', exec_lua([[return _G.input_data]])) + end) +end) + +describe('terminal input', function() + it('sends various special keys with modifiers', function() + clear() + local screen = thelpers.screen_setup(0, + string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--cmd", "startinsert"]]=], nvim_prog)) + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] 0,1 All}| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]} + for _, key in ipairs({ + '<M-Tab>', '<M-CR>', '<M-Esc>', + '<BS>', '<S-Tab>', '<Insert>', '<Del>', '<PageUp>', '<PageDown>', + '<S-Up>', '<C-Up>', '<Up>', '<S-Down>', '<C-Down>', '<Down>', + '<S-Left>', '<C-Left>', '<Left>', '<S-Right>', '<C-Right>', '<Right>', + '<S-Home>', '<C-Home>', '<Home>', '<S-End>', '<C-End>', '<End>', + '<C-LeftMouse>', '<C-LeftRelease>', '<2-LeftMouse>', '<2-LeftRelease>', + '<S-RightMouse>', '<S-RightRelease>', '<2-RightMouse>', '<2-RightRelease>', + '<M-MiddleMouse>', '<M-MiddleRelease>', '<2-MiddleMouse>', '<2-MiddleRelease>', + '<S-ScrollWheelUp>', '<S-ScrollWheelDown>', '<ScrollWheelUp>', '<ScrollWheelDown>', + '<S-ScrollWheelLeft>', '<S-ScrollWheelRight>', '<ScrollWheelLeft>', '<ScrollWheelRight>', + }) do + feed('<CR><C-V>' .. key) + retry(nil, nil, function() eq(key, meths.get_current_line()) end) + end + end) +end) + +if is_os('win') then + describe(':terminal in Windows', function() + local screen + + before_each(function() + clear() + feed_command('set modifiable swapfile undolevels=20') + poke_eventloop() + local cmd = '["cmd.exe","/K","PROMPT=$g$s"]' + screen = thelpers.screen_setup(nil, cmd) + end) + + it('"put" operator sends data normally', function() + feed('<c-\\><c-n>G') + feed_command('let @a = ":: tty ready"') + feed_command('let @a = @a . "\\n:: appended " . @a . "\\n\\n"') + feed('"ap"ap') + screen:expect([[ + | + > :: tty ready | + > :: appended :: tty ready | + > :: tty ready | + > :: appended :: tty ready | + ^> {2: } | + :let @a = @a . "\n:: appended " . @a . "\n\n" | + ]]) + -- operator count is also taken into consideration + feed('3"ap') + screen:expect([[ + > :: appended :: tty ready | + > :: tty ready | + > :: appended :: tty ready | + > :: tty ready | + > :: appended :: tty ready | + ^> {2: } | + :let @a = @a . "\n:: appended " . @a . "\n\n" | + ]]) + end) + + it('":put" command sends data normally', function() + feed('<c-\\><c-n>G') + feed_command('let @a = ":: tty ready"') + feed_command('let @a = @a . "\\n:: appended " . @a . "\\n\\n"') + feed_command('put a') + screen:expect([[ + | + > :: tty ready | + > :: appended :: tty ready | + > {2: } | + | + ^ | + :put a | + ]]) + -- line argument is only used to move the cursor + feed_command('6put a') + screen:expect([[ + | + > :: tty ready | + > :: appended :: tty ready | + > :: tty ready | + > :: appended :: tty ready | + ^> {2: } | + :6put a | + ]]) + end) + end) +end + +describe('termopen()', function() + before_each(clear) + + it('disallowed when textlocked and in cmdwin buffer', function() + command("autocmd TextYankPost <buffer> ++once call termopen('foo')") + matches("Vim%(call%):E565: Not allowed to change text or change window$", + pcall_err(command, "normal! yy")) + + feed("q:") + eq("Vim:E11: Invalid in command-line window; <CR> executes, CTRL-C quits", + pcall_err(funcs.termopen, "bar")) + end) +end) diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua index 2ca7cdb0a2..8510df5347 100644 --- a/test/functional/terminal/channel_spec.lua +++ b/test/functional/terminal/channel_spec.lua @@ -8,6 +8,10 @@ local pcall_err = helpers.pcall_err local feed = helpers.feed local poke_eventloop = helpers.poke_eventloop local is_os = helpers.is_os +local meths = helpers.meths +local async_meths = helpers.async_meths +local testprg = helpers.testprg +local assert_alive = helpers.assert_alive describe('terminal channel is closed and later released if', function() local screen @@ -24,6 +28,7 @@ describe('terminal channel is closed and later released if', function() -- channel hasn't been released yet eq("Vim(call):Can't send data to closed stream", pcall_err(command, [[bdelete! | call chansend(id, 'test')]])) + feed('<Ignore>') -- add input to separate two RPC requests -- channel has been released after one main loop iteration eq(chans - 1, eval('len(nvim_list_chans())')) end) @@ -40,6 +45,7 @@ describe('terminal channel is closed and later released if', function() feed('i<CR>') -- need to first process input poke_eventloop() + feed('<Ignore>') -- add input to separate two RPC requests -- channel has been released after another main loop iteration eq(chans - 1, eval('len(nvim_list_chans())')) end) @@ -55,6 +61,7 @@ describe('terminal channel is closed and later released if', function() -- channel still hasn't been released yet eq("Vim(call):Can't send data to closed stream", pcall_err(command, [[bdelete | call chansend(id, 'test')]])) + feed('<Ignore>') -- add input to separate two RPC requests -- channel has been released after one main loop iteration eq(chans - 1, eval('len(nvim_list_chans())')) end) @@ -72,6 +79,7 @@ describe('terminal channel is closed and later released if', function() feed('i<CR>') -- need to first process input poke_eventloop() + feed('<Ignore>') -- add input to separate two RPC requests -- channel has been released after another main loop iteration eq(chans - 1, eval('len(nvim_list_chans())')) end) @@ -89,21 +97,105 @@ describe('terminal channel is closed and later released if', function() -- channel still hasn't been released yet eq("Vim(call):Can't send data to closed stream", pcall_err(command, [[bdelete | call chansend(id, 'test')]])) + feed('<Ignore>') -- add input to separate two RPC requests -- channel has been released after one main loop iteration eq(chans - 1, eval('len(nvim_list_chans())')) end) end) it('chansend sends lines to terminal channel in proper order', function() - clear() + clear({args = {'--cmd', 'set laststatus=2'}}) local screen = Screen.new(100, 20) screen:attach() local shells = is_os('win') and {'cmd.exe', 'pwsh.exe -nop', 'powershell.exe -nop'} or {'sh'} for _, sh in ipairs(shells) do - command([[bdelete! | let id = termopen(']] .. sh .. [[')]]) + command([[let id = termopen(']] .. sh .. [[')]]) command([[call chansend(id, ['echo "hello"', 'echo "world"', ''])]]) screen:expect{ any=[[echo "hello".*echo "world"]] } + command('bdelete!') + screen:expect{ + any='%[No Name%]' + } end end) + +describe('no crash when TermOpen autocommand', function() + local screen + + before_each(function() + clear() + meths.set_option_value('shell', testprg('shell-test'), {}) + command('set shellcmdflag=EXE shellredir= shellpipe= shellquote= shellxquote=') + screen = Screen.new(60, 4) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}; + }) + screen:attach() + end) + + it('processes job exit event when using termopen()', function() + command([[autocmd TermOpen * call input('')]]) + async_meths.command('terminal foobar') + screen:expect{grid=[[ + | + {0:~ }| + {0:~ }| + ^ | + ]]} + feed('<CR>') + screen:expect{grid=[[ + ^ready $ foobar | + | + [Process exited 0] | + | + ]]} + feed('i<CR>') + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + | + ]]} + assert_alive() + end) + + it('wipes buffer and processes events when using termopen()', function() + command([[autocmd TermOpen * bwipe! | call input('')]]) + async_meths.command('terminal foobar') + screen:expect{grid=[[ + | + {0:~ }| + {0:~ }| + ^ | + ]]} + feed('<CR>') + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + | + ]]} + assert_alive() + end) + + it('wipes buffer and processes events when using nvim_open_term()', function() + command([[autocmd TermOpen * bwipe! | call input('')]]) + async_meths.open_term(0, {}) + screen:expect{grid=[[ + | + {0:~ }| + {0:~ }| + ^ | + ]]} + feed('<CR>') + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + | + ]]} + assert_alive() + end) +end) diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua index 98ac03211a..8285bcc26e 100644 --- a/test/functional/terminal/cursor_spec.lua +++ b/test/functional/terminal/cursor_spec.lua @@ -6,7 +6,7 @@ local testprg, command = helpers.testprg, helpers.command local nvim_prog = helpers.nvim_prog local eq, eval = helpers.eq, helpers.eval local matches = helpers.matches -local feed_command = helpers.feed_command +local poke_eventloop = helpers.poke_eventloop local hide_cursor = thelpers.hide_cursor local show_cursor = thelpers.show_cursor local is_os = helpers.is_os @@ -153,7 +153,8 @@ describe('cursor with customized highlighting', function() }) screen:attach({rgb=false}) command('call termopen(["'..testprg('tty-test')..'"])') - feed_command('startinsert') + feed('i') + poke_eventloop() end) it('overrides the default highlighting', function() @@ -187,13 +188,16 @@ describe('buffer cursor position is correct in terminal without number column', ..[[", "-u", "NONE", "-i", "NONE", "-E", "--cmd", "let @r = ']]..str..[['", ]] -- <Left> and <Right> don't always work ..[["--cmd", "cnoremap <C-X> <Left>", "--cmd", "cnoremap <C-O> <Right>"]]..']', 70) + -- Also check for real cursor position, as it is used for stuff like input methods + screen._handle_busy_start = function() end + screen._handle_busy_stop = function() end screen:expect([[ | | | | Entering Ex mode. Type "visual" to go to Normal mode. | - :{1: } | + :{1:^ } | {3:-- TERMINAL --} | ]]) end @@ -213,7 +217,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaaaa{1: } | + :aaaaaaaa{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 9}, eval('nvim_win_get_cursor(0)')) @@ -238,7 +242,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaa{1:a}a | + :aaaaaa{1:^a}a | {3:-- TERMINAL --} | ]]) eq({6, 7}, eval('nvim_win_get_cursor(0)')) @@ -263,7 +267,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :a{1:a}aaaaaa | + :a{1:^a}aaaaaa | {3:-- TERMINAL --} | ]]) eq({6, 2}, eval('nvim_win_get_cursor(0)')) @@ -294,7 +298,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :µµµµµµµµ{1: } | + :µµµµµµµµ{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 17}, eval('nvim_win_get_cursor(0)')) @@ -319,7 +323,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :µµµµµµ{1:µ}µ | + :µµµµµµ{1:^µ}µ | {3:-- TERMINAL --} | ]]) eq({6, 13}, eval('nvim_win_get_cursor(0)')) @@ -344,7 +348,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :µ{1:µ}µµµµµµ | + :µ{1:^µ}µµµµµµ | {3:-- TERMINAL --} | ]]) eq({6, 3}, eval('nvim_win_get_cursor(0)')) @@ -377,7 +381,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{1: } | + :µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 33}, eval('nvim_win_get_cursor(0)')) @@ -402,7 +406,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳µ̳µ̳µ̳µ̳µ̳{1:µ̳}µ̳ | + :µ̳µ̳µ̳µ̳µ̳µ̳{1:^µ̳}µ̳ | {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) @@ -427,7 +431,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳{1:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | + :µ̳{1:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | {3:-- TERMINAL --} | ]]) eq({6, 5}, eval('nvim_win_get_cursor(0)')) @@ -446,7 +450,7 @@ describe('buffer cursor position is correct in terminal without number column', end) describe('in a line with double-cell multibyte characters and no trailing spaces,', function() - skip(is_os('win'), "Encoding problem?") + if skip(is_os('win'), "Encoding problem?") then return end before_each(function() setup_ex_register('哦哦哦哦哦哦哦哦') @@ -460,7 +464,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :哦哦哦哦哦哦哦哦{1: } | + :哦哦哦哦哦哦哦哦{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) @@ -485,7 +489,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :哦哦哦哦哦哦{1:哦}哦 | + :哦哦哦哦哦哦{1:^哦}哦 | {3:-- TERMINAL --} | ]]) eq({6, 19}, eval('nvim_win_get_cursor(0)')) @@ -510,7 +514,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :哦{1:哦}哦哦哦哦哦哦 | + :哦{1:^哦}哦哦哦哦哦哦 | {3:-- TERMINAL --} | ]]) eq({6, 4}, eval('nvim_win_get_cursor(0)')) @@ -537,7 +541,7 @@ describe('buffer cursor position is correct in terminal without number column', | | Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaaaa {1: } | + :aaaaaaaa {1:^ } | {3:-- TERMINAL --} | ]]) matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()')) @@ -564,13 +568,16 @@ describe('buffer cursor position is correct in terminal with number column', fun ..[[", "-u", "NONE", "-i", "NONE", "-E", "--cmd", "let @r = ']]..str..[['", ]] -- <Left> and <Right> don't always work ..[["--cmd", "cnoremap <C-X> <Left>", "--cmd", "cnoremap <C-O> <Right>"]]..']', 70) + -- Also check for real cursor position, as it is used for stuff like input methods + screen._handle_busy_start = function() end + screen._handle_busy_stop = function() end screen:expect([[ {7: 1 } | {7: 2 } | {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:{1: } | + {7: 6 }:{1:^ } | {3:-- TERMINAL --} | ]]) end @@ -593,7 +600,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaaaa{1: } | + {7: 6 }:aaaaaaaa{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 9}, eval('nvim_win_get_cursor(0)')) @@ -618,7 +625,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaa{1:a}a | + {7: 6 }:aaaaaa{1:^a}a | {3:-- TERMINAL --} | ]]) eq({6, 7}, eval('nvim_win_get_cursor(0)')) @@ -643,7 +650,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:a{1:a}aaaaaa | + {7: 6 }:a{1:^a}aaaaaa | {3:-- TERMINAL --} | ]]) eq({6, 2}, eval('nvim_win_get_cursor(0)')) @@ -674,7 +681,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µµµµµµµµ{1: } | + {7: 6 }:µµµµµµµµ{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 17}, eval('nvim_win_get_cursor(0)')) @@ -699,7 +706,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µµµµµµ{1:µ}µ | + {7: 6 }:µµµµµµ{1:^µ}µ | {3:-- TERMINAL --} | ]]) eq({6, 13}, eval('nvim_win_get_cursor(0)')) @@ -724,7 +731,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µ{1:µ}µµµµµµ | + {7: 6 }:µ{1:^µ}µµµµµµ | {3:-- TERMINAL --} | ]]) eq({6, 3}, eval('nvim_win_get_cursor(0)')) @@ -757,7 +764,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{1: } | + {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 33}, eval('nvim_win_get_cursor(0)')) @@ -782,7 +789,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳{1:µ̳}µ̳ | + {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳{1:^µ̳}µ̳ | {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) @@ -807,7 +814,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µ̳{1:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | + {7: 6 }:µ̳{1:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | {3:-- TERMINAL --} | ]]) eq({6, 5}, eval('nvim_win_get_cursor(0)')) @@ -826,7 +833,7 @@ describe('buffer cursor position is correct in terminal with number column', fun end) describe('in a line with double-cell multibyte characters and no trailing spaces,', function() - skip(is_os('win'), "Encoding problem?") + if skip(is_os('win'), "Encoding problem?") then return end before_each(function() setup_ex_register('哦哦哦哦哦哦哦哦') @@ -840,7 +847,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:哦哦哦哦哦哦哦哦{1: } | + {7: 6 }:哦哦哦哦哦哦哦哦{1:^ } | {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) @@ -865,7 +872,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:哦哦哦哦哦哦{1:哦}哦 | + {7: 6 }:哦哦哦哦哦哦{1:^哦}哦 | {3:-- TERMINAL --} | ]]) eq({6, 19}, eval('nvim_win_get_cursor(0)')) @@ -890,7 +897,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:哦{1:哦}哦哦哦哦哦哦 | + {7: 6 }:哦{1:^哦}哦哦哦哦哦哦 | {3:-- TERMINAL --} | ]]) eq({6, 4}, eval('nvim_win_get_cursor(0)')) @@ -917,7 +924,7 @@ describe('buffer cursor position is correct in terminal with number column', fun {7: 3 } | {7: 4 } | {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaaaa {1: } | + {7: 6 }:aaaaaaaa {1:^ } | {3:-- TERMINAL --} | ]]) matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()')) diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index 80287bb3d0..29 |