diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-03-27 10:35:50 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-03-27 12:32:53 +0100 |
commit | b556bd1a535d39418b75fe5403e8f117f7f3166c (patch) | |
tree | b571d9be6ef7be7d8adc708fe78a730060968569 | |
parent | 63f7b1f31eae9e2710bd973f05a575f26e0208d9 (diff) | |
download | rneovim-b556bd1a535d39418b75fe5403e8f117f7f3166c.tar.gz rneovim-b556bd1a535d39418b75fe5403e8f117f7f3166c.tar.bz2 rneovim-b556bd1a535d39418b75fe5403e8f117f7f3166c.zip |
refactor(tests): use global defaults instead of set_default_attr_ids (2)
30 files changed, 580 insertions, 857 deletions
diff --git a/test/functional/legacy/063_match_and_matchadd_spec.lua b/test/functional/legacy/063_match_and_matchadd_spec.lua index 0c2b59932b..b875d32e56 100644 --- a/test/functional/legacy/063_match_and_matchadd_spec.lua +++ b/test/functional/legacy/063_match_and_matchadd_spec.lua @@ -12,10 +12,6 @@ describe('063: Test for ":match", "matchadd()" and related functions', function( it('is working', function() local screen = Screen.new(40, 5) screen:attach() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - [1] = { background = Screen.colors.Red }, - }) command('highlight MyGroup1 term=bold ctermbg=red guibg=red') command('highlight MyGroup2 term=italic ctermbg=green guibg=green') @@ -25,8 +21,8 @@ describe('063: Test for ":match", "matchadd()" and related functions', function( insert('abcdefghijklmnopq') command("call matchaddpos('MyGroup1', [[1, 5], [1, 8, 3]], 10, 3)") screen:expect([[ - abcd{1:e}fg{1:hij}klmnop^q | - {0:~ }|*3 + abcd{30:e}fg{30:hij}klmnop^q | + {1:~ }|*3 | ]]) @@ -34,8 +30,8 @@ describe('063: Test for ":match", "matchadd()" and related functions', function( command("call setline(1, 'abcdΣabcdef')") command("call matchaddpos('MyGroup1', [[1, 4, 2], [1, 9, 2]])") screen:expect([[ - abc{1:dΣ}ab{1:cd}e^f | - {0:~ }|*3 + abc{30:dΣ}ab{30:cd}e^f | + {1:~ }|*3 | ]]) end) diff --git a/test/functional/legacy/breakindent_spec.lua b/test/functional/legacy/breakindent_spec.lua index cf0065f394..dd18e5664b 100644 --- a/test/functional/legacy/breakindent_spec.lua +++ b/test/functional/legacy/breakindent_spec.lua @@ -67,50 +67,43 @@ describe('breakindent', function() setlocal breakindent call setline(1, "\t" .. join(range(100))) ]]) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [2] = { bold = true, reverse = true }, -- StatusLine - [3] = { reverse = true }, -- StatusLineNC - [4] = { bold = true }, -- ModeMsg - }) screen:attach() feed('v$') screen:expect([[ - {0:<<<} {1: 93 94 95 96 97 98 99}^ | - {2:[No Name] [+] }| + {1:<<<} {17: 93 94 95 96 97 98 99}^ | + {3:[No Name] [+] }| | - {0:~ }| - {3:[No Name] }| - {4:-- VISUAL --} | + {1:~ }| + {2:[No Name] }| + {5:-- VISUAL --} | ]]) command('setlocal showbreak=+++') screen:expect([[ - {0:+++}{1: 90 91 92 93 94 95 96 97 98 99}^ | - {2:[No Name] [+] }| + {1:+++}{17: 90 91 92 93 94 95 96 97 98 99}^ | + {3:[No Name] [+] }| | - {0:~ }| - {3:[No Name] }| - {4:-- VISUAL --} | + {1:~ }| + {2:[No Name] }| + {5:-- VISUAL --} | ]]) command('setlocal breakindentopt+=sbr') screen:expect([[ - {0:+++} {1: 93 94 95 96 97 98 99}^ | - {2:[No Name] [+] }| + {1:+++} {17: 93 94 95 96 97 98 99}^ | + {3:[No Name] [+] }| | - {0:~ }| - {3:[No Name] }| - {4:-- VISUAL --} | + {1:~ }| + {2:[No Name] }| + {5:-- VISUAL --} | ]]) command('setlocal nobreakindent') screen:expect([[ - {0:+++}{1: 98 99}^ | - {2:[No Name] [+] }| + {1:+++}{17: 98 99}^ | + {3:[No Name] [+] }| | - {0:~ }| - {3:[No Name] }| - {4:-- VISUAL --} | + {1:~ }| + {2:[No Name] }| + {5:-- VISUAL --} | ]]) end) end) diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index 4d450965cf..6b9f746826 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -15,12 +15,6 @@ describe('cmdline', function() it('is cleared when switching tabs', function() local screen = Screen.new(30, 10) screen:attach() - screen:set_default_attr_ids { - [1] = { underline = true, background = Screen.colors.LightGrey }, - [2] = { bold = true }, - [3] = { reverse = true }, - [4] = { bold = true, foreground = Screen.colors.Blue1 }, - } feed_command([[call setline(1, range(30))]]) screen:expect([[ @@ -39,9 +33,9 @@ describe('cmdline', function() feed [[:tabnew<cr>]] screen:expect { grid = [[ - {1: + [No Name] }{2: [No Name] }{3: }{1:X}| + {24: + [No Name] }{5: [No Name] }{2: }{24:X}| ^ | - {4:~ }|*7 + {1:~ }|*7 :tabnew | ]], } @@ -49,9 +43,9 @@ describe('cmdline', function() feed [[<C-w>-<C-w>-]] screen:expect { grid = [[ - {1: + [No Name] }{2: [No Name] }{3: }{1:X}| + {24: + [No Name] }{5: [No Name] }{2: }{24:X}| ^ | - {4:~ }|*5 + {1:~ }|*5 |*3 ]], } @@ -59,7 +53,7 @@ describe('cmdline', function() feed [[gt]] screen:expect { grid = [[ - {2: + [No Name] }{1: [No Name] }{3: }{1:X}| + {5: + [No Name] }{24: [No Name] }{2: }{24:X}| ^0 | 1 | 2 | @@ -74,9 +68,9 @@ describe('cmdline', function() feed [[gt]] screen:expect([[ - {1: + [No Name] }{2: [No Name] }{3: }{1:X}| + {24: + [No Name] }{5: [No Name] }{2: }{24:X}| ^ | - {4:~ }|*5 + {1:~ }|*5 |*3 ]]) end) @@ -109,10 +103,6 @@ describe('cmdline', function() -- oldtest: Test_cmdline_redraw_tabline() it('tabline is redrawn on entering cmdline', function() local screen = Screen.new(30, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { reverse = true }, -- TabLineFill - }) screen:attach() exec([[ set showtabline=2 @@ -120,9 +110,9 @@ describe('cmdline', function() ]]) feed(':') screen:expect([[ - {1:foo }| + {2:foo }| | - {0:~ }|*3 + {1:~ }|*3 :^ | ]]) end) @@ -130,9 +120,6 @@ describe('cmdline', function() -- oldtest: Test_redraw_in_autocmd() it('cmdline cursor position is correct after :redraw with cmdheight=2', function() local screen = Screen.new(30, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() exec([[ set cmdheight=2 @@ -141,7 +128,7 @@ describe('cmdline', function() feed(':for i in range(3)<CR>') screen:expect([[ | - {0:~ }|*3 + {1:~ }|*3 :for i in range(3) | : ^ | ]]) @@ -149,7 +136,7 @@ describe('cmdline', function() -- Note: this may still be considered broken, ref #18140 screen:expect([[ | - {0:~ }|*3 + {1:~ }|*3 : :let i =^ | | ]]) @@ -157,10 +144,6 @@ describe('cmdline', function() it("setting 'cmdheight' works after outputting two messages vim-patch:9.0.0665", function() local screen = Screen.new(60, 8) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, reverse = true }, -- StatusLine - }) screen:attach() exec([[ set cmdheight=1 laststatus=2 @@ -175,15 +158,15 @@ describe('cmdline', function() feed(':call EchoTwo()') screen:expect([[ | - {0:~ }|*5 - {1:[No Name] }| + {1:~ }|*5 + {3:[No Name] }| :call EchoTwo()^ | ]]) feed('<CR>') screen:expect([[ ^ | - {0:~ }|*5 - {1:[No Name] }| + {1:~ }|*5 + {3:[No Name] }| | ]]) end) @@ -191,21 +174,15 @@ describe('cmdline', function() -- oldtest: Test_cmdheight_tabline() it("changing 'cmdheight' when there is a tabline", function() local screen = Screen.new(60, 8) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, reverse = true }, -- StatusLine - [2] = { bold = true }, -- TabLineSel - [3] = { reverse = true }, -- TabLineFill - }) screen:attach() api.nvim_set_option_value('laststatus', 2, {}) api.nvim_set_option_value('showtabline', 2, {}) api.nvim_set_option_value('cmdheight', 1, {}) screen:expect([[ - {2: [No Name] }{3: }| + {5: [No Name] }{2: }| ^ | - {0:~ }|*4 - {1:[No Name] }| + {1:~ }|*4 + {3:[No Name] }| | ]]) end) @@ -213,9 +190,6 @@ describe('cmdline', function() -- oldtest: Test_rulerformat_position() it("ruler has correct position with 'rulerformat' set", function() local screen = Screen.new(20, 3) - screen:set_default_attr_ids { - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - } screen:attach() api.nvim_set_option_value('ruler', true, {}) api.nvim_set_option_value('rulerformat', 'longish', {}) @@ -224,7 +198,7 @@ describe('cmdline', function() feed [[<C-W>v<C-W>|<C-W>p]] screen:expect [[ │^ | - {0:~ }│{0:~}| + {1:~ }│{1:~}| longish | ]] end) diff --git a/test/functional/legacy/conceal_spec.lua b/test/functional/legacy/conceal_spec.lua index e2cc3b23df..a28c3058b2 100644 --- a/test/functional/legacy/conceal_spec.lua +++ b/test/functional/legacy/conceal_spec.lua @@ -19,12 +19,6 @@ describe('Conceal', function() -- oldtest: Test_conceal_two_windows() it('works', function() local screen = Screen.new(75, 12) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, reverse = true }, -- StatusLine - [2] = { reverse = true }, -- StatusLineNC, IncSearch - [3] = { bold = true }, -- ModeMsg - }) screen:attach() exec([[ let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"] @@ -48,12 +42,12 @@ describe('Conceal', function() two ^here | three three | Second window | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| one one one one one | two here | three three | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| /here | ]]) @@ -65,12 +59,12 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| one one one one one | two here | three three | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| /here | ]]) @@ -83,12 +77,12 @@ describe('Conceal', function() two |hidden| ^here | three three | Second window | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| one one one one one | two here | three three | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| /here | ]]) @@ -100,12 +94,12 @@ describe('Conceal', function() two here | three |hidden^| three | Second window | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| one one one one one | two here | three three | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| /here | ]]) @@ -117,13 +111,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| ^here | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| /here | ]]) @@ -134,13 +128,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two ^here | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| /here | ]]) feed('a') @@ -149,14 +143,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| h^ere | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- INSERT --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- INSERT --} | ]]) feed('<Esc>/e') screen:expect([[ @@ -164,13 +158,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| h{2:e}re | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| /e^ | ]]) feed('<Esc>v') @@ -179,14 +173,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| ^here | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- VISUAL --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- VISUAL --} | ]]) feed('<Esc>') @@ -197,13 +191,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| ^here | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| | ]]) feed('a') @@ -212,14 +206,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two h^ere | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- INSERT --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- INSERT --} | ]]) feed('<Esc>/e') screen:expect([[ @@ -227,13 +221,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| h{2:e}re | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| /e^ | ]]) feed('<Esc>v') @@ -242,14 +236,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| ^here | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- VISUAL --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- VISUAL --} | ]]) feed('<Esc>') @@ -260,13 +254,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| ^here | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| | ]]) feed('a') @@ -275,14 +269,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| h^ere | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- INSERT --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- INSERT --} | ]]) feed('<Esc>/e') screen:expect([[ @@ -290,13 +284,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| h{2:e}re | three three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| /e^ | ]]) feed('<Esc>v') @@ -305,14 +299,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two ^here | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- VISUAL --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- VISUAL --} | ]]) feed('<Esc>') @@ -324,14 +318,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two |hidden| h^ere | three three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- INSERT --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- INSERT --} | ]]) feed('<Down>') screen:expect([[ @@ -339,14 +333,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two here | three |hidden|^ three | - {0:~ }| - {1:[No Name] [+] }| - {3:-- INSERT --} | + {1:~ }| + {3:[No Name] [+] }| + {5:-- INSERT --} | ]]) feed('<Esc>') @@ -356,13 +350,13 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two here | three |hidden^| three | - {0:~ }| - {1:[No Name] [+] }| + {1:~ }| + {3:[No Name] [+] }| | ]]) feed('o') @@ -371,14 +365,14 @@ describe('Conceal', function() two here | three three | Second window | - {0:~ }| + {1:~ }| {2:[No Name] [+] }| one one one one one | two here | three three | ^ | - {1:[No Name] [+] }| - {3:-- INSERT --} | + {3:[No Name] [+] }| + {5:-- INSERT --} | ]]) feed('<Esc>') end) @@ -499,10 +493,6 @@ describe('Conceal', function() -- oldtest: Test_conceal_resize_term() it('resize editor', function() local screen = Screen.new(75, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { foreground = Screen.colors.Blue }, -- Comment - }) screen:attach() exec([[ call setline(1, '`one` `two` `three` `four` `five`, the backticks should be concealed') @@ -512,14 +502,14 @@ describe('Conceal', function() ]]) screen:expect([[ one two three four five, the ^backticks should be concealed | - {0:~ }|*4 + {1:~ }|*4 | ]]) screen:try_resize(75, 7) screen:expect([[ one two three four five, the ^backticks should be concealed | - {0:~ }|*5 + {1:~ }|*5 | ]]) end) @@ -527,9 +517,6 @@ describe('Conceal', function() -- oldtest: Test_conceal_linebreak() it('with linebreak', function() local screen = Screen.new(75, 8) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() exec([[ let &wrap = v:true @@ -549,9 +536,9 @@ describe('Conceal', function() ^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | - {0:+ }bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | - {0:+ }cccccc | - {0:~ }|*2 + {1:+ }bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | + {1:+ }cccccc | + {1:~ }|*2 | ]]) end) diff --git a/test/functional/legacy/debugger_spec.lua b/test/functional/legacy/debugger_spec.lua index 7ed5e84da6..6d8547ead1 100644 --- a/test/functional/legacy/debugger_spec.lua +++ b/test/functional/legacy/debugger_spec.lua @@ -12,10 +12,6 @@ describe('debugger', function() before_each(function() screen = Screen.new(999, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - [1] = { reverse = true, bold = true }, - }) screen:attach() end) @@ -33,7 +29,7 @@ describe('debugger', function() screen:expect { grid = [[ ^let g:Xtest_var += 1{MATCH: *}| - {0:~{MATCH: *}}|*8 + {1:~{MATCH: *}}|*8 :source %{MATCH: *}| ]], } @@ -41,8 +37,8 @@ describe('debugger', function() screen:expect { grid = [[ let g:Xtest_var += 1{MATCH: *}| - {0:~{MATCH: *}}| - {1:{MATCH: *}}| + {1:~{MATCH: *}}| + {3:{MATCH: *}}| Breakpoint in "{MATCH:.*}XdebugBreakExpr.vim" line 1{MATCH: *}| Entering Debug mode. Type "cont" to continue.{MATCH: *}| Oldval = "10"{MATCH: *}| @@ -56,7 +52,7 @@ describe('debugger', function() screen:expect { grid = [[ ^let g:Xtest_var += 1{MATCH: *}| - {0:~{MATCH: *}}|*8 + {1:~{MATCH: *}}|*8 {MATCH: *}| ]], } @@ -64,8 +60,8 @@ describe('debugger', function() screen:expect { grid = [[ let g:Xtest_var += 1{MATCH: *}| - {0:~{MATCH: *}}| - {1:{MATCH: *}}| + {1:~{MATCH: *}}| + {3:{MATCH: *}}| Breakpoint in "{MATCH:.*}XdebugBreakExpr.vim" line 1{MATCH: *}| Entering Debug mode. Type "cont" to continue.{MATCH: *}| Oldval = "11"{MATCH: *}| diff --git a/test/functional/legacy/digraph_spec.lua b/test/functional/legacy/digraph_spec.lua index 015f144b74..f11043bd10 100644 --- a/test/functional/legacy/digraph_spec.lua +++ b/test/functional/legacy/digraph_spec.lua @@ -9,29 +9,24 @@ describe('digraph', function() -- oldtest: Test_entering_digraph() it('characters displayed on the screen', function() local screen = Screen.new(10, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { foreground = Screen.colors.Blue }, -- SpecialKey - [2] = { bold = true }, -- ModeMsg - }) screen:attach() feed('i<C-K>') screen:expect([[ - {1:^?} | - {0:~ }|*4 - {2:-- INSERT --}| + {18:^?} | + {1:~ }|*4 + {5:-- INSERT --}| ]]) feed('1') screen:expect([[ - {1:^1} | - {0:~ }|*4 - {2:-- INSERT --}| + {18:^1} | + {1:~ }|*4 + {5:-- INSERT --}| ]]) feed('2') screen:expect([[ ½^ | - {0:~ }|*4 - {2:-- INSERT --}| + {1:~ }|*4 + {5:-- INSERT --}| ]]) end) end) diff --git a/test/functional/legacy/display_spec.lua b/test/functional/legacy/display_spec.lua index 948f9df1aa..37e063e0cd 100644 --- a/test/functional/legacy/display_spec.lua +++ b/test/functional/legacy/display_spec.lua @@ -13,9 +13,6 @@ describe('display', function() it('scroll when modified at topline vim-patch:8.2.1488', function() local screen = Screen.new(20, 4) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true }, - }) command([[call setline(1, repeat('a', 21))]]) feed('O') @@ -23,7 +20,7 @@ describe('display', function() ^ | aaaaaaaaaaaaaaaaaaaa| a | - {1:-- INSERT --} | + {5:-- INSERT --} | ]]) end) @@ -31,11 +28,6 @@ describe('display', function() it('scrolling when modified at topline in Visual mode vim-patch:8.2.4626', function() local screen = Screen.new(60, 8) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true }, -- ModeMsg - [2] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [3] = { background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue }, -- SignColumn - }) exec([[ set scrolloff=0 @@ -47,9 +39,9 @@ describe('display', function() ]]) feed('VG7kk') screen:expect([[ - {3: }^f{2:oo} | - {3: }foo |*6 - {1:-- VISUAL LINE --} | + {7: }^f{17:oo} | + {7: }foo |*6 + {5:-- VISUAL LINE --} | ]]) end) diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index 0762e5e671..056ec78397 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -30,22 +30,17 @@ describe('edit', function() -- oldtest: Test_edit_insert_reg() it('inserting a register using CTRL-R', function() local screen = Screen.new(10, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { foreground = Screen.colors.Blue }, -- SpecialKey - [2] = { bold = true }, -- ModeMsg - }) screen:attach() feed('a<C-R>') screen:expect([[ - {1:^"} | - {0:~ }|*4 - {2:-- INSERT --}| + {18:^"} | + {1:~ }|*4 + {5:-- INSERT --}| ]]) feed('=') screen:expect([[ - {1:"} | - {0:~ }|*4 + {18:"} | + {1:~ }|*4 =^ | ]]) end) @@ -53,51 +48,42 @@ describe('edit', function() -- oldtest: Test_edit_ctrl_r_failed() it('positioning cursor after CTRL-R expression failed', function() local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { foreground = Screen.colors.Blue }, -- SpecialKey - [2] = { foreground = Screen.colors.SlateBlue }, - [3] = { bold = true }, -- ModeMsg - [4] = { reverse = true, bold = true }, -- MsgSeparator - [5] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - [6] = { foreground = Screen.colors.SeaGreen, bold = true }, -- MoreMsg - }) screen:attach() feed('i<C-R>') screen:expect([[ - {1:^"} | - {0:~ }|*4 - {3:-- INSERT --} | + {18:^"} | + {1:~ }|*4 + {5:-- INSERT --} | ]]) feed('={}') screen:expect([[ - {1:"} | - {0:~ }|*4 - ={2:{}}^ | + {18:"} | + {1:~ }|*4 + ={16:{}}^ | ]]) -- trying to insert a dictionary produces an error feed('<CR>') screen:expect([[ - {1:"} | - {0:~ }| - {4: }| - ={2:{}} | - {5:E731: Using a Dictionary as a String} | + {18:"} | + {1:~ }| + {3: }| + ={16:{}} | + {9:E731: Using a Dictionary as a String} | {6:Press ENTER or type command to continue}^ | ]]) feed(':') screen:expect([[ :^ | - {0:~ }|*4 - {3:-- INSERT --} | + {1:~ }|*4 + {5:-- INSERT --} | ]]) -- ending Insert mode should put the cursor back on the ':' feed('<Esc>') screen:expect([[ ^: | - {0:~ }|*4 + {1:~ }|*4 | ]]) end) diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua index ae4c4309d1..404f9675be 100644 --- a/test/functional/legacy/ex_mode_spec.lua +++ b/test/functional/legacy/ex_mode_spec.lua @@ -45,60 +45,55 @@ describe('Ex mode', function() it('substitute confirmation prompt', function() command('set noincsearch nohlsearch inccommand=') local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, reverse = true }, -- MsgSeparator - [1] = { foreground = Screen.colors.Brown }, -- LineNr - [2] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() command([[call setline(1, ['foo foo', 'foo foo', 'foo foo'])]]) command([[set number]]) feed('gQ') screen:expect([[ - {1: 1 }foo foo | - {1: 2 }foo foo | - {1: 3 }foo foo | - {0: }| + {8: 1 }foo foo | + {8: 2 }foo foo | + {8: 3 }foo foo | + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :^ | ]]) feed('%s/foo/bar/gc<CR>') screen:expect([[ - {1: 1 }foo foo | - {0: }| + {8: 1 }foo foo | + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :%s/foo/bar/gc | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^^ | ]]) feed('N<CR>') screen:expect([[ Entering Ex mode. Type "visual" to go to Normal mode. | :%s/foo/bar/gc | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^N | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^^ | ]]) feed('n<CR>') screen:expect([[ - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^N | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^n | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^^ | ]]) feed('y<CR>') feed('q<CR>') screen:expect([[ - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^y | - {1: 2 }foo foo | + {8: 2 }foo foo | ^^^q | - {1: 2 }foo foo | + {8: 2 }foo foo | :^ | ]]) @@ -106,35 +101,31 @@ describe('Ex mode', function() feed('<CR>') screen:expect([[ ^^^y | - {1: 2 }foo foo | + {8: 2 }foo foo | ^^^q | - {1: 2 }foo foo | - {1: 3 }foo foo | + {8: 2 }foo foo | + {8: 3 }foo foo | :^ | ]]) feed(':vi<CR>') screen:expect([[ - {1: 1 }foo bar | - {1: 2 }foo foo | - {1: 3 }^foo foo | - {2:~ }|*2 + {8: 1 }foo bar | + {8: 2 }foo foo | + {8: 3 }^foo foo | + {1:~ }|*2 | ]]) end) it('pressing Ctrl-C in :append inside a loop in Ex mode does not hang', function() local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, reverse = true }, -- MsgSeparator - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() feed('gQ') feed('for i in range(1)<CR>') feed('append<CR>') screen:expect([[ - {0: }| + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :for i in range(1) | | diff --git a/test/functional/legacy/excmd_spec.lua b/test/functional/legacy/excmd_spec.lua index 41f14c4645..f23646eb91 100644 --- a/test/functional/legacy/excmd_spec.lua +++ b/test/functional/legacy/excmd_spec.lua @@ -48,12 +48,6 @@ describe(':confirm command dialog', function() local function start_new() clear() screen = Screen.new(75, 20) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, reverse = true }, -- StatusLine, MsgSeparator - [2] = { reverse = true }, -- StatusLineNC - [3] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - }) screen:attach() end @@ -76,17 +70,17 @@ describe(':confirm command dialog', function() feed(':confirm qall\n') screen:expect([[ bar2 | - {0:~ }|*5 + {1:~ }|*5 {2:Xbar [+] }| foo2 | - {0:~ }|*4 + {1:~ }|*4 {2:Xfoo [+] }| | - {0:~ }|*2 - {1: }| + {1:~ }|*2 + {3: }| :confirm qall | - {3:Save changes to "Xbar"?} | - {3:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | + {6:Save changes to "Xbar"?} | + {6:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | ]]) expect_exit(1000, feed, 'A') @@ -106,17 +100,17 @@ describe(':confirm command dialog', function() feed(':confirm qall\n') screen:expect([[ bar3 | - {0:~ }|*5 + {1:~ }|*5 {2:Xbar [+] }| foo3 | - {0:~ }|*4 + {1:~ }|*4 {2:Xfoo [+] }| | - {0:~ }|*2 - {1: }| + {1:~ }|*2 + {3: }| :confirm qall | - {3:Save changes to "Xbar"?} | - {3:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | + {6:Save changes to "Xbar"?} | + {6:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | ]]) expect_exit(1000, feed, 'D') @@ -136,33 +130,33 @@ describe(':confirm command dialog', function() feed(':confirm qall\n') screen:expect([[ bar4 | - {0:~ }|*5 + {1:~ }|*5 {2:Xbar [+] }| foo4 | - {0:~ }|*4 + {1:~ }|*4 {2:Xfoo [+] }| | - {0:~ }|*2 - {1: }| + {1:~ }|*2 + {3: }| :confirm qall | - {3:Save changes to "Xbar"?} | - {3:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | + {6:Save changes to "Xbar"?} | + {6:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | ]]) feed('N') screen:expect([[ bar4 | - {0:~ }|*5 + {1:~ }|*5 {2:Xbar [+] }| foo4 | - {0:~ }|*4 + {1:~ }|*4 {2:Xfoo [+] }| | - {1: }| + {3: }| :confirm qall | - {3:Save changes to "Xbar"?} | + {6:Save changes to "Xbar"?} | | - {3:Save changes to "Xfoo"?} | - {3:[Y]es, (N)o, (C)ancel: }^ | + {6:Save changes to "Xfoo"?} | + {6:[Y]es, (N)o, (C)ancel: }^ | ]]) expect_exit(1000, feed, 'Y') @@ -186,39 +180,39 @@ describe(':confirm command dialog', function() feed(':confirm close\n') screen:expect([[ abc | - {0:~ }|*3 - {1:[No Name] [+] }| + {1:~ }|*3 + {3:[No Name] [+] }| | - {1: }| + {3: }| :confirm close | - {3:Save changes to "Untitled"?} | - {3:[Y]es, (N)o, (C)ancel: }^ | + {6:Save changes to "Untitled"?} | + {6:[Y]es, (N)o, (C)ancel: }^ | ]]) feed('C') screen:expect([[ ^abc | - {0:~ }|*3 - {1:[No Name] [+] }| + {1:~ }|*3 + {3:[No Name] [+] }| | - {0:~ }|*2 + {1:~ }|*2 {2:[No Name] }| | ]]) feed(':confirm close\n') screen:expect([[ abc | - {0:~ }|*3 - {1:[No Name] [+] }| + {1:~ }|*3 + {3:[No Name] [+] }| | - {1: }| + {3: }| :confirm close | - {3:Save changes to "Untitled"?} | - {3:[Y]es, (N)o, (C)ancel: }^ | + {6:Save changes to "Untitled"?} | + {6:[Y]es, (N)o, (C)ancel: }^ | ]]) feed('N') screen:expect([[ ^ | - {0:~ }|*8 + {1:~ }|*8 | ]]) end) @@ -237,16 +231,16 @@ describe(':confirm command dialog', function() feed(':confirm q\n') screen:expect([[ foo | - {0:~ }|*3 - {1: }| + {1:~ }|*3 + {3: }| :confirm q | - {3:Save changes to "Untitled"?} | - {3:[Y]es, (N)o, (C)ancel: }^ | + {6:Save changes to "Untitled"?} | + {6:[Y]es, (N)o, (C)ancel: }^ | ]]) feed('C') screen:expect([[ ^abc | - {0:~ }|*6 + {1:~ }|*6 | ]]) @@ -254,16 +248,16 @@ describe(':confirm command dialog', function() feed(':confirm wq\n') screen:expect([[ foo | - {0:~ }|*3 - {1: }| + {1:~ }|*3 + {3: }| "Xfoo" [noeol] 1L, 3B written | - {3:Save changes to "Untitled"?} | - {3:[Y]es, (N)o, (C)ancel: }^ | + {6:Save changes to "Untitled"?} | + {6:[Y]es, (N)o, (C)ancel: }^ | ]]) feed('C') screen:expect([[ ^abc | - {0:~ }|*6 + {1:~ }|*6 "Xfoo" [noeol] 1L, 3B written | ]]) @@ -286,17 +280,17 @@ describe(':confirm command dialog', function() feed(':set ro | confirm w\n') screen:expect([[ foobar | - {0:~ }|*2 - {1: }| + {1:~ }|*2 + {3: }| :set ro | confirm w | - {3:'readonly' option is set for "Xconfirm_write_ro".} | - {3:Do you wish to write anyway?} | - {3:(Y)es, [N]o: }^ | + {6:'readonly' option is set for "Xconfirm_write_ro".} | + {6:Do you wish to write anyway?} | + {6:(Y)es, [N]o: }^ | ]]) feed('N') screen:expect([[ fooba^r | - {0:~ }|*5 + {1:~ }|*5 | 1,6 All | ]]) @@ -305,35 +299,35 @@ describe(':confirm command dialog', function() feed(':confirm w\n') screen:expect([[ foobar | - {0:~ }|*2 - {1: }| + {1:~ }|*2 + {3: }| :confirm w | - {3:'readonly' option is set for "Xconfirm_write_ro".} | - {3:Do you wish to write anyway?} | - {3:(Y)es, [N]o: }^ | + {6:'readonly' option is set for "Xconfirm_write_ro".} | + {6:Do you wish to write anyway?} | + {6:(Y)es, [N]o: }^ | ]]) feed('Y') if is_os('win') then screen:expect([[ foobar | - {0:~ }| - {1: }| + {1:~ }| + {3: }| :confirm w | - {3:'readonly' option is set for "Xconfirm_write_ro".} | - {3:Do you wish to write anyway?} | + {6:'readonly' option is set for "Xconfirm_write_ro".} | + {6:Do you wish to write anyway?} | "Xconfirm_write_ro" [unix] 1L, 7B written | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) else screen:expect([[ foobar | - {0:~ }| - {1: }| + {1:~ }| + {3: }| :confirm w | - {3:'readonly' option is set for "Xconfirm_write_ro".} | - {3:Do you wish to write anyway?} | + {6:'readonly' option is set for "Xconfirm_write_ro".} | + {6:Do you wish to write anyway?} | "Xconfirm_write_ro" 1L, 7B written | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) end eq('foobar\n', read_file('Xconfirm_write_ro')) @@ -344,36 +338,36 @@ describe(':confirm command dialog', function() feed(':set noro | silent undo | confirm w\n') screen:expect([[ foobar | - {0:~ }| - {1: }| + {1:~ }| + {3: }| :set noro | silent undo | confirm w | - {3:File permissions of "Xconfirm_write_ro" are read-only.} | - {3:It may still be possible to write it.} | - {3:Do you wish to try?} | - {3:(Y)es, [N]o: }^ | + {6:File permissions of "Xconfirm_write_ro" are read-only.} | + {6:It may still be possible to write it.} | + {6:Do you wish to try?} | + {6:(Y)es, [N]o: }^ | ]]) feed('Y') if is_os('win') then screen:expect([[ foobar | - {1: }| + {3: }| :set noro | silent undo | confirm w | - {3:File permissions of "Xconfirm_write_ro" are read-only.} | - {3:It may still be possible to write it.} | - {3:Do you wish to try?} | + {6:File permissions of "Xconfirm_write_ro" are read-only.} | + {6:It may still be possible to write it.} | + {6:Do you wish to try?} | "Xconfirm_write_ro" [unix] 1L, 4B written | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) else screen:expect([[ foobar | - {1: }| + {3: }| :set noro | silent undo | confirm w | - {3:File permissions of "Xconfirm_write_ro" are read-only.} | - {3:It may still be possible to write it.} | - {3:Do you wish to try?} | + {6:File permissions of "Xconfirm_write_ro" are read-only.} | + {6:It may still be possible to write it.} | + {6:Do you wish to try?} | "Xconfirm_write_ro" 1L, 4B written | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) end eq('foo\n', read_file('Xconfirm_write_ro')) @@ -399,10 +393,10 @@ describe(':confirm command dialog', function() b | c | d | - {1: }| + {3: }| :confirm 2,3w | - {3:Write partial file?} | - {3:(Y)es, [N]o: }^ | + {6:Write partial file?} | + {6:(Y)es, [N]o: }^ | ]]) feed('N') screen:expect([[ @@ -410,7 +404,7 @@ describe(':confirm command dialog', function() b | c | d | - {0:~ }|*2 + {1:~ }|*2 | 1,1 All | ]]) @@ -423,10 +417,10 @@ describe(':confirm command dialog', function() b | c | d | - {1: }| + {3: }| :confirm 2,3w | - {3:Write partial file?} | - {3:(Y)es, [N]o: }^ | + {6:Write partial file?} | + {6:(Y)es, [N]o: }^ | ]]) feed('Y') if is_os('win') then @@ -434,22 +428,22 @@ describe(':confirm command dialog', function() a | b | c | - {1: }| + {3: }| :confirm 2,3w | - {3:Write partial file?} | + {6:Write partial file?} | "Xwrite_partial" [New][unix] 2L, 4B written | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) else screen:expect([[ a | b | c | - {1: }| + {3: }| :confirm 2,3w | - {3:Write partial file?} | + {6:Write partial file?} | "Xwrite_partial" [New] 2L, 4B written | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) end eq('b\nc\n', read_file('Xwrite_partial')) diff --git a/test/functional/legacy/fold_spec.lua b/test/functional/legacy/fold_spec.lua index c39aae87d2..0a65948fc7 100644 --- a/test/functional/legacy/fold_spec.lua +++ b/test/functional/legacy/fold_spec.lua @@ -14,12 +14,6 @@ describe('folding', function() helpers.clear() screen = Screen.new(45, 8) - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [2] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey }, -- Folded - [3] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Grey }, -- FoldColumn - [4] = { foreground = Screen.colors.Brown }, -- LineNr - }) screen:attach() end) @@ -222,15 +216,15 @@ describe('folding', function() command('call setline(1, ["{{{1", "nline 1", "{{{1", "line 2"])') screen:expect([[ - {3:+ }{4: 0 }{2:^+-- 2 lines: ·························}| - {3:+ }{4: 1 }{2:+-- 2 lines: ·························}| + {7:+ }{8: 0 }{13:^+-- 2 lines: ·························}| + {7:+ }{8: 1 }{13:+-- 2 lines: ·························}| {1:~ }|*5 | ]]) feed('j') screen:expect([[ - {3:+ }{4: 1 }{2:+-- 2 lines: ·························}| - {3:+ }{4: 0 }{2:^+-- 2 lines: ·························}| + {7:+ }{8: 1 }{13:+-- 2 lines: ·························}| + {7:+ }{8: 0 }{13:^+-- 2 lines: ·························}| {1:~ }|*5 | ]]) @@ -246,7 +240,7 @@ describe('folding', function() screen:expect([[ ^one | - {2:+-- 2 lines: two····························}| + {13:+-- 2 lines: two····························}| four | {1:~ }|*4 | @@ -263,7 +257,7 @@ describe('folding', function() feed('4G') screen:expect([[ one | - {2:+-- 2 lines: two····························}| + {13:+-- 2 lines: two····························}| ^four | {1:~ }|*4 | @@ -280,7 +274,7 @@ describe('folding', function() feed('1G') screen:expect([[ ^one | - {2:+-- 2 lines: two····························}| + {13:+-- 2 lines: two····························}| four | {1:~ }|*4 | @@ -297,7 +291,7 @@ describe('folding', function() feed('k') screen:expect([[ ^one | - {2:+-- 2 lines: two····························}| + {13:+-- 2 lines: two····························}| four | {1:~ }|*4 | diff --git a/test/functional/legacy/global_spec.lua b/test/functional/legacy/global_spec.lua index 2c92b7814a..60894afd39 100644 --- a/test/functional/legacy/global_spec.lua +++ b/test/functional/legacy/global_spec.lua @@ -11,10 +11,6 @@ describe(':global', function() -- oldtest: Test_interrupt_global() it('can be interrupted using Ctrl-C in cmdline mode vim-patch:9.0.0082', function() local screen = Screen.new(75, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, reverse = true }, -- MsgSeparator - [1] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() exec([[ @@ -29,7 +25,7 @@ describe(':global', function() screen:expect([[ ^foo | foo |*4 - {1:Interrupted} | + {9:Interrupted} | ]]) -- Also test in Ex mode @@ -37,11 +33,11 @@ describe(':global', function() poke_eventloop() -- Wait for :sleep to start feed('<C-C>') screen:expect([[ - {0: }| + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :g/foo/norm :; | | - {1:Interrupted} | + {9:Interrupted} | :^ | ]]) end) diff --git a/test/functional/legacy/highlight_spec.lua b/test/functional/legacy/highlight_spec.lua index 3791cb5e28..12913078b6 100644 --- a/test/functional/legacy/highlight_spec.lua +++ b/test/functional/legacy/highlight_spec.lua @@ -99,11 +99,6 @@ describe('Visual selection highlight', function() -- oldtest: Test_visual_sbr() it("when 'showbreak' is set", function() local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [2] = { bold = true }, -- ModeMsg - }) screen:attach() exec([[ set showbreak=> @@ -112,9 +107,9 @@ describe('Visual selection highlight', function() ]]) feed('v$') screen:expect([[ - {0:>}{1:n, no sea takimata sanctus est Lorem ipsum dolor sit amet.}^ | + {1:>}{17:n, no sea takimata sanctus est Lorem ipsum dolor sit amet.}^ | |*4 - {2:-- VISUAL --} | + {5:-- VISUAL --} | ]]) end) end) diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index 746e0550a6..822dffaa21 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -102,12 +102,6 @@ describe("'listchars'", function() it('"exceeds" character does not appear in foldcolumn vim-patch:8.2.3121', function() local screen = Screen.new(60, 10) - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [2] = { bold = true, reverse = true }, -- StatusLine - [3] = { reverse = true }, -- StatusLineNC - [4] = { background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue }, -- FoldColumn, SignColumn - }) screen:attach() exec([[ call setline(1, ['aaa', '', 'a', 'aaaaaa']) @@ -117,83 +111,83 @@ describe("'listchars'", function() ]]) feed('13<C-W>>') screen:expect([[ - {4: }aaa │{4: }a{1:>}│{4: }^aaa | - {4: } │{4: } │{4: } | - {4: }a │{4: }a │{4: }a | - {4: }aaaaaa │{4: }a{1:>}│{4: }aaaaaa | + {7: }aaa │{7: }a{1:>}│{7: }^aaa | + {7: } │{7: } │{7: } | + {7: }a │{7: }a │{7: }a | + {7: }aaaaaa │{7: }a{1:>}│{7: }aaaaaa | {1:~ }│{1:~ }│{1:~ }|*4 - {3:[No Name] [+] <[+] }{2:[No Name] [+] }| + {2:[No Name] [+] <[+] }{3:[No Name] [+] }| | ]]) feed('<C-W>>') screen:expect([[ - {4: }aaa │{4: }{1:>}│{4: }^aaa | - {4: } │{4: } │{4: } | - {4: }a │{4: }a│{4: }a | - {4: }aaaaaa │{4: }{1:>}│{4: }aaaaaa | + {7: }aaa │{7: }{1:>}│{7: }^aaa | + {7: } │{7: } │{7: } | + {7: }a │{7: }a│{7: }a | + {7: }aaaaaa │{7: }{1:>}│{7: }aaaaaa | {1:~ }│{1:~ }│{1:~ }|*4 - {3:[No Name] [+] <+] }{2:[No Name] [+] }| + {2:[No Name] [+] <+] }{3:[No Name] [+] }| | ]]) feed('<C-W>>') screen:expect([[ - {4: }aaa │{4: }│{4: }^aaa | - {4: } │{4: }│{4: } | - {4: }a │{4: }│{4: }a | - {4: }aaaaaa │{4: }│{4: }aaaaaa | + {7: }aaa │{7: }│{7: }^aaa | + {7: } │{7: }│{7: } | + {7: }a │{7: }│{7: }a | + {7: }aaaaaa │{7: }│{7: }aaaaaa | {1:~ }│{1:~ }│{1:~ }|*4 - {3:[No Name] [+] <] }{2:[No Name] [+] }| + {2:[No Name] [+] <] }{3:[No Name] [+] }| | ]]) feed('<C-W>>') screen:expect([[ - {4: }aaa │{4: }│{4: }^aaa | - {4: } │{4: }│{4: } | - {4: }a │{4: }│{4: }a | - {4: }aaaaaa │{4: }│{4: }aaaaaa | + {7: }aaa │{7: }│{7: }^aaa | + {7: } │{7: }│{7: } | + {7: }a │{7: }│{7: }a | + {7: }aaaaaa │{7: }│{7: }aaaaaa | {1:~ }│{1:~ }│{1:~ }|*4 - {3:[No Name] [+] < }{2:[No Name] [+] }| + {2:[No Name] [+] < }{3:[No Name] [+] }| | ]]) feed('<C-W>>') screen:expect([[ - {4: }aaa │{4: }│{4: }^aaa | - {4: } │{4: }│{4: } | - {4: }a │{4: }│{4: }a | - {4: }aaaaaa │{4: }│{4: }aaaaaa | + {7: }aaa │{7: }│{7: }^aaa | + {7: } │{7: }│{7: } | + {7: }a │{7: }│{7: }a | + {7: }aaaaaa │{7: }│{7: }aaaaaa | {1:~ }│{1:~}│{1:~ }|*4 - {3:[No Name] [+] < }{2:[No Name] [+] }| + {2:[No Name] [+] < }{3:[No Name] [+] }| | ]]) feed('<C-W>h') feed_command('set nowrap foldcolumn=4') screen:expect([[ - {4: }aaa │{4: }^aaa │{4: }aaa | - {4: } │{4: } │{4: } | - {4: }a │{4: }a │{4: }a | - {4: }aaaaaa │{4: }aaaaaa │{4: }aaaaaa | + {7: }aaa │{7: }^aaa │{7: }aaa | + {7: } │{7: } │{7: } | + {7: }a │{7: }a │{7: }a | + {7: }aaaaaa │{7: }aaaaaa │{7: }aaaaaa | {1:~ }│{1:~ }│{1:~ }|*4 - {3:[No Name] [+] }{2:[No Name] [+] }{3:[No Name] [+] }| + {2:[No Name] [+] }{3:[No Name] [+] }{2:[No Name] [+] }| :set nowrap foldcolumn=4 | ]]) feed('15<C-W><lt>') screen:expect([[ - {4: }aaa │{4: }│{4: }aaa | - {4: } │{4: }│{4: } | - {4: }a │{4: }│{4: }a | - {4: }aaaaaa │{4: ^ }│{4: }aaaaaa | + {7: }aaa │{7: }│{7: }aaa | + {7: } │{7: }│{7: } | + {7: }a │{7: }│{7: }a | + {7: }aaaaaa │{7: ^ }│{7: }aaaaaa | {1:~ }│{1:~ }│{1:~ }|*4 - {3:[No Name] [+] }{2:<[+] }{3:[No Name] [+] }| + {2:[No Name] [+] }{3:<[+] }{2:[No Name] [+] }| :set nowrap foldcolumn=4 | ]]) feed('4<C-W><lt>') screen:expect([[ - {4: }aaa │{4: }│{4: }aaa | - {4: } │{4: }│{4: } | - {4: }a │{4: }│{4: }a | - {4: }aaaaaa │{4:^ }│{4: }aaaaaa | + {7: }aaa │{7: }│{7: }aaa | + {7: } │{7: }│{7: } | + {7: }a │{7: }│{7: }a | + {7: }aaaaaa │{7:^ }│{7: }aaaaaa | {1:~ }│{1:~}│{1:~ }|*4 - {3:[No Name] [+] }{2:< }{3:[No Name] [+] }| + {2:[No Name] [+] }{3:< }{2:[No Name] [+] }| :set nowrap foldcolumn=4 | ]]) end) diff --git a/test/functional/legacy/listlbr_spec.lua b/test/functional/legacy/listlbr_spec.lua index 50628e5ef9..2d8c010398 100644 --- a/test/functional/legacy/listlbr_spec.lua +++ b/test/functional/legacy/listlbr_spec.lua @@ -204,11 +204,6 @@ describe('listlbr', function() -- oldtest: Test_linebreak_reset_restore() it('cursor position is drawn correctly after operator', function() local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [2] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() -- f_wincol() calls validate_cursor() @@ -220,61 +215,61 @@ describe('listlbr', function() feed('$v$') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | - bbbbbbbbbb {1:c}^ | - {0:~ }|*3 + bbbbbbbbbb {17:c}^ | + {1:~ }|*3 2 | ]]) feed('zo') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbb ^c | - {0:~ }|*3 - {2:E490: No fold found} | + {1:~ }|*3 + {9:E490: No fold found} | ]]) feed('$v$') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | - bbbbbbbbbb {1:c}^ | - {0:~ }|*3 - {2:E490: No fold found} 2 | + bbbbbbbbbb {17:c}^ | + {1:~ }|*3 + {9:E490: No fold found} 2 | ]]) feed('gq') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbb ^c | - {0:~ }|*3 - {2:E490: No fold found} | + {1:~ }|*3 + {9:E490: No fold found} | ]]) feed('$<C-V>$') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | - bbbbbbbbbb {1:c}^ | - {0:~ }|*3 - {2:E490: No fold found} 1x2 | + bbbbbbbbbb {17:c}^ | + {1:~ }|*3 + {9:E490: No fold found} 1x2 | ]]) feed('I') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbb ^c | - {0:~ }|*3 - {2:E490: No fold found} | + {1:~ }|*3 + {9:E490: No fold found} | ]]) feed('<Esc>$v$') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | - bbbbbbbbbb {1:c}^ | - {0:~ }|*3 - {2:E490: No fold found} 2 | + bbbbbbbbbb {17:c}^ | + {1:~ }|*3 + {9:E490: No fold found} 2 | ]]) feed('s') screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | bbbbbbbbbb ^ | - {0:~ }|*3 - {2:E490: No fold found} | + {1:~ }|*3 + {9:E490: No fold found} | ]]) end) end) diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index 8e5d9b88bc..874bda07ac 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -214,11 +214,6 @@ describe('linebreak', function() -- oldtest: Test_visual_ends_before_showbreak() it("Visual area is correct when it ends before multibyte 'showbreak'", function() local screen = Screen.new(60, 8) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [2] = { bold = true }, -- ModeMsg - }) screen:attach() exec([[ let &wrap = v:true @@ -229,10 +224,10 @@ describe('linebreak', function() ]]) screen:expect([[ xxxxx | - {0:↪ }{1:yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy}^ {1: }| - {0:↪ }zzzz | - {0:~ }|*4 - {2:-- VISUAL --} | + {1:↪ }{17:yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy}^ {17: }| + {1:↪ }zzzz | + {1:~ }|*4 + {5:-- VISUAL --} | ]]) end) end) diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua index ab791f03e5..f29e171eb5 100644 --- a/test/functional/legacy/match_spec.lua +++ b/test/functional/legacy/match_spec.lua @@ -10,28 +10,24 @@ describe('matchaddpos()', function() -- oldtest: Test_matchaddpos_dump() it('can add more than 8 match positions vim-patch:9.0.0620', function() local screen = Screen.new(60, 14) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.Yellow }, -- Search - }) screen:attach() exec([[ call setline(1, ['1234567890123']->repeat(14)) call matchaddpos('Search', range(1, 12)->map({i, v -> [v, v]})) ]]) screen:expect([[ - {1:^1}234567890123 | - 1{1:2}34567890123 | - 12{1:3}4567890123 | - 123{1:4}567890123 | - 1234{1:5}67890123 | - 12345{1:6}7890123 | - 123456{1:7}890123 | - 1234567{1:8}90123 | - 12345678{1:9}0123 | - 123456789{1:0}123 | - 1234567890{1:1}23 | - 12345678901{1:2}3 | + {10:^1}234567890123 | + 1{10:2}34567890123 | + 12{10:3}4567890123 | + 123{10:4}567890123 | + 1234{10:5}67890123 | + 12345{10:6}7890123 | + 123456{10:7}890123 | + 1234567{10:8}90123 | + 12345678{10:9}0123 | + 123456789{10:0}123 | + 1234567890{10:1}23 | + 12345678901{10:2}3 | 1234567890123 | | ]]) @@ -42,10 +38,6 @@ describe('match highlighting', function() -- oldtest: Test_match_in_linebreak() it('does not continue in linebreak vim-patch:8.2.3698', function() local screen = Screen.new(75, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() exec([=[ set breakindent linebreak breakat+=] @@ -53,20 +45,15 @@ describe('match highlighting', function() call matchaddpos('ErrorMsg', [[1, 51]]) ]=]) screen:expect([[ - ^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{1:]} | + ^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{9:]} | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | - {0:~ }|*7 + {1:~ }|*7 | ]]) end) it('is shown with incsearch vim-patch:8.2.3940', function() local screen = Screen.new(75, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.Yellow }, -- Search - [2] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() exec([[ set incsearch @@ -76,16 +63,16 @@ describe('match highlighting', function() screen:expect([[ ^0 | 1 | - {2:2} | + {9:2} | 3 | 4 | | ]]) feed(':s/0') screen:expect([[ - {1:0} | + {10:0} | 1 | - {2:2} | + {9:2} | 3 | 4 | :s/0^ | @@ -94,10 +81,6 @@ describe('match highlighting', function() it('on a Tab vim-patch:8.2.4062', function() local screen = Screen.new(75, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() exec([[ set linebreak @@ -105,8 +88,8 @@ describe('match highlighting', function() call matchadd('ErrorMsg', '\t') ]]) screen:expect([[ - {1: ^ }ix | - {0:~ }|*8 + {9: ^ }ix | + {1:~ }|*8 | ]]) end) diff --git a/test/functional/legacy/matchparen_spec.lua b/test/functional/legacy/matchparen_spec.lua index 137448acbd..7b3f7bd424 100644 --- a/test/functional/legacy/matchparen_spec.lua +++ b/test/functional/legacy/matchparen_spec.lua @@ -12,11 +12,6 @@ describe('matchparen', function() it('redraws properly after scrolling with scrolloff=1', function() local screen = Screen.new(30, 7) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true }, - [2] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, - }) - exec([[ source $VIMRUNTIME/plugin/matchparen.vim set scrolloff=1 @@ -26,13 +21,13 @@ describe('matchparen', function() feed('V<c-d><c-d>') screen:expect([[ - {2:{} | - {2:}} | - {2:{} | - {2:f} | + {17:{} | + {17:}} | + {17:{} | + {17:f} | ^g | } | - {1:-- VISUAL LINE --} | + {5:-- VISUAL LINE --} | ]]) end) @@ -116,13 +111,6 @@ describe('matchparen', function() it('is cleared when completion popup is shown', function() local screen = Screen.new(30, 9) screen:attach() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - [1] = { background = Screen.colors.Plum1 }, - [2] = { background = Screen.colors.Grey }, - [3] = { bold = true }, - [4] = { bold = true, foreground = Screen.colors.SeaGreen }, - }) exec([[ source $VIMRUNTIME/plugin/matchparen.vim @@ -138,11 +126,11 @@ describe('matchparen', function() aaa | aaaa | (aaa^) | - {1: aa }{0: }| - {2: aaa }{0: }| - {1: aaaa }{0: }| - {0:~ }| - {3:-- }{4:match 2 of 3} | + {4: aa }{1: }| + {12: aaa }{1: }| + {4: aaaa }{1: }| + {1:~ }| + {5:-- }{6:match 2 of 3} | ]], } end) diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua index a87398b158..8a21c8add7 100644 --- a/test/functional/legacy/messages_spec.lua +++ b/test/functional/legacy/messages_spec.lua @@ -16,12 +16,6 @@ describe('messages', function() -- oldtest: Test_warning_scroll() it('a warning causes scrolling if and only if it has a stacktrace', function() screen = Screen.new(75, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - [2] = { bold = true, reverse = true }, -- MsgSeparator - [3] = { foreground = Screen.colors.Red }, -- WarningMsg - }) screen:attach() -- When the warning comes from a script, messages are scrolled so that the @@ -35,14 +29,14 @@ describe('messages', function() screen:expect({ grid = [[ | - {0:~ }|*4 - {3:W10: Warning: Changing a readonly file}^ | + {1:~ }|*4 + {19:W10: Warning: Changing a readonly file}^ | ]], timeout = 500, }) screen:expect([[ ^ | - {0:~ }|*4 + {1:~ }|*4 Already at oldest change | ]]) end) @@ -50,10 +44,6 @@ describe('messages', function() -- oldtest: Test_message_not_cleared_after_mode() it('clearing mode does not remove message', function() screen = Screen.new(60, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() exec([[ nmap <silent> gx :call DebugSilent('normal')<CR> @@ -71,7 +61,7 @@ describe('messages', function() ^one | NoSuchFile | three | - {0:~ }|*6 + {1:~ }|*6 from DebugSilent normal | ]]) @@ -81,7 +71,7 @@ describe('messages', function() ^one | NoSuchFile | three | - {0:~ }|*6 + {1:~ }|*6 from DebugSilent visual | ]]) @@ -92,9 +82,9 @@ describe('messages', function() one | NoSuchFil^e | three | - {0:~ }|*5 + {1:~ }|*5 from DebugSilent visual | - {1:E447: Can't find file "NoSuchFile" in path} | + {9:E447: Can't find file "NoSuchFile" in path} | ]]) end) @@ -403,10 +393,6 @@ describe('messages', function() -- oldtest: Test_echo_verbose_system() it('verbose message before echo command', function() screen = Screen.new(60, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - }) screen:attach() command('cd ' .. nvim_dir) @@ -426,7 +412,7 @@ describe('messages', function() 4: foo | 5: foo | 6: foo | - {1:-- More --}^ | + {6:-- More --}^ | ]]) feed('<Space>') screen:expect([[ @@ -439,7 +425,7 @@ describe('messages', function() 13: foo | 14: foo | 15: foo | - {1:-- More --}^ | + {6:-- More --}^ | ]]) feed('b') screen:expect([[ @@ -452,7 +438,7 @@ describe('messages', function() 4: foo | 5: foo | 6: foo | - {1:-- More --}^ | + {6:-- More --}^ | ]]) -- do the same with 'cmdheight' set to 2 @@ -460,7 +446,7 @@ describe('messages', function() command('set ch=2') screen:expect([[ ^ | - {0:~ }|*7 + {1:~ }|*7 |*2 ]]) feed([[:4 verbose echo system('foo')<CR>]]) @@ -474,7 +460,7 @@ describe('messages', function() 4: foo | 5: foo | 6: foo | - {1:-- More --}^ | + {6:-- More --}^ | ]]) feed('<Space>') screen:expect([[ @@ -487,7 +473,7 @@ describe('messages', function() 13: foo | 14: foo | 15: foo | - {1:-- More --}^ | + {6:-- More --}^ | ]]) feed('b') screen:expect([[ @@ -500,37 +486,32 @@ describe('messages', function() 4: foo | 5: foo | 6: foo | - {1:-- More --}^ | + {6:-- More --}^ | ]]) end) -- oldtest: Test_quit_long_message() it('with control characters can be quit vim-patch:8.2.1844', function() screen = Screen.new(40, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - [2] = { foreground = Screen.colors.Blue }, -- SpecialKey - }) screen:attach() feed([[:echom range(9999)->join("\x01")<CR>]]) screen:expect([[ - 0{2:^A}1{2:^A}2{2:^A}3{2:^A}4{2:^A}5{2:^A}6{2:^A}7{2:^A}8{2:^A}9{2:^A}10{2:^A}11{2:^A}12| - {2:^A}13{2:^A}14{2:^A}15{2:^A}16{2:^A}17{2:^A}18{2:^A}19{2:^A}20{2:^A}21{2:^A}22| - {2:^A}23{2:^A}24{2:^A}25{2:^A}26{2:^A}27{2:^A}28{2:^A}29{2:^A}30{2:^A}31{2:^A}32| - {2:^A}33{2:^A}34{2:^A}35{2:^A}36{2:^A}37{2:^A}38{2:^A}39{2:^A}40{2:^A}41{2:^A}42| - {2:^A}43{2:^A}44{2:^A}45{2:^A}46{2:^A}47{2:^A}48{2:^A}49{2:^A}50{2:^A}51{2:^A}52| - {2:^A}53{2:^A}54{2:^A}55{2:^A}56{2:^A}57{2:^A}58{2:^A}59{2:^A}60{2:^A}61{2:^A}62| - {2:^A}63{2:^A}64{2:^A}65{2:^A}66{2:^A}67{2:^A}68{2:^A}69{2:^A}70{2:^A}71{2:^A}72| - {2:^A}73{2:^A}74{2:^A}75{2:^A}76{2:^A}77{2:^A}78{2:^A}79{2:^A}80{2:^A}81{2:^A}82| - {2:^A}83{2:^A}84{2:^A}85{2:^A}86{2:^A}87{2:^A}88{2:^A}89{2:^A}90{2:^A}91{2:^A}92| - {1:-- More --}^ | + 0{18:^A}1{18:^A}2{18:^A}3{18:^A}4{18:^A}5{18:^A}6{18:^A}7{18:^A}8{18:^A}9{18:^A}10{18:^A}11{18:^A}12| + {18:^A}13{18:^A}14{18:^A}15{18:^A}16{18:^A}17{18:^A}18{18:^A}19{18:^A}20{18:^A}21{18:^A}22| + {18:^A}23{18:^A}24{18:^A}25{18:^A}26{18:^A}27{18:^A}28{18:^A}29{18:^A}30{18:^A}31{18:^A}32| + {18:^A}33{18:^A}34{18:^A}35{18:^A}36{18:^A}37{18:^A}38{18:^A}39{18:^A}40{18:^A}41{18:^A}42| + {18:^A}43{18:^A}44{18:^A}45{18:^A}46{18:^A}47{18:^A}48{18:^A}49{18:^A}50{18:^A}51{18:^A}52| + {18:^A}53{18:^A}54{18:^A}55{18:^A}56{18:^A}57{18:^A}58{18:^A}59{18:^A}60{18:^A}61{18:^A}62| + {18:^A}63{18:^A}64{18:^A}65{18:^A}66{18:^A}67{18:^A}68{18:^A}69{18:^A}70{18:^A}71{18:^A}72| + {18:^A}73{18:^A}74{18:^A}75{18:^A}76{18:^A}77{18:^A}78{18:^A}79{18:^A}80{18:^A}81{18:^A}82| + {18:^A}83{18:^A}84{18:^A}85{18:^A}86{18:^A}87{18:^A}88{18:^A}89{18:^A}90{18:^A}91{18:^A}92| + {6:-- More --}^ | ]]) feed('q') screen:expect([[ ^ | - {0:~ }|*8 + {1:~ }|*8 | ]]) end) @@ -539,11 +520,6 @@ describe('messages', function() describe('mode is cleared when', function() before_each(function() screen = Screen.new(40, 6) - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [2] = { bold = true }, -- ModeMsg - [3] = { bold = true, reverse = true }, -- StatusLine - }) screen:attach() end) @@ -561,7 +537,7 @@ describe('messages', function() ^ | {1:~ }|*3 {3: }| - {2:-- INSERT --} | + {5:-- INSERT --} | ]]) feed('<C-C>') screen:expect([[ @@ -583,7 +559,7 @@ describe('messages', function() ^ | {1:~ }|*3 {3:[No Name] }| - {2:-- INSERT --} | + {5:-- INSERT --} | ]]) feed('<Esc>') screen:expect([[ @@ -600,7 +576,7 @@ describe('messages', function() screen:expect([[ ^ | {1:~ }|*4 - {2:-- (insert) --} | + {5:-- (insert) --} | ]]) feed('<C-C>') screen:expect([[ @@ -614,11 +590,6 @@ describe('messages', function() -- oldtest: Test_ask_yesno() it('y/n prompt works', function() screen = Screen.new(75, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - [2] = { bold = true, reverse = true }, -- MsgSeparator - }) screen:attach() command('set noincsearch nohlsearch inccommand=') command('call setline(1, range(1, 2))') @@ -627,57 +598,51 @@ describe('messages', function() screen:expect([[ 1 | 2 | - {0:~ }|*3 - {1:Backwards range given, OK to swap (y/n)?}^ | + {1:~ }|*3 + {6:Backwards range given, OK to swap (y/n)?}^ | ]]) feed('n') screen:expect([[ ^1 | 2 | - {0:~ }|*3 - {1:Backwards range given, OK to swap (y/n)?}n | + {1:~ }|*3 + {6:Backwards range given, OK to swap (y/n)?}n | ]]) feed(':2,1s/^/Esc/\n') screen:expect([[ 1 | 2 | - {0:~ }|*3 - {1:Backwards range given, OK to swap (y/n)?}^ | + {1:~ }|*3 + {6:Backwards range given, OK to swap (y/n)?}^ | ]]) feed('<Esc>') screen:expect([[ ^1 | 2 | - {0:~ }|*3 - {1:Backwards range given, OK to swap (y/n)?}n | + {1:~ }|*3 + {6:Backwards range given, OK to swap (y/n)?}n | ]]) feed(':2,1s/^/y/\n') screen:expect([[ 1 | 2 | - {0:~ }|*3 - {1:Backwards range given, OK to swap (y/n)?}^ | + {1:~ }|*3 + {6:Backwards range given, OK to swap (y/n)?}^ | ]]) feed('y') screen:expect([[ y1 | ^y2 | - {0:~ }|*3 - {1:Backwards range given, OK to swap (y/n)?}y | + {1:~ }|*3 + {6:Backwards range given, OK to swap (y/n)?}y | ]]) end) -- oldtest: Test_fileinfo_tabpage_cmdheight() it("fileinfo works when 'cmdheight' has just decreased", function() screen = Screen.new(40, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { bold = true }, -- TabLineSel - [2] = { underline = true, background = Screen.colors.LightGrey }, -- TabLine - [3] = { reverse = true }, -- TabLineFill - }) screen:attach() exec([[ @@ -688,17 +653,17 @@ describe('messages', function() set cmdheight=2 ]]) screen:expect([[ - {2: [No Name] }{1: [No Name] }{3: }{2:X}| + {24: [No Name] }{5: [No Name] }{2: }{24:X}| ^ | - {0:~ }|*2 + {1:~ }|*2 |*2 ]]) feed(':tabprev | edit Xfileinfo.txt<CR>') screen:expect([[ - {1: Xfileinfo.txt }{2: [No Name] }{3: }{2:X}| + {5: Xfileinfo.txt }{24: [No Name] }{2: }{24:X}| ^ | - {0:~ }|*3 + {1:~ }|*3 "Xfileinfo.txt" [New] | ]]) assert_alive() @@ -707,9 +672,6 @@ describe('messages', function() -- oldtest: Test_fileinfo_after_echo() it('fileinfo does not overwrite echo message vim-patch:8.2.4156', function() screen = Screen.new(40, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() exec([[ @@ -730,7 +692,7 @@ describe('messages', function() feed('0$') screen:expect([[ ^hi | - {0:~ }|*4 + {1:~ }|*4 'b' written | ]]) os.remove('b.txt') diff --git a/test/functional/legacy/move_spec.lua b/test/functional/legacy/move_spec.lua index 1500d48ad9..42951e4360 100644 --- a/test/functional/legacy/move_spec.lua +++ b/test/functional/legacy/move_spec.lua @@ -10,9 +10,6 @@ describe(':move', function() -- oldtest: Test_move_undo() it('redraws correctly when undone', function() local screen = Screen.new(60, 10) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() fn.setline(1, { 'First', 'Second', 'Third', 'Fourth' }) @@ -22,7 +19,7 @@ describe(':move', function() ^First | Third | Fourth | - {0:~ }|*5 + {1:~ }|*5 :move +1 | ]]) @@ -34,7 +31,7 @@ describe(':move', function() Second | Third | Fourth | - {0:~ }|*5 + {1:~ }|*5 | ]]) end) diff --git a/test/functional/legacy/normal_spec.lua b/test/functional/legacy/normal_spec.lua index 1dddeed033..8b7acccc2c 100644 --- a/test/functional/legacy/normal_spec.lua +++ b/test/functional/legacy/normal_spec.lua @@ -12,22 +12,21 @@ describe('normal', function() function() local screen = Screen.new(40, 19) screen:attach() - screen:set_default_attr_ids({ { foreground = Screen.colors.Brown } }) exec([[ set number foldmethod=diff scrolloff=0 call setline(1, map(range(1, 9), 'repeat(v:val, 200)')) norm Lj ]]) screen:expect([[ - {1: 2 }222222222222222222222222222222222222| - {1: }222222222222222222222222222222222222|*4 - {1: }22222222222222222222 | - {1: 3 }333333333333333333333333333333333333| - {1: }333333333333333333333333333333333333|*4 - {1: }33333333333333333333 | - {1: 4 }^444444444444444444444444444444444444| - {1: }444444444444444444444444444444444444|*4 - {1: }44444444444444444444 | + {8: 2 }222222222222222222222222222222222222| + {8: }222222222222222222222222222222222222|*4 + {8: }22222222222222222222 | + {8: 3 }333333333333333333333333333333333333| + {8: }333333333333333333333333333333333333|*4 + {8: }33333333333333333333 | + {8: 4 }^444444444444444444444444444444444444| + {8: }444444444444444444444444444444444444|*4 + {8: }44444444444444444444 | | ]]) end diff --git a/test/functional/legacy/number_spec.lua b/test/functional/legacy/number_spec.lua index c112532eed..4c4ff5c1da 100644 --- a/test/functional/legacy/number_spec.lua +++ b/test/functional/legacy/number_spec.lua @@ -214,10 +214,6 @@ describe("'number' and 'relativenumber'", function() -- oldtest: Test_relativenumber_callback() it('relative line numbers are updated if cursor is moved from timer', function() local screen = Screen.new(50, 8) - screen:set_default_attr_ids({ - [1] = { foreground = Screen.colors.Brown }, -- LineNr - [2] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText - }) screen:attach() exec([[ call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd']) @@ -232,22 +228,22 @@ describe("'number' and 'relativenumber'", function() ]]) screen:expect({ grid = [[ - {1: 3 }aaaaa | - {1: 2 }bbbbb | - {1: 1 }ccccc | - {1: 0 }^ddddd | - {2:~ }|*3 + {8: 3 }aaaaa | + {8: 2 }bbbbb | + {8: 1 }ccccc | + {8: 0 }^ddddd | + {1:~ }|*3 | ]], timeout = 100, }) screen:expect({ grid = [[ - {1: 0 }^aaaaa | - {1: 1 }bbbbb | - {1: 2 }ccccc | - {1: 3 }ddddd | - {2:~ }|*3 + {8: 0 }^aaaaa | + {8: 1 }bbbbb | + {8: 2 }ccccc | + {8: 3 }ddddd | + {1:~ }|*3 | ]], }) @@ -256,10 +252,6 @@ describe("'number' and 'relativenumber'", function() -- oldtest: Test_number_insert_delete_lines() it('line numbers are updated when deleting/inserting lines', function() local screen = Screen.new(50, 8) - screen:set_default_attr_ids({ - [1] = { foreground = Screen.colors.Brown }, -- LineNr - [2] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText - }) screen:attach() exec([[ call setline(1, range(1, 7)) @@ -267,37 +259,37 @@ describe("'number' and 'relativenumber'", function() call cursor(2, 1) ]]) local snapshot1 = [[ - {1: 1 }1 | - {1: 2 }^2 | - {1: 3 }3 | - {1: 4 }4 | - {1: 5 }5 | - {1: 6 }6 | - {1: 7 }7 | + {8: 1 }1 | + {8: 2 }^2 | + {8: 3 }3 | + {8: 4 }4 | + {8: 5 }5 | + {8: 6 }6 | + {8: 7 }7 | | ]] screen:expect(snapshot1) feed('dd') screen:expect([[ - {1: 1 }1 | - {1: 2 }^3 | - {1: 3 }4 | - {1: 4 }5 | - {1: 5 }6 | - {1: 6 }7 | - {2:~ }| + {8: 1 }1 | + {8: 2 }^3 | + {8: 3 }4 | + {8: 4 }5 | + {8: 5 }6 | + {8: 6 }7 | + {1:~ }| | ]]) feed('P') screen:expect(snapshot1) feed('2dd') screen:expect([[ - {1: 1 }1 | - {1: 2 }^4 | - {1: 3 }5 | - {1: 4 }6 | - {1: 5 }7 | - {2:~ }|*2 + {8: 1 }1 | + {8: 2 }^4 | + {8: 3 }5 | + {8: 4 }6 | + {8: 5 }7 | + {1:~ }|*2 | ]]) feed('P') diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index e8836f41db..78028f2f44 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -659,10 +659,6 @@ describe('smoothscroll', function() -- oldtest: Test_smoothscroll_zero_width() it('does not divide by zero with a narrow window', function() screen:try_resize(12, 2) - screen:set_default_attr_ids({ - [1] = { foreground = Screen.colors.Brown }, - [2] = { foreground = Screen.colors.Blue1, bold = true }, - }) exec([[ call setline(1, ['a'->repeat(100)]) set wrap smoothscroll number laststatus=0 @@ -672,12 +668,12 @@ describe('smoothscroll', function() wincmd v ]]) screen:expect([[ - {1: 1^ }│{1: }│{1: }│{1: }│{1: }| + {8: 1^ }│{8: }│{8: }│{8: }│{8: }| | ]]) feed('llllllllll<C-W>o') screen:expect([[ - {2:<<<}{1: }aa^aaaaaa| + {1:<<<}{8: }aa^aaaaaa| | ]]) end) @@ -757,12 +753,6 @@ describe('smoothscroll', function() -- oldtest: Test_smoothscroll_incsearch() it('does not reset skipcol when doing incremental search on the same word', function() screen:try_resize(40, 8) - screen:set_default_attr_ids({ - [1] = { foreground = Screen.colors.Brown }, - [2] = { foreground = Screen.colors.Blue1, bold = true }, - [3] = { background = Screen.colors.Yellow1 }, - [4] = { reverse = true }, - }) exec([[ set smoothscroll number scrolloff=0 incsearch call setline(1, repeat([''], 20)) @@ -771,46 +761,46 @@ describe('smoothscroll', function() ]]) feed('/b') screen:expect([[ - {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | - {1: 12 } | - {1: 13 } | - {1: 14 }{4:b}{3:bbb} | - {1: 15 } | - {1: 16 } | - {1: 17 } | + {1:<<<}{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | + {8: 12 } | + {8: 13 } | + {8: 14 }{2:b}{10:bbb} | + {8: 15 } | + {8: 16 } | + {8: 17 } | /b^ | ]]) feed('b') screen:expect([[ - {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | - {1: 12 } | - {1: 13 } | - {1: 14 }{4:bb}{3:bb} | - {1: 15 } | - {1: 16 } | - {1: 17 } | + {1:<<<}{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | + {8: 12 } | + {8: 13 } | + {8: 14 }{2:bb}{10:bb} | + {8: 15 } | + {8: 16 } | + {8: 17 } | /bb^ | ]]) feed('b') screen:expect([[ - {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | - {1: 12 } | - {1: 13 } | - {1: 14 }{4:bbb}b | - {1: 15 } | - {1: 16 } | - {1: 17 } | + {1:<<<}{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | + {8: 12 } | + {8: 13 } | + {8: 14 }{2:bbb}b | + {8: 15 } | + {8: 16 } | + {8: 17 } | /bbb^ | ]]) feed('b') screen:expect([[ - {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | - {1: 12 } | - {1: 13 } | - {1: 14 }{4:bbbb} | - {1: 15 } | - {1: 16 } | - {1: 17 } | + {1:<<<}{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa | + {8: 12 } | + {8: 13 } | + {8: 14 }{2:bbbb} | + {8: 15 } | + {8: 16 } | + {8: 17 } | /bbbb^ | ]]) end) @@ -818,10 +808,6 @@ describe('smoothscroll', function() -- oldtest: Test_smoothscroll_multi_skipcol() it('scrolling multiple lines and stopping at non-zero skipcol', function() screen:try_resize(40, 10) - screen:set_default_attr_ids({ - [0] = { foreground = Screen.colors.Blue, bold = true }, - [1] = { background = Screen.colors.Grey90 }, - }) exec([[ setlocal cursorline scrolloff=0 smoothscroll call setline(1, repeat([''], 8)) @@ -832,7 +818,7 @@ describe('smoothscroll', function() redraw ]]) screen:expect([[ - {1:^ }| + {21:^ }| | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| aaaaaaaaaa | @@ -844,22 +830,22 @@ describe('smoothscroll', function() ]]) feed('3<C-E>') screen:expect([[ - {0:<<<}{1:aaaaaa^a }| + {1:<<<}{21:aaaaaa^a }| aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| aaaaaaaaaa | |*2 bbb | ccc | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('2<C-E>') screen:expect([[ - {0:<<<}{1:aaaaaa^a }| + {1:<<<}{21:aaaaaa^a }| |*2 bbb | ccc | - {0:~ }|*4 + {1:~ }|*4 | ]]) end) @@ -867,12 +853,6 @@ describe('smoothscroll', function() -- oldtest: Test_smoothscroll_zero_width_scroll_cursor_bot() it('does not divide by zero in zero-width window', function() screen:try_resize(40, 19) - screen:set_default_attr_ids({ - [1] = { foreground = Screen.colors.Brown }, -- LineNr - [2] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [3] = { bold = true, reverse = true }, -- StatusLine - [4] = { reverse = true }, -- StatusLineNC - }) exec([[ silent normal yy silent normal 19p @@ -885,10 +865,10 @@ describe('smoothscroll', function() silent normal 20G ]]) screen:expect([[ - {1: }│ | - {2:@}│ |*15 - {2:^@}│ | - {3:< }{4:[No Name] [+] }| + {8: }│ | + {1:@}│ |*15 + {1:^@}│ | + {3:< }{2:[No Name] [+] }| | ]]) end) @@ -1085,41 +1065,37 @@ describe('smoothscroll', function() end) it('works with very long line', function() - screen:set_default_attr_ids({ - [1] = { foreground = Screen.colors.Brown }, - [2] = { foreground = Screen.colors.Blue1, bold = true }, - }) exec([[ edit test/functional/fixtures/bigfile_oneline.txt setlocal smoothscroll number ]]) screen:expect([[ - {1: 1 }^0000;<control>;Cc;0;BN;;;;;N;NULL;;;| - {1: }; 0001;<control>;Cc;0;BN;;;;;N;START| - {1: } OF HEADING;;;; 0002;<control>;Cc;0;| - {1: }BN;;;;;N;START OF TEXT;;;; 0003;<con| - {1: }trol>;Cc;0;BN;;;;;N;END OF TEXT;;;; | - {1: }0004;<control>;Cc;0;BN;;;;;N;END OF | - {1: }TRANSMISSION;;;; 0005;<control>;Cc;0| - {1: };BN;;;;;N;ENQUIRY;;;; 0006;<control>| - {1: };Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; 0007;| - {1: }<control>;Cc;0;BN;;;;;N;BELL;;;; 000| - {1: }8;<control>;Cc;0;BN;;;;;N;BACKSPACE;| + {8: 1 }^0000;<control>;Cc;0;BN;;;;;N;NULL;;;| + {8: }; 0001;<control>;Cc;0;BN;;;;;N;START| + {8: } OF HEADING;;;; 0002;<control>;Cc;0;| + {8: }BN;;;;;N;START OF TEXT;;;; 0003;<con| + {8: }trol>;Cc;0;BN;;;;;N;END OF TEXT;;;; | + {8: }0004;<control>;Cc;0;BN;;;;;N;END OF | + {8: }TRANSMISSION;;;; 0005;<control>;Cc;0| + {8: };BN;;;;;N;ENQUIRY;;;; 0006;<control>| + {8: };Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; 0007;| + {8: }<control>;Cc;0;BN;;;;;N;BELL;;;; 000| + {8: }8;<control>;Cc;0;BN;;;;;N;BACKSPACE;| | ]]) feed('j') screen:expect([[ - {2:<<<}{1: }CJK COMPATIBILITY IDEOGRAPH-2F91F;Lo| - {1: };0;L;243AB;;;;N;;;;; 2F920;CJK COMPA| - {1: }TIBILITY IDEOGRAPH-2F920;Lo;0;L;7228| - {1: };;;;N;;;;; 2F921;CJK COMPATIBILITY I| - {1: }DEOGRAPH-2F921;Lo;0;L;7235;;;;N;;;;;| - {1: } 2F922;CJK COMPATIBILITY IDEOGRAPH-2| - {1: }F922;Lo;0;L;7250;;;;N;;;;; | - {1: 2 }^2F923;CJK COMPATIBILITY IDEOGRAPH-2F| - {1: }923;Lo;0;L;24608;;;;N;;;;; | - {1: 3 }2F924;CJK COMPATIBILITY IDEOGRAPH-2F| - {1: }924;Lo;0;L;7280;;;;N;;;;; | + {1:<<<}{8: }CJK COMPATIBILITY IDEOGRAPH-2F91F;Lo| + {8: };0;L;243AB;;;;N;;;;; 2F920;CJK COMPA| + {8: }TIBILITY IDEOGRAPH-2F920;Lo;0;L;7228| + {8: };;;;N;;;;; 2F921;CJK COMPATIBILITY I| + {8: }DEOGRAPH-2F921;Lo;0;L;7235;;;;N;;;;;| + {8: } 2F922;CJK COMPATIBILITY IDEOGRAPH-2| + {8: }F922;Lo;0;L;7250;;;;N;;;;; | + {8: 2 }^2F923;CJK COMPATIBILITY IDEOGRAPH-2F| + {8: }923;Lo;0;L;24608;;;;N;;;;; | + {8: 3 }2F924;CJK COMPATIBILITY IDEOGRAPH-2F| + {8: }924;Lo;0;L;7280;;;;N;;;;; | | ]]) end) diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 2fda341123..53f0b10855 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -745,11 +745,6 @@ describe('Search highlight', function() -- oldtest: Test_hlsearch_dump() it('beyond line end vim-patch:8.2.2542', function() local screen = Screen.new(50, 6) - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [2] = { background = Screen.colors.Yellow }, -- Search - [3] = { background = Screen.colors.Grey90 }, -- CursorLine - }) screen:attach() exec([[ set hlsearch noincsearch cursorline @@ -759,8 +754,8 @@ describe('Search highlight', function() ]]) feed([[/\_.*<CR>]]) screen:expect([[ - {2:xxx } |*2 - {2:^xxx }{3: }| + {10:xxx } |*2 + {10:^xxx }{21: }| {1:~ }|*2 /\_.* | ]]) diff --git a/test/functional/legacy/source_spec.lua b/test/functional/legacy/source_spec.lua index 7a19541a77..050cfbea19 100644 --- a/test/functional/legacy/source_spec.lua +++ b/test/functional/legacy/source_spec.lua @@ -16,16 +16,12 @@ describe(':source!', function() ]] ) local screen = Screen.new(75, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg - }) screen:attach() feed(':source! Xscript.vim\n') screen:expect([[ ^ | - {0:~ }|*4 - {1:E22: Scripts nested too deep} | + {1:~ }|*4 + {9:E22: Scripts nested too deep} | ]]) os.remove('Xscript.vim') end) diff --git a/test/functional/legacy/statusline_spec.lua b/test/functional/legacy/statusline_spec.lua index 567e829879..77f906c89a 100644 --- a/test/functional/legacy/statusline_spec.lua +++ b/test/functional/legacy/statusline_spec.lua @@ -15,11 +15,6 @@ describe('statusline', function() end) it('is updated in cmdline mode when using window-local statusline vim-patch:8.2.2737', function() - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [2] = { bold = true, reverse = true }, -- StatusLine - [3] = { reverse = true }, -- StatusLineNC - }) exec([[ setlocal statusline=-%{mode()}- split @@ -28,30 +23,25 @@ describe('statusline', function() screen:expect([[ ^ | {1:~ }| - {2:+n+ }| + {3:+n+ }| | {1:~ }| - {3:-n- }| + {2:-n- }| | ]]) feed(':') screen:expect([[ | {1:~ }| - {2:+c+ }| + {3:+c+ }| | {1:~ }| - {3:-c- }| + {2:-c- }| :^ | ]]) end) it('truncated item does not cause off-by-one highlight vim-patch:8.2.4929', function() - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [2] = { foreground = Screen.colors.Blue }, -- User1 - [3] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- User2 - }) exec([[ set laststatus=2 hi! link User1 Directory @@ -61,20 +51,13 @@ describe('statusline', function() screen:expect([[ ^ | {1:~ }|*4 - {3:<F}{2:GHI }| + {9:<F}{18:GHI }| | ]]) end) -- oldtest: Test_statusline_showcmd() it('showcmdloc=statusline works', function() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [2] = { bold = true }, -- MoreMsg - [3] = { bold = true, reverse = true }, -- StatusLine - [5] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue }, -- Folded - }) exec([[ func MyStatusLine() return '%S' @@ -92,9 +75,9 @@ describe('statusline', function() feed('g') screen:expect([[ - {5:+-- 2 lines: a···································}| + {13:+-- 2 lines: a···································}| ^c | - {0:~ }|*3 + {1:~ }|*3 {3:g }| | ]]) @@ -105,19 +88,19 @@ describe('statusline', function() ^a | b | c | - {0:~ }|*2 + {1:~ }|*2 {3: }| | ]]) feed('<C-V>Gl') screen:expect([[ - {1:a} | - {1:b} | - {1:c}^ | - {0:~ }|*2 + {17:a} | + {17:b} | + {17:c}^ | + {1:~ }|*2 {3:3x2 }| - {2:-- VISUAL BLOCK --} | + {5:-- VISUAL BLOCK --} | ]]) feed('<Esc>1234') @@ -125,7 +108,7 @@ describe('statusline', function() a | b | ^c | - {0:~ }|*2 + {1:~ }|*2 {3:1234 }| | ]]) @@ -137,7 +120,7 @@ describe('statusline', function() a | b | ^c | - {0:~ }|*2 + {1:~ }|*2 {3:[No Name] [+] 1234 }| : | ]]) diff --git a/test/functional/legacy/substitute_spec.lua b/test/functional/legacy/substitute_spec.lua index b462c10202..94a0bbd39e 100644 --- a/test/functional/legacy/substitute_spec.lua +++ b/test/functional/legacy/substitute_spec.lua @@ -209,11 +209,6 @@ describe(':substitute', function() it('first char is highlighted with confirmation dialog and empty match', function() local screen = Screen.new(60, 8) - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { reverse = true }, -- IncSearch - [2] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - }) screen:attach() exec([[ set nohlsearch noincsearch @@ -221,11 +216,11 @@ describe(':substitute', function() ]]) feed(':%s/^/ /c<CR>') screen:expect([[ - {1:o}ne | + {2:o}ne | two | three | - {0:~ }|*4 - {2:replace with (y/n/a/q/l/^E/^Y)?}^ | + {1:~ }|*4 + {6:replace with (y/n/a/q/l/^E/^Y)?}^ | ]]) end) end) diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua index 683c7d9bd7..54ebb51430 100644 --- a/test/functional/legacy/tabline_spec.lua +++ b/test/functional/legacy/tabline_spec.lua @@ -16,14 +16,6 @@ describe('tabline', function() -- oldtest: Test_tabline_showcmd() it('showcmdloc=tabline works', function() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - [2] = { bold = true }, -- MoreMsg, TabLineSel - [3] = { reverse = true }, -- TabLineFill - [4] = { background = Screen.colors.LightGrey, underline = true }, -- TabLine - [5] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue }, -- Folded - }) exec([[ func MyTabLine() return '%S' @@ -41,41 +33,41 @@ describe('tabline', function() feed('g') screen:expect([[ - {3:g }| - {5:+-- 2 lines: a···································}| + {2:g }| + {13:+-- 2 lines: a···································}| ^c | - {0:~ }|*3 + {1:~ }|*3 | ]]) -- typing "gg" should open the fold feed('g') screen:expect([[ - {3: }| + {2: }| ^a | b | c | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<C-V>Gl') screen:expect([[ - {3:3x2 }| - {1:a} | - {1:b} | - {1:c}^ | - {0:~ }|*2 - {2:-- VISUAL BLOCK --} | + {2:3x2 }| + {17:a} | + {17:b} | + {17:c}^ | + {1:~ }|*2 + {5:-- VISUAL BLOCK --} | ]]) feed('<Esc>1234') screen:expect([[ - {3:1234 }| + {2:1234 }| a | b | ^c | - {0:~ }|*2 + {1:~ }|*2 | ]]) @@ -83,11 +75,11 @@ describe('tabline', function() feed(':<CR>') feed('1234') screen:expect([[ - {2: + [No Name] }{3: }{4:1234}{3: }| + {5: + [No Name] }{2: }{24:1234}{2: }| a | b | ^c | - {0:~ }|*2 + {1:~ }|*2 : | ]]) end) diff --git a/test/functional/legacy/visual_spec.lua b/test/functional/legacy/visual_spec.lua index 151e5874e1..001a44a15c 100644 --- a/test/functional/legacy/visual_spec.lua +++ b/test/functional/legacy/visual_spec.lua @@ -12,11 +12,6 @@ describe('Visual highlight', function() before_each(function() screen = Screen.new(50, 6) - screen:set_default_attr_ids({ - [0] = { foreground = Screen.colors.Blue, bold = true }, -- NonText - [1] = { bold = true }, -- ModeMsg - [2] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual - }) screen:attach() end) @@ -30,20 +25,20 @@ describe('Visual highlight', function() feed('<C-V>gg$') screen:expect([[ - {2:aaaaaa}^ | - {2:bbbb } | - {2:cc } | - {0:~ }|*2 - {1:-- VISUAL BLOCK --} | + {17:aaaaaa}^ | + {17:bbbb } | + {17:cc } | + {1:~ }|*2 + {5:-- VISUAL BLOCK --} | ]]) feed('<Esc>gg<C-V>G$') screen:expect([[ - {2:aaaaaa } | - {2:bbbb } | - {2:cc}^ {2: } | - {0:~ }|*2 - {1:-- VISUAL BLOCK --} | + {17:aaaaaa } | + {17:bbbb } | + {17:cc}^ {17: } | + {1:~ }|*2 + {5:-- VISUAL BLOCK --} | ]]) end) @@ -57,9 +52,9 @@ describe('Visual highlight', function() screen:expect([[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^a| - {0:+}{2:aaaa}aaaaaa | - {0:~ }|*3 - {1:-- VISUAL --} | + {1:+}{17:aaaa}aaaaaa | + {1:~ }|*3 + {5:-- VISUAL --} | ]]) end) end) diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua index 3cd3a69239..8482bf34f7 100644 --- a/test/functional/legacy/window_cmd_spec.lua +++ b/test/functional/legacy/window_cmd_spec.lua @@ -10,9 +10,6 @@ local feed = helpers.feed it('scrolling with laststatus=0 and :botright split', function() clear('--cmd', 'set ruler') local screen = Screen.new(40, 10) - screen:set_default_attr_ids({ - [1] = { reverse = true }, -- StatusLineNC - }) screen:attach() exec([[ set laststatus=0 @@ -25,7 +22,7 @@ it('scrolling with laststatus=0 and :botright split', function() 98 | 99 | 100 | - {1:[No Name] [+] 100,1 Bot}| + {2:[No Name] [+] 100,1 Bot}| 97 | 98 | 99 | |