diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/highlight_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/autocmd/focus_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/core/main_spec.lua | 19 | ||||
-rw-r--r-- | test/functional/helpers.lua | 5 | ||||
-rw-r--r-- | test/functional/terminal/api_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/terminal/cursor_spec.lua | 661 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 67 | ||||
-rw-r--r-- | test/functional/ui/cursor_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/embed_spec.lua | 36 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 10 | ||||
-rw-r--r-- | test/functional/ui/hlstate_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/output_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/quickfix_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/ui/screen_basic_spec.lua | 26 | ||||
-rw-r--r-- | test/old/testdir/setup.vim | 3 | ||||
-rw-r--r-- | test/old/testdir/test_highlight.vim | 1 | ||||
-rw-r--r-- | test/old/testdir/test_syntax.vim | 2 |
18 files changed, 464 insertions, 394 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index 7d7d07e30e..c9edbf825d 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -561,7 +561,7 @@ describe('API: get highlight', function() end) it('can correctly detect links', function() - command('hi String guifg=#a6e3a1') + command('hi String guifg=#a6e3a1 ctermfg=NONE') command('hi link @string string') command('hi link @string.cpp @string') eq({ fg = 10937249 }, meths.get_hl(0, { name = 'String' })) diff --git a/test/functional/autocmd/focus_spec.lua b/test/functional/autocmd/focus_spec.lua index 33e4d88c7b..c72842f14b 100644 --- a/test/functional/autocmd/focus_spec.lua +++ b/test/functional/autocmd/focus_spec.lua @@ -14,8 +14,10 @@ describe('autoread TUI FocusGained/FocusLost', function() before_each(function() clear() - screen = thelpers.screen_setup(0, '["'..nvim_prog - ..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]') + screen = thelpers.screen_setup( + 0, + '["'..nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "set noswapfile noshowcmd noruler"]' + ) end) teardown(function() diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua index 19c7a93730..d705d56575 100644 --- a/test/functional/core/main_spec.lua +++ b/test/functional/core/main_spec.lua @@ -70,17 +70,18 @@ describe('command-line option', function() -- data from the terminal #18181 funcs.termopen(string.format([[echo "" | %s]], table.concat(args, " "))) screen:expect([[ - ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {2:[No Name] 0,0-1 All}| - | + {1:^ }| + {2:~ }| + {2:~ }| + {2:~ }| + {2:~ }| + {3:[No Name] 0,0-1 All}| + {1: }| | ]], { - [1] = {foreground = tonumber('0x4040ff'), fg_indexed=true}, - [2] = {bold = true, reverse = true} + [1] = {bg_indexed = true, foreground = Screen.colors.Grey91, background = tonumber('0x161616'), fg_indexed = true}, + [2] = {bg_indexed = true, foreground = Screen.colors.Gray30, background = tonumber('0x161616'), fg_indexed = true}, + [3] = {bg_indexed = true, foreground = tonumber('0xd2d2d2'), background = Screen.colors.Black , fg_indexed = true}, }) feed('i:cq<CR>') screen:expect([[ diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index dcaaa664b9..2bff1d16f8 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -38,6 +38,11 @@ module.nvim_argv = { '--cmd', module.nvim_set, '--cmd', 'mapclear', '--cmd', 'mapclear!', + -- Make screentest work after changing to the new default color scheme + -- Source 'vim' color scheme without side effects + -- TODO: rewrite tests + '--cmd', 'lua f=io.open("runtime/colors/vim.vim", "r"); l=f:read("*a"); f:close(); vim.api.nvim_exec2(l, {})', + '--cmd', 'unlet g:colors_name', '--embed'} -- Directory containing nvim. diff --git a/test/functional/terminal/api_spec.lua b/test/functional/terminal/api_spec.lua index 93641fc576..c278b2ad0e 100644 --- a/test/functional/terminal/api_spec.lua +++ b/test/functional/terminal/api_spec.lua @@ -12,7 +12,7 @@ describe('api', function() helpers.clear() os.remove(socket_name) screen = child_session.screen_setup(0, '["'..helpers.nvim_prog - ..'", "-u", "NONE", "-i", "NONE", "--cmd", "'..helpers.nvim_set..'"]') + ..'", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "'..helpers.nvim_set..'"]') end) after_each(function() os.remove(socket_name) diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 6d8c214d87..423e7bdf21 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -446,8 +446,10 @@ 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)) + local screen = thelpers.screen_setup( + 0, + string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--cmd", 'colorscheme vim', "--cmd", "startinsert"]]=], nvim_prog) + ) screen:expect{grid=[[ {1: } | {4:~ }| diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua index 8285bcc26e..95081b7189 100644 --- a/test/functional/terminal/cursor_spec.lua +++ b/test/functional/terminal/cursor_spec.lua @@ -188,16 +188,22 @@ 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) + screen:set_default_attr_ids({ + [1] = {foreground = 253, background = 11}; + [3] = {bold = true}, + [16] = {background = 234, foreground = 253}; + [17] = {reverse = true, background = 234, foreground = 253}; + }) -- 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:^ } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) end @@ -212,23 +218,23 @@ describe('buffer cursor position is correct in terminal without number column', it('at the end', function() feed('<C-R>r') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaaaa{1:^ } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::aaaaaaaa}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 9}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaaa^a{2: } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::aaaaaaa^a}{1: }{16: }| | ]]) eq({6, 8}, eval('nvim_win_get_cursor(0)')) @@ -237,23 +243,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the end', function() feed('<C-R>r<C-X><C-X>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaa{1:^a}a | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::aaaaaa}{17:^a}{16:a }| {3:-- TERMINAL --} | ]]) eq({6, 7}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaa^a{2:a}a | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::aaaaa^a}{1:a}{16:a }| | ]]) eq({6, 6}, eval('nvim_win_get_cursor(0)')) @@ -262,23 +268,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the start', function() feed('<C-R>r<C-B><C-O>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :a{1:^a}aaaaaa | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::a}{17:^a}{16:aaaaaa }| {3:-- TERMINAL --} | ]]) eq({6, 2}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :^a{2:a}aaaaaa | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::^a}{1:a}{16:aaaaaa }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -293,23 +299,23 @@ describe('buffer cursor position is correct in terminal without number column', it('at the end', function() feed('<C-R>r') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µµµµµµµµ{1:^ } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µµµµµµµµ}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 17}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µµµµµµµ^µ{2: } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µµµµµµµ^µ}{1: }{16: }| | ]]) eq({6, 15}, eval('nvim_win_get_cursor(0)')) @@ -318,23 +324,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the end', function() feed('<C-R>r<C-X><C-X>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µµµµµµ{1:^µ}µ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µµµµµµ}{17:^µ}{16:µ }| {3:-- TERMINAL --} | ]]) eq({6, 13}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µµµµµ^µ{2:µ}µ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µµµµµ^µ}{1:µ}{16:µ }| | ]]) eq({6, 11}, eval('nvim_win_get_cursor(0)')) @@ -343,23 +349,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the start', function() feed('<C-R>r<C-B><C-O>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µ{1:^µ}µµµµµµ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µ}{17:^µ}{16:µµµµµµ }| {3:-- TERMINAL --} | ]]) eq({6, 3}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :^µ{2:µ}µµµµµµ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::^µ}{1:µ}{16:µµµµµµ }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -376,23 +382,23 @@ describe('buffer cursor position is correct in terminal without number column', it('at the end', function() feed('<C-R>r') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳{1:^ } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 33}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{2: } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳}{1: }{16: }| | ]]) eq({6, 29}, eval('nvim_win_get_cursor(0)')) @@ -401,23 +407,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the end', function() feed('<C-R>r<C-X><C-X>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳µ̳µ̳µ̳µ̳µ̳{1:^µ̳}µ̳ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µ̳µ̳µ̳µ̳µ̳µ̳}{17:^µ̳}{16:µ̳ }| {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳µ̳µ̳µ̳µ̳^µ̳{2:µ̳}µ̳ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µ̳µ̳µ̳µ̳µ̳^µ̳}{1:µ̳}{16:µ̳ }| | ]]) eq({6, 21}, eval('nvim_win_get_cursor(0)')) @@ -426,23 +432,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the start', function() feed('<C-R>r<C-B><C-O>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :µ̳{1:^µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::µ̳}{17:^µ̳}{16:µ̳µ̳µ̳µ̳µ̳µ̳ }| {3:-- TERMINAL --} | ]]) eq({6, 5}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :^µ̳{2:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::^µ̳}{1:µ̳}{16:µ̳µ̳µ̳µ̳µ̳µ̳ }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -459,23 +465,23 @@ describe('buffer cursor position is correct in terminal without number column', it('at the end', function() feed('<C-R>r') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :哦哦哦哦哦哦哦哦{1:^ } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::哦哦哦哦哦哦哦哦}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :哦哦哦哦哦哦哦^哦{2: } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::哦哦哦哦哦哦哦^哦}{1: }{16: }| | ]]) eq({6, 22}, eval('nvim_win_get_cursor(0)')) @@ -484,23 +490,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the end', function() feed('<C-R>r<C-X><C-X>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :哦哦哦哦哦哦{1:^哦}哦 | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::哦哦哦哦哦哦}{17:^哦}{16:哦 }| {3:-- TERMINAL --} | ]]) eq({6, 19}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :哦哦哦哦哦^哦{2:哦}哦 | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::哦哦哦哦哦^哦}{1:哦}{16:哦 }| | ]]) eq({6, 16}, eval('nvim_win_get_cursor(0)')) @@ -509,23 +515,23 @@ describe('buffer cursor position is correct in terminal without number column', it('near the start', function() feed('<C-R>r<C-B><C-O>') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :哦{1:^哦}哦哦哦哦哦哦 | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::哦}{17:^哦}{16:哦哦哦哦哦哦 }| {3:-- TERMINAL --} | ]]) eq({6, 4}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :^哦{2:哦}哦哦哦哦哦哦 | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::^哦}{1:哦}{16:哦哦哦哦哦哦 }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -536,24 +542,24 @@ describe('buffer cursor position is correct in terminal without number column', setup_ex_register('aaaaaaaa ') feed('<C-R>r') screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaaaa {1:^ } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::aaaaaaaa }{17:^ }{16: }| {3:-- TERMINAL --} | ]]) matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()')) eq({6, 13}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - | - | - | - | - Entering Ex mode. Type "visual" to go to Normal mode. | - :aaaaaaaa ^ {2: } | + {16: }| + {16: }| + {16: }| + {16: }| + {16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {16::aaaaaaaa ^ }{1: }{16: }| | ]]) eq({6, 12}, eval('nvim_win_get_cursor(0)')) @@ -568,16 +574,23 @@ 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) + screen:set_default_attr_ids({ + [1] = {foreground = 253, background = 11}; + [3] = {bold = true}, + [7] = {foreground = 130}; + [16] = {background = 234, foreground = 253}; + [17] = {reverse = true, background = 234, foreground = 253}; + }) -- 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) end @@ -595,23 +608,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('at the end', function() feed('<C-R>r') screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaaaa{1:^ } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::aaaaaaaa}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 9}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaaa^a{2: } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::aaaaaaa^a}{1: }{16: }| | ]]) eq({6, 8}, eval('nvim_win_get_cursor(0)')) @@ -620,23 +633,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the end', function() feed('<C-R>r<C-X><C-X>') screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaa{1:^a}a | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::aaaaaa}{17:^a}{16:a }| {3:-- TERMINAL --} | ]]) eq({6, 7}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaa^a{2:a}a | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::aaaaa^a}{1:a}{16:a }| | ]]) eq({6, 6}, eval('nvim_win_get_cursor(0)')) @@ -645,23 +658,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the start', function() feed('<C-R>r<C-B><C-O>') screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:a{1:^a}aaaaaa | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::a}{17:^a}{16:aaaaaa }| {3:-- TERMINAL --} | ]]) eq({6, 2}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:^a{2:a}aaaaaa | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::^a}{1:a}{16:aaaaaa }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -676,23 +689,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('at the end', function() feed('<C-R>r') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µµµµµµµµ}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 17}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µµµµµµµ^µ{2: } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µµµµµµµ^µ}{1: }{16: }| | ]]) eq({6, 15}, eval('nvim_win_get_cursor(0)')) @@ -701,23 +714,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the end', function() feed('<C-R>r<C-X><C-X>') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µµµµµµ}{17:^µ}{16:µ }| {3:-- TERMINAL --} | ]]) eq({6, 13}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µµµµµ^µ{2:µ}µ | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µµµµµ^µ}{1:µ}{16:µ }| | ]]) eq({6, 11}, eval('nvim_win_get_cursor(0)')) @@ -726,23 +739,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the start', function() feed('<C-R>r<C-B><C-O>') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µ}{17:^µ}{16:µµµµµµ }| {3:-- TERMINAL --} | ]]) eq({6, 3}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:^µ{2:µ}µµµµµµ | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::^µ}{1:µ}{16:µµµµµµ }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -759,23 +772,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('at the end', function() feed('<C-R>r') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µ̳µ̳µ̳µ̳µ̳µ̳µ̳µ̳}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 33}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳{2: } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µ̳µ̳µ̳µ̳µ̳µ̳µ̳^µ̳}{1: }{16: }| | ]]) eq({6, 29}, eval('nvim_win_get_cursor(0)')) @@ -784,23 +797,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the end', function() feed('<C-R>r<C-X><C-X>') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µ̳µ̳µ̳µ̳µ̳µ̳}{17:^µ̳}{16:µ̳ }| {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:µ̳µ̳µ̳µ̳µ̳^µ̳{2:µ̳}µ̳ | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µ̳µ̳µ̳µ̳µ̳^µ̳}{1:µ̳}{16:µ̳ }| | ]]) eq({6, 21}, eval('nvim_win_get_cursor(0)')) @@ -809,23 +822,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the start', function() feed('<C-R>r<C-B><C-O>') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::µ̳}{17:^µ̳}{16:µ̳µ̳µ̳µ̳µ̳µ̳ }| {3:-- TERMINAL --} | ]]) eq({6, 5}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:^µ̳{2:µ̳}µ̳µ̳µ̳µ̳µ̳µ̳ | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::^µ̳}{1:µ̳}{16:µ̳µ̳µ̳µ̳µ̳µ̳ }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -842,23 +855,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('at the end', function() feed('<C-R>r') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::哦哦哦哦哦哦哦哦}{17:^ }{16: }| {3:-- TERMINAL --} | ]]) eq({6, 25}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:哦哦哦哦哦哦哦^哦{2: } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::哦哦哦哦哦哦哦^哦}{1: }{16: }| | ]]) eq({6, 22}, eval('nvim_win_get_cursor(0)')) @@ -867,23 +880,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the end', function() feed('<C-R>r<C-X><C-X>') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::哦哦哦哦哦哦}{17:^哦}{16:哦 }| {3:-- TERMINAL --} | ]]) eq({6, 19}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:哦哦哦哦哦^哦{2:哦}哦 | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::哦哦哦哦哦^哦}{1:哦}{16:哦 }| | ]]) eq({6, 16}, eval('nvim_win_get_cursor(0)')) @@ -892,23 +905,23 @@ describe('buffer cursor position is correct in terminal with number column', fun it('near the start', function() feed('<C-R>r<C-B><C-O>') 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: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::哦}{17:^哦}{16:哦哦哦哦哦哦 }| {3:-- TERMINAL --} | ]]) eq({6, 4}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:^哦{2:哦}哦哦哦哦哦哦 | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::^哦}{1:哦}{16:哦哦哦哦哦哦 }| | ]]) eq({6, 1}, eval('nvim_win_get_cursor(0)')) @@ -919,24 +932,24 @@ describe('buffer cursor position is correct in terminal with number column', fun setup_ex_register('aaaaaaaa ') feed('<C-R>r') screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaaaa {1:^ } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::aaaaaaaa }{17:^ }{16: }| {3:-- TERMINAL --} | ]]) matches('^:aaaaaaaa [ ]*$', eval('nvim_get_current_line()')) eq({6, 13}, eval('nvim_win_get_cursor(0)')) feed([[<C-\><C-N>]]) screen:expect([[ - {7: 1 } | - {7: 2 } | - {7: 3 } | - {7: 4 } | - {7: 5 }Entering Ex mode. Type "visual" to go to Normal mode. | - {7: 6 }:aaaaaaaa ^ {2: } | + {7: 1 }{16: }| + {7: 2 }{16: }| + {7: 3 }{16: }| + {7: 4 }{16: }| + {7: 5 }{16:Entering Ex mode. Type "visual" to go to Normal mode. }| + {7: 6 }{16::aaaaaaaa ^ }{1: }{16: }| | ]]) eq({6, 12}, eval('nvim_win_get_cursor(0)')) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 96ae0c4662..e0216a22a7 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -40,8 +40,12 @@ describe('TUI', function() clear() local child_server = new_pipename() screen = thelpers.screen_setup(0, - string.format([=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark"]]=], - nvim_prog, child_server, nvim_set)) + string.format( + [=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark", "--cmd", "colorscheme vim"]]=], + nvim_prog, + child_server, + nvim_set + )) screen:expect([[ {1: } | {4:~ }| @@ -1826,7 +1830,7 @@ describe('TUI', function() }) screen:attach() exec([[ - call termopen([v:progpath, '--clean', '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile']) + call termopen([v:progpath, '--clean', '--cmd', 'colorscheme vim', '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile']) sleep 500m vs new ]]) @@ -1852,7 +1856,7 @@ describe('TUI', function() write_file(script_file, [=[ local ffi = require('ffi') ffi.cdef([[int execl(const char *, const char *, ...);]]) - ffi.C.execl(vim.v.progpath, 'Xargv0nvim', '--clean') + ffi.C.execl(vim.v.progpath, 'Xargv0nvim', '--clean', '--cmd', 'colorscheme vim') ]=]) finally(function() os.remove(script_file) @@ -1870,12 +1874,12 @@ describe('TUI', function() ]]} feed_data(':put =v:argv + [v:progname]\n') screen:expect{grid=[[ - Xargv0nvim | - --embed | --clean | + --cmd | + colorscheme vim | {1:X}argv0nvim | - {5:[No Name] [+] 5,1 Bot}| - 4 more lines | + {5:[No Name] [+] 7,1 Bot}| + 6 more lines | {3:-- TERMINAL --} | ]]} end) @@ -1899,8 +1903,11 @@ describe('TUI', function() end) it('<C-h> #10134', function() - local screen = thelpers.screen_setup(0, '["'..nvim_prog - ..[[", "-u", "NONE", "-i", "NONE", "--cmd", "set noruler", "--cmd", ':nnoremap <C-h> :echomsg "\<C-h\>"<CR>']]..']') + local screen = thelpers.screen_setup( + 0, + '["'..nvim_prog..[[", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", ]] + ..[["--cmd", "set noruler", "--cmd", ':nnoremap <C-h> :echomsg "\<C-h\>"<CR>']]..']' + ) screen:expect{grid=[[ {1: } | {4:~ }| @@ -1924,8 +1931,12 @@ describe('TUI', function() end) it('draws line with many trailing spaces correctly #24955', function() - local screen = thelpers.screen_setup(0, '["'..nvim_prog..[[", "-u", "NONE", "-i", "NONE"]] - ..[[, "--cmd", "call setline(1, ['1st line' .. repeat(' ', 153), '2nd line'])"]]..']', 80) + local screen = thelpers.screen_setup( + 0, + '["'..nvim_prog..[[", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim"]] + ..[[, "--cmd", "call setline(1, ['1st line' .. repeat(' ', 153), '2nd line'])"]]..']', + 80 + ) screen:expect{grid=[[ {1:1}st line | | @@ -1953,6 +1964,7 @@ describe('TUI UIEnter/UILeave', function() clear() local screen = thelpers.screen_setup(0, '["'..nvim_prog..'", "-u", "NONE", "-i", "NONE"' + ..[[, "--cmd", "colorscheme vim"]] ..[[, "--cmd", "set noswapfile noshowcmd noruler"]] ..[[, "--cmd", "let g:evs = []"]] ..[[, "--cmd", "autocmd UIEnter * :call add(g:evs, 'UIEnter')"]] @@ -1991,7 +2003,8 @@ describe('TUI FocusGained/FocusLost', function() local child_server = new_pipename() screen = thelpers.screen_setup(0, string.format( - [=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]]=], + '["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", ' + ..'"--cmd", "set noswapfile noshowcmd noruler"]', nvim_prog, child_server)) screen:expect([[ {1: } | @@ -2198,14 +2211,16 @@ describe("TUI 't_Co' (terminal colors)", function() -- This is ugly because :term/termopen() forces TERM=xterm-256color. -- TODO: Revisit this after jobstart/termopen accept `env` dict. screen = thelpers.screen_setup(0, string.format( - [=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "%s"']]=], + [=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "colorscheme vim" --cmd "%s"']]=], term or "", (colorterm ~= nil and "COLORTERM="..colorterm or ""), nvim_prog, nvim_set)) local tline - if maxcolors == 8 or maxcolors == 16 then + if maxcolors == 8 then + tline = "{9:~ }" + elseif maxcolors == 16 then tline = "~ " else tline = "{4:~ }" @@ -2528,7 +2543,7 @@ describe("TUI", function() -- This is ugly because :term/termopen() forces TERM=xterm-256color. -- TODO: Revisit this after jobstart/termopen accept `env` dict. local cmd = string.format( - [=[['sh', '-c', 'LANG=C %s -u NONE -i NONE %s --cmd "%s"']]=], + [=[['sh', '-c', 'LANG=C %s -u NONE -i NONE %s --cmd "colorscheme vim" --cmd "%s"']]=], nvim_prog, extra_args or "", nvim_set) @@ -2591,7 +2606,7 @@ describe('TUI bg color', function() local function setup_bg_test() clear() screen = thelpers.screen_setup(0, '["'..nvim_prog - ..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile", ' + ..'", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "set noswapfile", ' ..'"-c", "autocmd OptionSet background echo \\"did OptionSet, yay!\\""]') end @@ -2712,8 +2727,13 @@ describe("TUI as a client", function() set_session(server_super) local server_pipe = new_pipename() local screen_server = thelpers.screen_setup(0, - string.format([=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark"]]=], - nvim_prog, server_pipe, nvim_set)) + string.format( + '["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", ' + ..'"--cmd", "%s laststatus=2 background=dark"]', + nvim_prog, + server_pipe, + nvim_set + )) feed_data("iHello, World") screen_server:expect{grid=[[ @@ -2839,8 +2859,13 @@ describe("TUI as a client", function() set_session(server_super) local server_pipe = new_pipename() local screen_server = thelpers.screen_setup(0, - string.format([=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark"]]=], - nvim_prog, server_pipe, nvim_set)) + string.format( + '["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", ' + ..'"--cmd", "%s laststatus=2 background=dark"]', + nvim_prog, + server_pipe, + nvim_set + )) screen_server:expect{grid=[[ {1: } | {4:~ }| diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index 05057ca080..7bec5eaac6 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -215,7 +215,7 @@ describe('ui/cursor', function() m.hl_id = 64 m.attr = {background = Screen.colors.DarkGray} end - if m.id_lm then m.id_lm = 67 end + if m.id_lm then m.id_lm = 69 end end -- Assert the new expectation. diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua index 9729f65355..3bc3af9853 100644 --- a/test/functional/ui/embed_spec.lua +++ b/test/functional/ui/embed_spec.lua @@ -26,6 +26,12 @@ local function test_embed(ext_linegrid) [3] = {bold = true, foreground = Screen.colors.Blue1}, [4] = {bold = true, foreground = Screen.colors.Green}, [5] = {bold = true, reverse = true}, + [6] = {foreground = Screen.colors.NvimDarkGrey3, background = Screen.colors.NvimLightGrey1}; + [7] = {foreground = Screen.colors.NvimDarkRed}; + [8] = {foreground = Screen.colors.NvimDarkCyan}; + [9] = {foreground = Screen.colors.NvimLightGrey3, background = Screen.colors.NvimDarkGrey1}; + [10] = {foreground = Screen.colors.NvimLightRed}; + [11] = {foreground = Screen.colors.NvimLightCyan}; }) end @@ -36,10 +42,10 @@ local function test_embed(ext_linegrid) | | | - | - Error detected while processing pre-vimrc command line: | - E121: Undefined variable: invalid | - Press ENTER or type command to continue^ | + {6: }| + {7:Error detected while processing pre-vimrc command line:} | + {7:E121: Undefined variable: invalid} | + {8:Press ENTER or type command to continue}^ | ]]) feed('<cr>') @@ -64,11 +70,11 @@ local function test_embed(ext_linegrid) | | | - {5: }| - Error detected while processing pre-vimrc command line: | - foo | - {1:bar} | - {4:Press ENTER or type command to continue}^ | + {9: }| + {7:Error detected while processing pre-vimrc command line:} | + {7:foo} | + {10:bar} | + {11:Press ENTER or type command to continue}^ | ]]) end) @@ -78,11 +84,11 @@ local function test_embed(ext_linegrid) | | | - | - Error detected while processing pre-vimrc command line: | - foo | - bar | - Press ENTER or type command to continue^ | + {6: }| + {7:Error detected while processing pre-vimrc command line:} | + {7:foo} | + {7:bar} | + {8:Press ENTER or type command to continue}^ | ]], condition=function() eq(Screen.colors.Green, screen.default_colors.rgb_bg) end} @@ -144,7 +150,7 @@ describe('--embed --listen UI', function() helpers.skip(helpers.is_os('win')) clear() local child_server = assert(helpers.new_pipename()) - funcs.jobstart({nvim_prog, '--embed', '--listen', child_server, '--clean'}) + funcs.jobstart({nvim_prog, '--embed', '--listen', child_server, '--clean', '--cmd', 'colorscheme vim'}) retry(nil, nil, function() neq(nil, uv.fs_stat(child_server)) end) local child_session = helpers.connect(child_server) diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 2902b4a4a5..eca8ee6422 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1185,7 +1185,7 @@ describe('float window', function() it('defaults to NormalFloat highlight and inherited options', function() command('set number') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ix<cr>y<cr><esc>gg') local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10}) if multigrid then @@ -1271,7 +1271,7 @@ describe('float window', function() command('set colorcolumn=1') command('set cursorline') command('set foldcolumn=1') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ix<cr>y<cr><esc>gg') local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then @@ -1399,7 +1399,7 @@ describe('float window', function() command('set colorcolumn=1') command('set cursorline') command('set foldcolumn=1') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ix<cr>y<cr><esc>gg') local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then @@ -1528,7 +1528,7 @@ describe('float window', function() command('set cursorline') command('set foldcolumn=1') command('set statuscolumn=%l%s%C') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ix<cr>y<cr><esc>gg') meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then @@ -5921,7 +5921,7 @@ describe('float window', function() describe('float shown after pum', function() local win before_each(function() - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('i') funcs.complete(1, {'aa', 'word', 'longtext'}) if multigrid then diff --git a/test/functional/ui/hlstate_spec.lua b/test/functional/ui/hlstate_spec.lua index 55f873e827..b35d61744f 100644 --- a/test/functional/ui/hlstate_spec.lua +++ b/test/functional/ui/hlstate_spec.lua @@ -72,7 +72,7 @@ describe('ext_hlstate detailed highlights', function() [6] = {{}, {{hi_name = "StatusLineNC", ui_name = "StatusLineNC", kind = "ui"}}}, [7] = {{}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}}, }) - command("hi clear VertSplit") + command("hi clear WinSeparator") command("vsplit") screen:expect([[ diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index 7b93b74eac..1dbbe76bac 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -22,7 +22,7 @@ describe("shell command :!", function() before_each(function() clear() screen = child_session.screen_setup(0, '["'..helpers.nvim_prog.. - '", "-u", "NONE", "-i", "NONE", "--cmd", "'..helpers.nvim_set..'"]') + '", "-u", "NONE", "-i", "NONE", "--cmd", "colorscheme vim", "--cmd", "'..helpers.nvim_set..'"]') screen:expect([[ {1: } | {4:~ }| diff --git a/test/functional/ui/quickfix_spec.lua b/test/functional/ui/quickfix_spec.lua index df43871e60..9f072915e2 100644 --- a/test/functional/ui/quickfix_spec.lua +++ b/test/functional/ui/quickfix_spec.lua @@ -89,7 +89,7 @@ describe('quickfix selection highlight', function() end) it('using QuickFixLine highlight group', function() - command('highlight QuickFixLine guibg=Red') + command('highlight QuickFixLine guibg=Red guifg=NONE gui=NONE') command('copen') @@ -124,7 +124,7 @@ describe('quickfix selection highlight', function() it('combines with CursorLine', function() command('set cursorline') - command('highlight QuickFixLine guifg=Red') + command('highlight QuickFixLine guifg=Red guibg=NONE gui=NONE') command('highlight CursorLine guibg=Fuchsia') command('copen') @@ -160,7 +160,7 @@ describe('quickfix selection highlight', function() it('QuickFixLine background takes precedence over CursorLine', function() command('set cursorline') - command('highlight QuickFixLine guibg=Red') + command('highlight QuickFixLine guibg=Red guifg=NONE gui=NONE') command('highlight CursorLine guibg=Fuchsia') command('copen') diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 7cc1accd3f..4ef7565ec5 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -8,9 +8,15 @@ local funcs, meths = helpers.funcs, helpers.meths describe('screen', function() local screen - local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', - '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler', - '--embed'} + local nvim_argv = { + helpers.nvim_prog, + '-u', 'NONE', + '-i', 'NONE', + '-N', + '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler', + '--cmd', 'colorscheme vim', + '--embed', + } before_each(function() local screen_nvim = spawn(nvim_argv) @@ -997,9 +1003,15 @@ describe('Screen default colors', function() local function startup(light, termcolors) local extra = (light and ' background=light') or '' - local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', - '--cmd', 'set shortmess+=I noswapfile belloff= noshowcmd noruler'..extra, - '--embed'} + local nvim_argv = { + helpers.nvim_prog, + '-u', 'NONE', + '-i', 'NONE', + '-N', + '--cmd', 'set shortmess+=I noswapfile belloff= noshowcmd noruler'..extra, + '--cmd', 'colorscheme vim', + '--embed', + } local screen_nvim = spawn(nvim_argv) set_session(screen_nvim) screen = Screen.new() @@ -1017,7 +1029,7 @@ describe('Screen default colors', function() it('can be set to light', function() startup(true, false) screen:expect{condition=function() - eq({rgb_fg=Screen.colors.White, rgb_bg=0, rgb_sp=Screen.colors.Red, + eq({rgb_bg=Screen.colors.White, rgb_fg=0, rgb_sp=Screen.colors.Red, cterm_bg=0, cterm_fg=0}, screen.default_colors) end} end) diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim index 7546b342e6..091fb95806 100644 --- a/test/old/testdir/setup.vim +++ b/test/old/testdir/setup.vim @@ -93,3 +93,6 @@ let $HOME = expand(getcwd() . '/XfakeHOME') if !isdirectory($HOME) call mkdir($HOME) endif + +" Use Vim's default color scheme +colorscheme vim diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim index a83dc34063..f7f4d9832b 100644 --- a/test/old/testdir/test_highlight.vim +++ b/test/old/testdir/test_highlight.vim @@ -810,6 +810,7 @@ endfunc " Test for :highlight command errors func Test_highlight_cmd_errors() if has('gui_running') || has('nvim') + hi! Normal ctermfg=NONE ctermbg=NONE " This test doesn't fail in the MS-Windows console version. call assert_fails('hi Xcomment ctermfg=fg', 'E419:') call assert_fails('hi Xcomment ctermfg=bg', 'E420:') diff --git a/test/old/testdir/test_syntax.vim b/test/old/testdir/test_syntax.vim index 76a21adc57..10dc798df7 100644 --- a/test/old/testdir/test_syntax.vim +++ b/test/old/testdir/test_syntax.vim @@ -214,7 +214,7 @@ endfunc func Test_echohl_completion() call feedkeys(":echohl no\<C-A>\<C-B>\"\<CR>", 'tx') " call assert_equal('"echohl NonText Normal none', @:) - call assert_equal('"echohl NonText Normal NormalFloat none', @:) + call assert_equal('"echohl NonText Normal NormalFloat NormalNC none', @:) endfunc func Test_syntax_arg_skipped() |