diff options
Diffstat (limited to 'test/functional/ui/cmdline_highlight_spec.lua')
-rw-r--r-- | test/functional/ui/cmdline_highlight_spec.lua | 298 |
1 files changed, 49 insertions, 249 deletions
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua index e4766103c2..3fddc4700a 100644 --- a/test/functional/ui/cmdline_highlight_spec.lua +++ b/test/functional/ui/cmdline_highlight_spec.lua @@ -182,100 +182,55 @@ describe('Command-line coloring', function() start_prompt() screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :^ | ]]) feed('e') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :e^ | ]]) feed('cho ') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo ^ | ]]) feed('(') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}^ | ]]) feed('(') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}{RBP2:(}^ | ]]) feed('42') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}{RBP2:(}42^ | ]]) feed('))') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}{RBP2:(}42{RBP2:)}{RBP1:)}^ | ]]) feed('<BS>') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}{RBP2:(}42{RBP2:)}^ | ]]) redraw_input() screen:expect{grid=[[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}{RBP2:(}42{RBP2:)}^ | ]], reset=true} end) @@ -285,12 +240,7 @@ describe('Command-line coloring', function() start_prompt('echo') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo^ | ]]) end) @@ -301,8 +251,7 @@ describe('Command-line coloring', function() start_prompt('echo "«') screen:expect{grid=[[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :echo " | {ERR:E5405: Chunk 0 start 7 splits multibyte }| @@ -312,8 +261,7 @@ describe('Command-line coloring', function() feed('»') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :echo " | {ERR:E5405: Chunk 0 start 7 splits multibyte }| @@ -327,8 +275,7 @@ describe('Command-line coloring', function() start_prompt('echo "«') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :echo " | {ERR:E5406: Chunk 0 end 7 splits multibyte ch}| @@ -355,12 +302,7 @@ describe('Command-line coloring', function() start_prompt('e') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :e^ | ]]) eq('', exec_capture('messages')) @@ -370,12 +312,7 @@ describe('Command-line coloring', function() start_prompt('e') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :e^ | ]]) eq('', exec_capture('messages')) @@ -385,12 +322,7 @@ describe('Command-line coloring', function() start_prompt('e') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :e^ | ]]) eq('', exec_capture('messages')) @@ -414,8 +346,7 @@ describe('Command-line coloring', function() start_prompt('let x = "«»«»«»«»«»"') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :let x = " | {ERR:E5405: Chunk 0 start 10 splits multibyte}| @@ -425,12 +356,7 @@ describe('Command-line coloring', function() feed('\n') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 | ]]) feed('\n') @@ -443,20 +369,14 @@ describe('Command-line coloring', function() start_prompt('echo 42') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 | ]]) screen:sleep(500) feed('<C-c>') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| : | {ERR:E5407: Callback has thrown an exception:}| @@ -466,23 +386,13 @@ describe('Command-line coloring', function() redraw_input() screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo 42^ | ]]) feed('\n') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo 42 | ]]) feed('\n') @@ -490,12 +400,7 @@ describe('Command-line coloring', function() feed('<C-c>') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 Type :qa and pre...nter> to exit Nvim | ]]) end) @@ -504,12 +409,7 @@ describe('Command-line coloring', function() start_prompt('echo ("<C-v><CR><C-v><Nul><C-v><NL>")') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}"{SK:^M^@^@}"{RBP1:)}^ | ]]) end) @@ -519,9 +419,7 @@ describe('Command-line coloring', function() start_prompt('#') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*3 {MSEP: }| : | {ERR:E5400: Callback should return list} | @@ -533,9 +431,7 @@ describe('Command-line coloring', function() start_prompt('#') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*3 {MSEP: }| : | {ERR:E5401: List item 1 is not a List} | @@ -547,8 +443,7 @@ describe('Command-line coloring', function() start_prompt('+') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :+ | {ERR:E5402: List item 1 has incorrect length:}| @@ -561,8 +456,7 @@ describe('Command-line coloring', function() start_prompt('+') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :+ | {ERR:E5403: Chunk 1 start 2 not in range [1, }| @@ -575,9 +469,7 @@ describe('Command-line coloring', function() start_prompt('+') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*3 {MSEP: }| :+ | {ERR:E5404: Chunk 1 end 3 not in range (1, 2]}| @@ -616,12 +508,7 @@ describe('Command-line coloring', function() start_prompt('1') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP1:1}^ | ]]) @@ -629,12 +516,7 @@ describe('Command-line coloring', function() start_prompt('2') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP2:2}^ | ]]) @@ -642,12 +524,7 @@ describe('Command-line coloring', function() start_prompt('3') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP3:3}^ | ]]) @@ -655,57 +532,32 @@ describe('Command-line coloring', function() start_prompt('4') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP4:4}^ | ]]) feed('<CR>') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP3:3}4^ | ]]) feed('<CR>') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP2:2}34^ | ]]) feed('<CR>') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :{RBP1:1}234^ | ]]) feed('<CR><CR><C-l>') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 | ]]) eq('1234', meths.get_var('out')) @@ -763,12 +615,7 @@ describe('Ex commands coloring', function() feed(':echo (((1)))') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :echo {RBP1:(}{RBP2:(}{RBP3:(}1{RBP3:)}{RBP2:)}{RBP1:)}^ | ]]) end) @@ -802,8 +649,7 @@ describe('Ex commands coloring', function() feed(':debug execute "echo 1"\n') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| Entering Debug mode. Type "cont" to con| tinue. | @@ -824,12 +670,7 @@ describe('Ex commands coloring', function() feed('\n') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 | ]]) end) @@ -838,8 +679,7 @@ describe('Ex commands coloring', function() feed(':#x') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*2 {MSEP: }| :# | {ERR:Error detected while processing :} | @@ -885,12 +725,7 @@ describe('Expressions coloring support', function() feed(':echo <C-r>=(((1)))') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 ={NPAR:(((}{NUM:1}{NPAR:)))}^ | ]]) end) @@ -902,12 +737,7 @@ describe('Expressions coloring support', function() feed(':<C-r>=1') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 ={NUM:1}^ | ]]) end) @@ -921,34 +751,19 @@ describe('Expressions coloring support', function() feed('i<C-r>="«»"«»') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 ={SQ:"}{SB:«»}{SQ:"}{E:«»}^ | ]]) feed('<C-c>') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 {M:-- INSERT --} | ]]) feed('<Esc>') screen:expect([[ ^ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 | ]]) feed(':<C-\\>e"<C-v><C-x>"<C-v><C-x>') @@ -956,35 +771,20 @@ describe('Expressions coloring support', function() -- highlighting. screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 ={SQ:"}{SB:^X}{SQ:"}{ERR:^X}^ | ]]) feed('<C-c>') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 :^ | ]]) funcs.setreg('a', {'\192'}) feed('<C-r>="<C-r><C-r>a"<C-r><C-r>a"foo"') screen:expect([[ | - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| - {EOB:~ }| + {EOB:~ }|*6 ={SQ:"}{SB:<c0>}{SQ:"}{E:<c0>"}{SB:foo}{E:"}^ | ]]) end) |