mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	refactor(tests): use more global highlight definitions
This commit is contained in:
		| @@ -125,11 +125,6 @@ describe('api/buf', function() | ||||
|  | ||||
|     it('cursor position is maintained consistently with viewport', function() | ||||
|       local screen = Screen.new(20, 12) | ||||
|       screen:set_default_attr_ids { | ||||
|         [1] = { bold = true, foreground = Screen.colors.Blue1 }, | ||||
|         [2] = { reverse = true, bold = true }, | ||||
|         [3] = { reverse = true }, | ||||
|       } | ||||
|       screen:attach() | ||||
|  | ||||
|       local lines = { 'line1', 'line2', 'line3', 'line4', 'line5', 'line6' } | ||||
| @@ -143,11 +138,11 @@ describe('api/buf', function() | ||||
|         grid = [[ | ||||
|         ^                    | | ||||
|         {1:~                   }|*4 | ||||
|         {2:[No Name]           }| | ||||
|         {3:[No Name]           }| | ||||
|         line5               | | ||||
|         line6               | | ||||
|         {1:~                   }|*2 | ||||
|         {3:[No Name] [+]       }| | ||||
|         {2:[No Name] [+]       }| | ||||
|                             | | ||||
|       ]], | ||||
|       } | ||||
| @@ -158,11 +153,11 @@ describe('api/buf', function() | ||||
|         grid = [[ | ||||
|         ^                    | | ||||
|         {1:~                   }|*4 | ||||
|         {2:[No Name]           }| | ||||
|         {3:[No Name]           }| | ||||
|         boogalo 5           | | ||||
|         line6               | | ||||
|         {1:~                   }|*2 | ||||
|         {3:[No Name] [+]       }| | ||||
|         {2:[No Name] [+]       }| | ||||
|                             | | ||||
|       ]], | ||||
|       } | ||||
| @@ -172,11 +167,11 @@ describe('api/buf', function() | ||||
|         grid = [[ | ||||
|                             | | ||||
|         {1:~                   }|*4 | ||||
|         {3:[No Name]           }| | ||||
|         {2:[No Name]           }| | ||||
|         boogalo 5           | | ||||
|         ^line6               | | ||||
|         {1:~                   }|*2 | ||||
|         {2:[No Name] [+]       }| | ||||
|         {3:[No Name] [+]       }| | ||||
|                             | | ||||
|       ]], | ||||
|       } | ||||
| @@ -216,11 +211,6 @@ describe('api/buf', function() | ||||
|       local screen | ||||
|       before_each(function() | ||||
|         screen = Screen.new(20, 12) | ||||
|         screen:set_default_attr_ids { | ||||
|           [1] = { bold = true, foreground = Screen.colors.Blue1 }, | ||||
|           [2] = { reverse = true, bold = true }, | ||||
|           [3] = { reverse = true }, | ||||
|         } | ||||
|         screen:attach() | ||||
|         api.nvim_buf_set_lines( | ||||
|           0, | ||||
| @@ -243,12 +233,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           ^zzz                 | | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -258,12 +248,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           ^zzz                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -274,12 +264,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           ^zzz                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -290,12 +280,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           ^zzz                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|           unchanged = true, | ||||
| @@ -306,12 +296,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           ^yyy                 | | ||||
|           zzz                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -321,12 +311,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           mmmeeeee            | | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           ^yyy                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -343,12 +333,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|           ^                    | | ||||
|           {1:~                   }|*4 | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -358,12 +348,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|           ^                    | | ||||
|           {1:~                   }|*4 | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -374,12 +364,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|           ^                    | | ||||
|           {1:~                   }|*4 | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -389,12 +379,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|           ^                    | | ||||
|           {1:~                   }|*4 | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|           unchanged = true, | ||||
| @@ -416,12 +406,12 @@ describe('api/buf', function() | ||||
|           ccc                 | | ||||
|           ddd                 | | ||||
|           www                 | | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -434,12 +424,12 @@ describe('api/buf', function() | ||||
|           ddd                 | | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -453,12 +443,12 @@ describe('api/buf', function() | ||||
|           ddd                 | | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -471,12 +461,12 @@ describe('api/buf', function() | ||||
|           ddd                 | | ||||
|           mmm                 | | ||||
|           wwweeee             | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|           wwweeee             | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -745,10 +735,6 @@ describe('api/buf', function() | ||||
|  | ||||
|     it("set_lines of invisible buffer doesn't move cursor in current window", function() | ||||
|       local screen = Screen.new(20, 5) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [1] = { bold = true, foreground = Screen.colors.Blue1 }, | ||||
|         [2] = { bold = true }, | ||||
|       }) | ||||
|       screen:attach() | ||||
|  | ||||
|       insert([[ | ||||
| @@ -771,7 +757,7 @@ describe('api/buf', function() | ||||
|         A real window       | | ||||
|         with proper tex^t    | | ||||
|         {1:~                   }| | ||||
|         {2:-- INSERT --}        | | ||||
|         {5:-- INSERT --}        | | ||||
|       ]]) | ||||
|     end) | ||||
|  | ||||
| @@ -1756,11 +1742,6 @@ describe('api/buf', function() | ||||
|       local screen | ||||
|       before_each(function() | ||||
|         screen = Screen.new(20, 12) | ||||
|         screen:set_default_attr_ids { | ||||
|           [1] = { bold = true, foreground = Screen.colors.Blue1 }, | ||||
|           [2] = { reverse = true, bold = true }, | ||||
|           [3] = { reverse = true }, | ||||
|         } | ||||
|         screen:attach() | ||||
|         api.nvim_buf_set_lines( | ||||
|           0, | ||||
| @@ -1783,12 +1764,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           ^zzz                 | | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -1798,12 +1779,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|                               | | ||||
|           {1:~                   }|*4 | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           ^zzz                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -1820,12 +1801,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|           ^                    | | ||||
|           {1:~                   }|*4 | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -1835,12 +1816,12 @@ describe('api/buf', function() | ||||
|           grid = [[ | ||||
|           ^                    | | ||||
|           {1:~                   }|*4 | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -1861,12 +1842,12 @@ describe('api/buf', function() | ||||
|           ccc                 | | ||||
|           ddd                 | | ||||
|           www                 | | ||||
|           {2:[No Name]           }| | ||||
|           {3:[No Name]           }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name]           }| | ||||
|           {2:[No Name]           }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
| @@ -1879,12 +1860,12 @@ describe('api/buf', function() | ||||
|           ddd                 | | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           {2:[No Name] [+]       }| | ||||
|           {3:[No Name] [+]       }| | ||||
|           www                 | | ||||
|           xxx                 | | ||||
|           yyy                 | | ||||
|           zzz                 | | ||||
|           {3:[No Name] [+]       }| | ||||
|           {2:[No Name] [+]       }| | ||||
|                               | | ||||
|         ]], | ||||
|         } | ||||
|   | ||||
| @@ -367,14 +367,11 @@ describe('API', function() | ||||
|     it('displays messages when opts.output=false', function() | ||||
|       local screen = Screen.new(40, 8) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|       }) | ||||
|       api.nvim_exec2("echo 'hello'", { output = false }) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*6 | ||||
|         {1:~                                       }|*6 | ||||
|         hello                                   | | ||||
|       ]], | ||||
|       } | ||||
| @@ -383,14 +380,11 @@ describe('API', function() | ||||
|     it("doesn't display messages when output=true", function() | ||||
|       local screen = Screen.new(40, 6) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|       }) | ||||
|       api.nvim_exec2("echo 'hello'", { output = true }) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*4 | ||||
|         {1:~                                       }|*4 | ||||
|                                                 | | ||||
|       ]], | ||||
|       } | ||||
| @@ -403,7 +397,7 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*4 | ||||
|         {1:~                                       }|*4 | ||||
|         15                                      | | ||||
|       ]], | ||||
|       } | ||||
| @@ -1533,16 +1527,12 @@ describe('API', function() | ||||
|       eq({ 1, 5 }, api.nvim_win_get_cursor(0)) | ||||
|  | ||||
|       local screen = Screen.new(60, 3) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [1] = { background = Screen.colors.Yellow }, | ||||
|       }) | ||||
|       screen:attach() | ||||
|       eq(1, eval('v:hlsearch')) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|          {1:foo} {1:^foo} {1:foo}                                                | | ||||
|         {0:~                                                           }| | ||||
|          {10:foo} {10:^foo} {10:foo}                                                | | ||||
|         {1:~                                                           }| | ||||
|                                                                     | | ||||
|       ]], | ||||
|       } | ||||
| @@ -1551,7 +1541,7 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|          foo ^foo foo                                                | | ||||
|         {0:~                                                           }| | ||||
|         {1:~                                                           }| | ||||
|                                                                     | | ||||
|       ]], | ||||
|       } | ||||
| @@ -1559,8 +1549,8 @@ describe('API', function() | ||||
|       eq(1, eval('v:hlsearch')) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|          {1:foo} {1:^foo} {1:foo}                                                | | ||||
|         {0:~                                                           }| | ||||
|          {10:foo} {10:^foo} {10:foo}                                                | | ||||
|         {1:~                                                           }| | ||||
|                                                                     | | ||||
|       ]], | ||||
|       } | ||||
| @@ -2254,12 +2244,6 @@ describe('API', function() | ||||
|     before_each(function() | ||||
|       screen = Screen.new(40, 8) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [1] = { bold = true, foreground = Screen.colors.SeaGreen }, | ||||
|         [2] = { bold = true, reverse = true }, | ||||
|         [3] = { foreground = Screen.colors.Blue }, | ||||
|       }) | ||||
|     end) | ||||
|  | ||||
|     it('prints long messages correctly #20534', function() | ||||
| @@ -2287,11 +2271,11 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*3 | ||||
|         {2:                                        }| | ||||
|         {1:~                                       }|*3 | ||||
|         {3:                                        }| | ||||
|                                                 | | ||||
|         a                                       | | ||||
|         {1:Press ENTER or type command to continue}^ | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]], | ||||
|       } | ||||
|       feed('<CR>') | ||||
| @@ -2299,12 +2283,12 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*2 | ||||
|         {2:                                        }| | ||||
|         {1:~                                       }|*2 | ||||
|         {3:                                        }| | ||||
|         b                                       | | ||||
|                                                 | | ||||
|         c                                       | | ||||
|         {1:Press ENTER or type command to continue}^ | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]], | ||||
|       } | ||||
|     end) | ||||
| @@ -2314,11 +2298,11 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*3 | ||||
|         {2:                                        }| | ||||
|         aaa{3:^@}bbb{3:^@^@}ccc                         | | ||||
|         ddd{3:^@^@^@}eee                            | | ||||
|         {1:Press ENTER or type command to continue}^ | | ||||
|         {1:~                                       }|*3 | ||||
|         {3:                                        }| | ||||
|         aaa{18:^@}bbb{18:^@^@}ccc                         | | ||||
|         ddd{18:^@^@^@}eee                            | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]], | ||||
|       } | ||||
|     end) | ||||
| @@ -2330,20 +2314,14 @@ describe('API', function() | ||||
|     before_each(function() | ||||
|       screen = Screen.new(40, 8) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [1] = { foreground = Screen.colors.White, background = Screen.colors.Red }, | ||||
|         [2] = { bold = true, foreground = Screen.colors.SeaGreen }, | ||||
|         [3] = { bold = true, reverse = true }, | ||||
|       }) | ||||
|     end) | ||||
|  | ||||
|     it('can show one line', function() | ||||
|       async_meths.nvim_err_write('has bork\n') | ||||
|       screen:expect([[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*6 | ||||
|         {1:has bork}                                | | ||||
|         {1:~                                       }|*6 | ||||
|         {9:has bork}                                | | ||||
|       ]]) | ||||
|     end) | ||||
|  | ||||
| @@ -2351,11 +2329,11 @@ describe('API', function() | ||||
|       async_meths.nvim_err_write('something happened\nvery bad\n') | ||||
|       screen:expect([[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*3 | ||||
|         {1:~                                       }|*3 | ||||
|         {3:                                        }| | ||||
|         {1:something happened}                      | | ||||
|         {1:very bad}                                | | ||||
|         {2:Press ENTER or type command to continue}^ | | ||||
|         {9:something happened}                      | | ||||
|         {9:very bad}                                | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]]) | ||||
|     end) | ||||
|  | ||||
| @@ -2363,13 +2341,13 @@ describe('API', function() | ||||
|       async_meths.nvim_err_write('FAILURE\nERROR\nEXCEPTION\nTRACEBACK\n') | ||||
|       screen:expect([[ | ||||
|                                                 | | ||||
|         {0:~                                       }| | ||||
|         {1:~                                       }| | ||||
|         {3:                                        }| | ||||
|         {1:FAILURE}                                 | | ||||
|         {1:ERROR}                                   | | ||||
|         {1:EXCEPTION}                               | | ||||
|         {1:TRACEBACK}                               | | ||||
|         {2:Press ENTER or type command to continue}^ | | ||||
|         {9:FAILURE}                                 | | ||||
|         {9:ERROR}                                   | | ||||
|         {9:EXCEPTION}                               | | ||||
|         {9:TRACEBACK}                               | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]]) | ||||
|     end) | ||||
|  | ||||
| @@ -2379,8 +2357,8 @@ describe('API', function() | ||||
|       async_meths.nvim_err_write('fail\n') | ||||
|       screen:expect([[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*6 | ||||
|         {1:very fail}                               | | ||||
|         {1:~                                       }|*6 | ||||
|         {9:very fail}                               | | ||||
|       ]]) | ||||
|       n.poke_eventloop() | ||||
|  | ||||
| @@ -2388,11 +2366,11 @@ describe('API', function() | ||||
|       async_meths.nvim_err_write('more fail\ntoo fail\n') | ||||
|       screen:expect([[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*3 | ||||
|         {1:~                                       }|*3 | ||||
|         {3:                                        }| | ||||
|         {1:more fail}                               | | ||||
|         {1:too fail}                                | | ||||
|         {2:Press ENTER or type command to continue}^ | | ||||
|         {9:more fail}                               | | ||||
|         {9:too fail}                                | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]]) | ||||
|       feed('<cr>') -- exit the press ENTER screen | ||||
|     end) | ||||
| @@ -2402,11 +2380,11 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*3 | ||||
|         {1:~                                       }|*3 | ||||
|         {3:                                        }| | ||||
|         {1:aaa^@bbb^@^@ccc}                         | | ||||
|         {1:ddd^@^@^@eee}                            | | ||||
|         {2:Press ENTER or type command to continue}^ | | ||||
|         {9:aaa^@bbb^@^@ccc}                         | | ||||
|         {9:ddd^@^@^@eee}                            | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]], | ||||
|       } | ||||
|     end) | ||||
| @@ -2418,30 +2396,24 @@ describe('API', function() | ||||
|     before_each(function() | ||||
|       screen = Screen.new(40, 8) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [1] = { foreground = Screen.colors.White, background = Screen.colors.Red }, | ||||
|         [2] = { bold = true, foreground = Screen.colors.SeaGreen }, | ||||
|         [3] = { bold = true, reverse = true }, | ||||
|       }) | ||||
|     end) | ||||
|  | ||||
|     it('shows only one return prompt after all lines are shown', function() | ||||
|       async_meths.nvim_err_writeln('FAILURE\nERROR\nEXCEPTION\nTRACEBACK') | ||||
|       screen:expect([[ | ||||
|                                                 | | ||||
|         {0:~                                       }| | ||||
|         {1:~                                       }| | ||||
|         {3:                                        }| | ||||
|         {1:FAILURE}                                 | | ||||
|         {1:ERROR}                                   | | ||||
|         {1:EXCEPTION}                               | | ||||
|         {1:TRACEBACK}                               | | ||||
|         {2:Press ENTER or type command to continue}^ | | ||||
|         {9:FAILURE}                                 | | ||||
|         {9:ERROR}                                   | | ||||
|         {9:EXCEPTION}                               | | ||||
|         {9:TRACEBACK}                               | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]]) | ||||
|       feed('<CR>') | ||||
|       screen:expect([[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*6 | ||||
|         {1:~                                       }|*6 | ||||
|                                                 | | ||||
|       ]]) | ||||
|     end) | ||||
| @@ -3102,9 +3074,6 @@ describe('API', function() | ||||
|       eq(1, api.nvim_get_current_buf()) | ||||
|  | ||||
|       local screen = Screen.new(20, 4) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [1] = { bold = true, foreground = Screen.colors.Blue1 }, | ||||
|       }) | ||||
|       screen:attach() | ||||
|  | ||||
|       -- | ||||
| @@ -3458,13 +3427,6 @@ describe('API', function() | ||||
|     before_each(function() | ||||
|       screen = Screen.new(40, 8) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [1] = { bold = true, foreground = Screen.colors.SeaGreen }, | ||||
|         [2] = { bold = true, reverse = true }, | ||||
|         [3] = { foreground = Screen.colors.Brown, bold = true }, -- Statement | ||||
|         [4] = { foreground = Screen.colors.SlateBlue }, -- Special | ||||
|       }) | ||||
|       command('highlight Statement gui=bold guifg=Brown') | ||||
|       command('highlight Special guifg=SlateBlue') | ||||
|     end) | ||||
| @@ -3474,7 +3436,7 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*6 | ||||
|         {1:~                                       }|*6 | ||||
|         msg                                     | | ||||
|       ]], | ||||
|       } | ||||
| @@ -3489,8 +3451,8 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*6 | ||||
|         msg_a{3:msg_b}{4:msg_c}                         | | ||||
|         {1:~                                       }|*6 | ||||
|         msg_a{15:msg_b}{16:msg_c}                         | | ||||
|       ]], | ||||
|       } | ||||
|     end) | ||||
| @@ -3500,11 +3462,11 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                 | | ||||
|         {0:~                                       }|*3 | ||||
|         {2:                                        }| | ||||
|         {3:msg_a}                                   | | ||||
|         {3:msg_a}{4:msg_b}                              | | ||||
|         {1:Press ENTER or type command to continue}^ | | ||||
|         {1:~                                       }|*3 | ||||
|         {3:                                        }| | ||||
|         {15:msg_a}                                   | | ||||
|         {15:msg_a}{16:msg_b}                              | | ||||
|         {6:Press ENTER or type command to continue}^ | | ||||
|       ]], | ||||
|       } | ||||
|     end) | ||||
| @@ -3528,24 +3490,16 @@ describe('API', function() | ||||
|     before_each(function() | ||||
|       screen = Screen.new(100, 35) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [1] = { background = Screen.colors.Plum1 }, | ||||
|         [2] = { background = tonumber('0xffff40'), bg_indexed = true }, | ||||
|         [3] = { | ||||
|           background = Screen.colors.Plum1, | ||||
|           fg_indexed = true, | ||||
|           foreground = tonumber('0x00e000'), | ||||
|         }, | ||||
|         [4] = { bold = true, reverse = true, background = Screen.colors.Plum1 }, | ||||
|         [5] = { | ||||
|           foreground = Screen.colors.Blue, | ||||
|       screen:add_extra_attr_ids { | ||||
|         [100] = { background = tonumber('0xffff40'), bg_indexed = true }, | ||||
|         [101] = { | ||||
|           background = Screen.colors.LightMagenta, | ||||
|           bold = true, | ||||
|           foreground = tonumber('0x00e000'), | ||||
|           fg_indexed = true, | ||||
|         }, | ||||
|         [6] = { bold = true }, | ||||
|         [7] = { reverse = true, background = Screen.colors.LightMagenta }, | ||||
|       }) | ||||
|         [102] = { background = Screen.colors.LightMagenta, reverse = true }, | ||||
|         [103] = { background = Screen.colors.LightMagenta, bold = true, reverse = true }, | ||||
|       } | ||||
|     end) | ||||
|  | ||||
|     it('can batch process sequences', function() | ||||
| @@ -3561,38 +3515,38 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                                                                                    | | ||||
|         {0:~}{1::smile                                                                         }{0:                    }| | ||||
|         {0:~}{1:                            }{2:oooo$$$$$$$$$$$$oooo}{1:                               }{0:                    }| | ||||
|         {0:~}{1:                        }{2:oo$$$$$$$$$$$$$$$$$$$$$$$$o}{1:                            }{0:                    }| | ||||
|         {0:~}{1:                     }{2:oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o}{1:         }{2:o$}{1:   }{2:$$}{1: }{2:o$}{1:      }{0:                    }| | ||||
|         {0:~}{1:     }{2:o}{1: }{2:$}{1: }{2:oo}{1:        }{2:o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o}{1:       }{2:$$}{1: }{2:$$}{1: }{2:$$o$}{1:     }{0:                    }| | ||||
|         {0:~}{1:  }{2:oo}{1: }{2:$}{1: }{2:$}{1: "}{2:$}{1:      }{2:o$$$$$$$$$}{1:    }{2:$$$$$$$$$$$$$}{1:    }{2:$$$$$$$$$o}{1:       }{2:$$$o$$o$}{1:      }{0:                    }| | ||||
|         {0:~}{1:  "}{2:$$$$$$o$}{1:     }{2:o$$$$$$$$$}{1:      }{2:$$$$$$$$$$$}{1:      }{2:$$$$$$$$$$o}{1:    }{2:$$$$$$$$}{1:       }{0:                    }| | ||||
|         {0:~}{1:    }{2:$$$$$$$}{1:    }{2:$$$$$$$$$$$}{1:      }{2:$$$$$$$$$$$}{1:      }{2:$$$$$$$$$$$$$$$$$$$$$$$}{1:       }{0:                    }| | ||||
|         {0:~}{1:    }{2:$$$$$$$$$$$$$$$$$$$$$$$}{1:    }{2:$$$$$$$$$$$$$}{1:    }{2:$$$$$$$$$$$$$$}{1:  """}{2:$$$}{1:         }{0:                    }| | ||||
|         {0:~}{1:     "}{2:$$$}{1:""""}{2:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:     "}{2:$$$}{1:        }{0:                    }| | ||||
|         {0:~}{1:      }{2:$$$}{1:   }{2:o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:     "}{2:$$$o}{1:      }{0:                    }| | ||||
|         {0:~}{1:     }{2:o$$}{1:"   }{2:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:       }{2:$$$o}{1:     }{0:                    }| | ||||
|         {0:~}{1:     }{2:$$$}{1:    }{2:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:" "}{2:$$$$$$ooooo$$$$o}{1:   }{0:                    }| | ||||
|         {0:~}{1:    }{2:o$$$oooo$$$$$}{1:  }{2:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:   }{2:o$$$$$$$$$$$$$$$$$}{1:  }{0:                    }| | ||||
|         {0:~}{1:    }{2:$$$$$$$$}{1:"}{2:$$$$}{1:   }{2:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:     }{2:$$$$}{1:""""""""        }{0:                    }| | ||||
|         {0:~}{1:   """"       }{2:$$$$}{1:    "}{2:$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{1:"      }{2:o$$$}{1:                 }{0:                    }| | ||||
|         {0:~}{1:              "}{2:$$$o}{1:     """}{2:$$$$$$$$$$$$$$$$$$}{1:"}{2:$$}{1:"         }{2:$$$}{1:                  }{0:                    }| | ||||
|         {0:~}{1:                }{2:$$$o}{1:          "}{2:$$}{1:""}{2:$$$$$$}{1:""""           }{2:o$$$}{1:                   }{0:                    }| | ||||
|         {0:~}{1:                 }{2:$$$$o}{1:                                }{2:o$$$}{1:"                    }{0:                    }| | ||||
|         {0:~}{1:                  "}{2:$$$$o}{1:      }{2:o$$$$$$o}{1:"}{2:$$$$o}{1:        }{2:o$$$$}{1:                      }{0:                    }| | ||||
|         {0:~}{1:                    "}{2:$$$$$oo}{1:     ""}{2:$$$$o$$$$$o}{1:   }{2:o$$$$}{1:""                       }{0:                    }| | ||||
|         {0:~}{1:                       ""}{2:$$$$$oooo}{1:  "}{2:$$$o$$$$$$$$$}{1:"""                          }{0:                    }| | ||||
|         {0:~}{1:                          ""}{2:$$$$$$$oo}{1: }{2:$$$$$$$$$$}{1:                               }{0:                    }| | ||||
|         {0:~}{1:                                  """"}{2:$$$$$$$$$$$}{1:                              }{0:                    }| | ||||
|         {0:~}{1:                                      }{2:$$$$$$$$$$$$}{1:                             }{0:                    }| | ||||
|         {0:~}{1:                                       }{2:$$$$$$$$$$}{1:"                             }{0:                    }| | ||||
|         {0:~}{1:                                        "}{2:$$$}{1:""""                               }{0:                    }| | ||||
|         {0:~}{1:                                                                               }{0:                    }| | ||||
|         {0:~}{3:Press ENTER or type command to continue}{1:                                        }{0:                    }| | ||||
|         {0:~}{4:term://~/config2/docs/pres//32693:vim --clean +smile         29,39          All}{0:                    }| | ||||
|         {0:~}{1::call nvim__screenshot("smile2.cat")                                           }{0:                    }| | ||||
|         {0:~                                                                                                   }|*2 | ||||
|         {1:~}{4::smile                                                                         }{1:                    }| | ||||
|         {1:~}{4:                            }{100:oooo$$$$$$$$$$$$oooo}{4:                               }{1:                    }| | ||||
|         {1:~}{4:                        }{100:oo$$$$$$$$$$$$$$$$$$$$$$$$o}{4:                            }{1:                    }| | ||||
|         {1:~}{4:                     }{100:oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o}{4:         }{100:o$}{4:   }{100:$$}{4: }{100:o$}{4:      }{1:                    }| | ||||
|         {1:~}{4:     }{100:o}{4: }{100:$}{4: }{100:oo}{4:        }{100:o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o}{4:       }{100:$$}{4: }{100:$$}{4: }{100:$$o$}{4:     }{1:                    }| | ||||
|         {1:~}{4:  }{100:oo}{4: }{100:$}{4: }{100:$}{4: "}{100:$}{4:      }{100:o$$$$$$$$$}{4:    }{100:$$$$$$$$$$$$$}{4:    }{100:$$$$$$$$$o}{4:       }{100:$$$o$$o$}{4:      }{1:                    }| | ||||
|         {1:~}{4:  "}{100:$$$$$$o$}{4:     }{100:o$$$$$$$$$}{4:      }{100:$$$$$$$$$$$}{4:      }{100:$$$$$$$$$$o}{4:    }{100:$$$$$$$$}{4:       }{1:                    }| | ||||
|         {1:~}{4:    }{100:$$$$$$$}{4:    }{100:$$$$$$$$$$$}{4:      }{100:$$$$$$$$$$$}{4:      }{100:$$$$$$$$$$$$$$$$$$$$$$$}{4:       }{1:                    }| | ||||
|         {1:~}{4:    }{100:$$$$$$$$$$$$$$$$$$$$$$$}{4:    }{100:$$$$$$$$$$$$$}{4:    }{100:$$$$$$$$$$$$$$}{4:  """}{100:$$$}{4:         }{1:                    }| | ||||
|         {1:~}{4:     "}{100:$$$}{4:""""}{100:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:     "}{100:$$$}{4:        }{1:                    }| | ||||
|         {1:~}{4:      }{100:$$$}{4:   }{100:o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:     "}{100:$$$o}{4:      }{1:                    }| | ||||
|         {1:~}{4:     }{100:o$$}{4:"   }{100:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:       }{100:$$$o}{4:     }{1:                    }| | ||||
|         {1:~}{4:     }{100:$$$}{4:    }{100:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:" "}{100:$$$$$$ooooo$$$$o}{4:   }{1:                    }| | ||||
|         {1:~}{4:    }{100:o$$$oooo$$$$$}{4:  }{100:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:   }{100:o$$$$$$$$$$$$$$$$$}{4:  }{1:                    }| | ||||
|         {1:~}{4:    }{100:$$$$$$$$}{4:"}{100:$$$$}{4:   }{100:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:     }{100:$$$$}{4:""""""""        }{1:                    }| | ||||
|         {1:~}{4:   """"       }{100:$$$$}{4:    "}{100:$$$$$$$$$$$$$$$$$$$$$$$$$$$$}{4:"      }{100:o$$$}{4:                 }{1:                    }| | ||||
|         {1:~}{4:              "}{100:$$$o}{4:     """}{100:$$$$$$$$$$$$$$$$$$}{4:"}{100:$$}{4:"         }{100:$$$}{4:                  }{1:                    }| | ||||
|         {1:~}{4:                }{100:$$$o}{4:          "}{100:$$}{4:""}{100:$$$$$$}{4:""""           }{100:o$$$}{4:                   }{1:                    }| | ||||
|         {1:~}{4:                 }{100:$$$$o}{4:                                }{100:o$$$}{4:"                    }{1:                    }| | ||||
|         {1:~}{4:                  "}{100:$$$$o}{4:      }{100:o$$$$$$o}{4:"}{100:$$$$o}{4:        }{100:o$$$$}{4:                      }{1:                    }| | ||||
|         {1:~}{4:                    "}{100:$$$$$oo}{4:     ""}{100:$$$$o$$$$$o}{4:   }{100:o$$$$}{4:""                       }{1:                    }| | ||||
|         {1:~}{4:                       ""}{100:$$$$$oooo}{4:  "}{100:$$$o$$$$$$$$$}{4:"""                          }{1:                    }| | ||||
|         {1:~}{4:                          ""}{100:$$$$$$$oo}{4: }{100:$$$$$$$$$$}{4:                               }{1:                    }| | ||||
|         {1:~}{4:                                  """"}{100:$$$$$$$$$$$}{4:                              }{1:                    }| | ||||
|         {1:~}{4:                                      }{100:$$$$$$$$$$$$}{4:                             }{1:                    }| | ||||
|         {1:~}{4:                                       }{100:$$$$$$$$$$}{4:"                             }{1:                    }| | ||||
|         {1:~}{4:                                        "}{100:$$$}{4:""""                               }{1:                    }| | ||||
|         {1:~}{4:                                                                               }{1:                    }| | ||||
|         {1:~}{101:Press ENTER or type command to continue}{4:                                        }{1:                    }| | ||||
|         {1:~}{103:term://~/config2/docs/pres//32693:vim --clean +smile         29,39          All}{1:                    }| | ||||
|         {1:~}{4::call nvim__screenshot("smile2.cat")                                           }{1:                    }| | ||||
|         {1:~                                                                                                   }|*2 | ||||
|                                                                                                             | | ||||
|       ]], | ||||
|       } | ||||
| @@ -3624,9 +3578,9 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                           | | ||||
|         {0:~}{1:^                                        }{0:         }| | ||||
|         {0:~}{1:                                        }{0:         }|*4 | ||||
|         {0:~                                                 }|*3 | ||||
|         {1:~}{4:^                                        }{1:         }| | ||||
|         {1:~}{4:                                        }{1:         }|*4 | ||||
|         {1:~                                                 }|*3 | ||||
|                                                           | | ||||
|       ]], | ||||
|       } | ||||
| @@ -3635,10 +3589,10 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                           | | ||||
|         {0:~}{7: }{1:                                       }{0:         }| | ||||
|         {0:~}{1:                                        }{0:         }|*4 | ||||
|         {0:~                                                 }|*3 | ||||
|         {6:-- TERMINAL --}                                    | | ||||
|         {1:~}{102: }{4:                                       }{1:         }| | ||||
|         {1:~}{4:                                        }{1:         }|*4 | ||||
|         {1:~                                                 }|*3 | ||||
|         {5:-- TERMINAL --}                                    | | ||||
|       ]], | ||||
|       } | ||||
|  | ||||
| @@ -3651,10 +3605,10 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|                                                           | | ||||
|         {0:~}{1:herrejösses!}{7: }{1:                           }{0:         }| | ||||
|         {0:~}{1:                                        }{0:         }|*4 | ||||
|         {0:~                                                 }|*3 | ||||
|         {6:-- TERMINAL --}                                    | | ||||
|         {1:~}{4:herrejösses!}{102: }{4:                           }{1:         }| | ||||
|         {1:~}{4:                                        }{1:         }|*4 | ||||
|         {1:~                                                 }|*3 | ||||
|         {5:-- TERMINAL --}                                    | | ||||
|       ]], | ||||
|       } | ||||
|       eq('ba\024blaherrejösses!', exec_lua [[ return stream ]]) | ||||
| @@ -4472,10 +4426,6 @@ describe('API', function() | ||||
|     end) | ||||
|     it('does not interfere with printing line in Ex mode #19400', function() | ||||
|       local screen = Screen.new(60, 7) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText | ||||
|         [1] = { bold = true, reverse = true }, -- MsgSeparator | ||||
|       }) | ||||
|       screen:attach() | ||||
|       insert([[ | ||||
|         foo | ||||
| @@ -4484,8 +4434,8 @@ describe('API', function() | ||||
|       screen:expect([[ | ||||
|         foo                                                         | | ||||
|         bar                                                         | | ||||
|         {0:~                                                           }|*2 | ||||
|         {1:                                                            }| | ||||
|         {1:~                                                           }|*2 | ||||
|         {3:                                                            }| | ||||
|         Entering Ex mode.  Type "visual" to go to Normal mode.      | | ||||
|         :1^                                                          | | ||||
|       ]]) | ||||
| @@ -4494,7 +4444,7 @@ describe('API', function() | ||||
|       screen:expect([[ | ||||
|         foo                                                         | | ||||
|         bar                                                         | | ||||
|         {1:                                                            }| | ||||
|         {3:                                                            }| | ||||
|         Entering Ex mode.  Type "visual" to go to Normal mode.      | | ||||
|         :1                                                          | | ||||
|         foo                                                         | | ||||
| @@ -4934,14 +4884,11 @@ describe('API', function() | ||||
|     it("doesn't display messages when output=true", function() | ||||
|       local screen = Screen.new(40, 6) | ||||
|       screen:attach() | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|       }) | ||||
|       api.nvim_cmd({ cmd = 'echo', args = { [['hello']] } }, { output = true }) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*4 | ||||
|         {1:~                                       }|*4 | ||||
|                                                 | | ||||
|       ]], | ||||
|       } | ||||
| @@ -4954,7 +4901,7 @@ describe('API', function() | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         ^                                        | | ||||
|         {0:~                                       }|*4 | ||||
|         {1:~                                       }|*4 | ||||
|         15                                      | | ||||
|       ]], | ||||
|       } | ||||
|   | ||||
| @@ -170,11 +170,6 @@ describe('API/win', function() | ||||
|  | ||||
|     it('updates the screen, and also when the window is unfocused', function() | ||||
|       local screen = Screen.new(30, 9) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [1] = { bold = true, foreground = Screen.colors.Blue }, | ||||
|         [2] = { bold = true, reverse = true }, | ||||
|         [3] = { reverse = true }, | ||||
|       }) | ||||
|       screen:attach() | ||||
|  | ||||
|       insert('prologue') | ||||
| @@ -221,10 +216,10 @@ describe('API/win', function() | ||||
|         grid = [[ | ||||
|         ^                              | | ||||
|         {1:~                             }|*2 | ||||
|         {2:[No Name]                     }| | ||||
|         {3:[No Name]                     }| | ||||
|         prologue                      | | ||||
|                                       |*2 | ||||
|         {3:[No Name] [+]                 }| | ||||
|         {2:[No Name] [+]                 }| | ||||
|                                       | | ||||
|       ]], | ||||
|       } | ||||
| @@ -235,10 +230,10 @@ describe('API/win', function() | ||||
|         grid = [[ | ||||
|         ^                              | | ||||
|         {1:~                             }|*2 | ||||
|         {2:[No Name]                     }| | ||||
|         {3:[No Name]                     }| | ||||
|                                       |*2 | ||||
|         epilogue                      | | ||||
|         {3:[No Name] [+]                 }| | ||||
|         {2:[No Name] [+]                 }| | ||||
|                                       | | ||||
|       ]], | ||||
|       } | ||||
| @@ -249,10 +244,10 @@ describe('API/win', function() | ||||
|         grid = [[ | ||||
|         ^                              | | ||||
|         {1:~                             }|*2 | ||||
|         {2:[No Name]                     }| | ||||
|         {3:[No Name]                     }| | ||||
|         prologue                      | | ||||
|                                       |*2 | ||||
|         {3:[No Name] [+]                 }| | ||||
|         {2:[No Name] [+]                 }| | ||||
|                                       | | ||||
|       ]], | ||||
|       } | ||||
| @@ -286,12 +281,6 @@ describe('API/win', function() | ||||
|  | ||||
|     it('updates cursorline and statusline ruler in non-current window', function() | ||||
|       local screen = Screen.new(60, 8) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText | ||||
|         [2] = { background = Screen.colors.Grey90 }, -- CursorLine | ||||
|         [3] = { bold = true, reverse = true }, -- StatusLine | ||||
|         [4] = { reverse = true }, -- StatusLineNC | ||||
|       }) | ||||
|       screen:attach() | ||||
|       command('set ruler') | ||||
|       command('set cursorline') | ||||
| @@ -306,31 +295,25 @@ describe('API/win', function() | ||||
|         aaa                           │aaa                          | | ||||
|         bbb                           │bbb                          | | ||||
|         ccc                           │ccc                          | | ||||
|         {2:dd^d                           }│{2:ddd                          }| | ||||
|         {21:dd^d                           }│{21:ddd                          }| | ||||
|         {1:~                             }│{1:~                            }|*2 | ||||
|         {3:[No Name] [+]  4,3         All }{4:[No Name] [+]  4,3        All}| | ||||
|         {3:[No Name] [+]  4,3         All }{2:[No Name] [+]  4,3        All}| | ||||
|                                                                     | | ||||
|       ]]) | ||||
|       api.nvim_win_set_cursor(oldwin, { 1, 0 }) | ||||
|       screen:expect([[ | ||||
|         aaa                           │{2:aaa                          }| | ||||
|         aaa                           │{21:aaa                          }| | ||||
|         bbb                           │bbb                          | | ||||
|         ccc                           │ccc                          | | ||||
|         {2:dd^d                           }│ddd                          | | ||||
|         {21:dd^d                           }│ddd                          | | ||||
|         {1:~                             }│{1:~                            }|*2 | ||||
|         {3:[No Name] [+]  4,3         All }{4:[No Name] [+]  1,1        All}| | ||||
|         {3:[No Name] [+]  4,3         All }{2:[No Name] [+]  1,1        All}| | ||||
|                                                                     | | ||||
|       ]]) | ||||
|     end) | ||||
|  | ||||
|     it('updates cursorcolumn in non-current window', function() | ||||
|       local screen = Screen.new(60, 8) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText | ||||
|         [2] = { background = Screen.colors.Grey90 }, -- CursorColumn | ||||
|         [3] = { bold = true, reverse = true }, -- StatusLine | ||||
|         [4] = { reverse = true }, -- StatusLineNC | ||||
|       }) | ||||
|       screen:attach() | ||||
|       command('set cursorcolumn') | ||||
|       insert([[ | ||||
| @@ -341,22 +324,22 @@ describe('API/win', function() | ||||
|       local oldwin = curwin() | ||||
|       command('vsplit') | ||||
|       screen:expect([[ | ||||
|         aa{2:a}                           │aa{2:a}                          | | ||||
|         bb{2:b}                           │bb{2:b}                          | | ||||
|         cc{2:c}                           │cc{2:c}                          | | ||||
|         aa{21:a}                           │aa{21:a}                          | | ||||
|         bb{21:b}                           │bb{21:b}                          | | ||||
|         cc{21:c}                           │cc{21:c}                          | | ||||
|         dd^d                           │ddd                          | | ||||
|         {1:~                             }│{1:~                            }|*2 | ||||
|         {3:[No Name] [+]                  }{4:[No Name] [+]                }| | ||||
|         {3:[No Name] [+]                  }{2:[No Name] [+]                }| | ||||
|                                                                     | | ||||
|       ]]) | ||||
|       api.nvim_win_set_cursor(oldwin, { 2, 0 }) | ||||
|       screen:expect([[ | ||||
|         aa{2:a}                           │{2:a}aa                          | | ||||
|         bb{2:b}                           │bbb                          | | ||||
|         cc{2:c}                           │{2:c}cc                          | | ||||
|         dd^d                           │{2:d}dd                          | | ||||
|         aa{21:a}                           │{21:a}aa                          | | ||||
|         bb{21:b}                           │bbb                          | | ||||
|         cc{21:c}                           │{21:c}cc                          | | ||||
|         dd^d                           │{21:d}dd                          | | ||||
|         {1:~                             }│{1:~                            }|*2 | ||||
|         {3:[No Name] [+]                  }{4:[No Name] [+]                }| | ||||
|         {3:[No Name] [+]                  }{2:[No Name] [+]                }| | ||||
|                                                                     | | ||||
|       ]]) | ||||
|     end) | ||||
| @@ -874,22 +857,6 @@ describe('API/win', function() | ||||
|     it('with two diff windows', function() | ||||
|       local X = api.nvim_get_vvar('maxcol') | ||||
|       local screen = Screen.new(45, 22) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { foreground = Screen.colors.Blue1, bold = true }, | ||||
|         [1] = { foreground = Screen.colors.Blue4, background = Screen.colors.Grey }, | ||||
|         [2] = { foreground = Screen.colors.Brown }, | ||||
|         [3] = { | ||||
|           foreground = Screen.colors.Blue1, | ||||
|           background = Screen.colors.LightCyan1, | ||||
|           bold = true, | ||||
|         }, | ||||
|         [4] = { background = Screen.colors.LightBlue }, | ||||
|         [5] = { foreground = Screen.colors.Blue4, background = Screen.colors.LightGrey }, | ||||
|         [6] = { background = Screen.colors.Plum1 }, | ||||
|         [7] = { background = Screen.colors.Red, bold = true }, | ||||
|         [8] = { reverse = true }, | ||||
|         [9] = { bold = true, reverse = true }, | ||||
|       }) | ||||
|       screen:attach() | ||||
|       exec([[ | ||||
|         set diffopt+=context:2 number | ||||
| @@ -902,35 +869,35 @@ describe('API/win', function() | ||||
|       feed('24gg') | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         {1:  }{2:    }{3:----------------}│{1:  }{2:  1 }{4:00000001!       }| | ||||
|         {1:  }{2:    }{3:----------------}│{1:  }{2:  2 }{4:00000002!!      }| | ||||
|         {1:  }{2:  1 }00000003!!!     │{1:  }{2:  3 }00000003!!!     | | ||||
|         {1:  }{2:  2 }00000004!!!!    │{1:  }{2:  4 }00000004!!!!    | | ||||
|         {1:+ }{2:  3 }{5:+-- 14 lines: 00}│{1:+ }{2:  5 }{5:+-- 14 lines: 00}| | ||||
|         {1:  }{2: 17 }00000019!!!!!!!!│{1:  }{2: 19 }00000019!!!!!!!!| | ||||
|         {1:  }{2: 18 }00000020!!!!!!!!│{1:  }{2: 20 }00000020!!!!!!!!| | ||||
|         {1:  }{2:    }{3:----------------}│{1:  }{2: 21 }{4:00000025!!!!!!!!}| | ||||
|         {1:  }{2:    }{3:----------------}│{1:  }{2: 22 }{4:00000026!!!!!!!!}| | ||||
|         {1:  }{2:    }{3:----------------}│{1:  }{2: 23 }{4:00000027!!!!!!!!}| | ||||
|         {1:  }{2: 19 }00000028!!!!!!!!│{1:  }{2: 24 }^00000028!!!!!!!!| | ||||
|         {1:  }{2: 20 }00000029!!!!!!!!│{1:  }{2: 25 }00000029!!!!!!!!| | ||||
|         {1:+ }{2: 21 }{5:+-- 14 lines: 00}│{1:+ }{2: 26 }{5:+-- 14 lines: 00}| | ||||
|         {1:  }{2: 35 }00000044!!!!!!!!│{1:  }{2: 40 }00000044!!!!!!!!| | ||||
|         {1:  }{2: 36 }00000045!!!!!!!!│{1:  }{2: 41 }00000045!!!!!!!!| | ||||
|         {1:  }{2: 37 }{4:00000046!!!!!!!!}│{1:  }{2:    }{3:----------------}| | ||||
|         {1:  }{2: 38 }{4:00000047!!!!!!!!}│{1:  }{2:    }{3:----------------}| | ||||
|         {1:  }{2: 39 }{4:00000048!!!!!!!!}│{1:  }{2:    }{3:----------------}| | ||||
|         {1:  }{2: 40 }{4:00000049!!!!!!!!}│{1:  }{2:    }{3:----------------}| | ||||
|         {1:  }{2: 41 }{4:00000050!!!!!!!!}│{1:  }{2:    }{3:----------------}| | ||||
|         {8:[No Name] [+]          }{9:[No Name] [+]         }| | ||||
|         {7:  }{8:    }{23:----------------}│{7:  }{8:  1 }{22:00000001!       }| | ||||
|         {7:  }{8:    }{23:----------------}│{7:  }{8:  2 }{22:00000002!!      }| | ||||
|         {7:  }{8:  1 }00000003!!!     │{7:  }{8:  3 }00000003!!!     | | ||||
|         {7:  }{8:  2 }00000004!!!!    │{7:  }{8:  4 }00000004!!!!    | | ||||
|         {7:+ }{8:  3 }{13:+-- 14 lines: 00}│{7:+ }{8:  5 }{13:+-- 14 lines: 00}| | ||||
|         {7:  }{8: 17 }00000019!!!!!!!!│{7:  }{8: 19 }00000019!!!!!!!!| | ||||
|         {7:  }{8: 18 }00000020!!!!!!!!│{7:  }{8: 20 }00000020!!!!!!!!| | ||||
|         {7:  }{8:    }{23:----------------}│{7:  }{8: 21 }{22:00000025!!!!!!!!}| | ||||
|         {7:  }{8:    }{23:----------------}│{7:  }{8: 22 }{22:00000026!!!!!!!!}| | ||||
|         {7:  }{8:    }{23:----------------}│{7:  }{8: 23 }{22:00000027!!!!!!!!}| | ||||
|         {7:  }{8: 19 }00000028!!!!!!!!│{7:  }{8: 24 }^00000028!!!!!!!!| | ||||
|         {7:  }{8: 20 }00000029!!!!!!!!│{7:  }{8: 25 }00000029!!!!!!!!| | ||||
|         {7:+ }{8: 21 }{13:+-- 14 lines: 00}│{7:+ }{8: 26 }{13:+-- 14 lines: 00}| | ||||
|         {7:  }{8: 35 }00000044!!!!!!!!│{7:  }{8: 40 }00000044!!!!!!!!| | ||||
|         {7:  }{8: 36 }00000045!!!!!!!!│{7:  }{8: 41 }00000045!!!!!!!!| | ||||
|         {7:  }{8: 37 }{22:00000046!!!!!!!!}│{7:  }{8:    }{23:----------------}| | ||||
|         {7:  }{8: 38 }{22:00000047!!!!!!!!}│{7:  }{8:    }{23:----------------}| | ||||
|         {7:  }{8: 39 }{22:00000048!!!!!!!!}│{7:  }{8:    }{23:----------------}| | ||||
|         {7:  }{8: 40 }{22:00000049!!!!!!!!}│{7:  }{8:    }{23:----------------}| | ||||
|         {7:  }{8: 41 }{22:00000050!!!!!!!!}│{7:  }{8:    }{23:----------------}| | ||||
|         {2:[No Name] [+]          }{3:[No Name] [+]         }| | ||||
|                                                      | | ||||
|       ]], | ||||
|       } | ||||
|       screen:try_resize(45, 3) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         {1:  }{2: 19 }00000028!!!!!!!!│{1:  }{2: 24 }^00000028!!!!!!!!| | ||||
|         {8:[No Name] [+]          }{9:[No Name] [+]         }| | ||||
|         {7:  }{8: 19 }00000028!!!!!!!!│{7:  }{8: 24 }^00000028!!!!!!!!| | ||||
|         {2:[No Name] [+]          }{3:[No Name] [+]         }| | ||||
|                                                      | | ||||
|       ]], | ||||
|       } | ||||
| @@ -1008,11 +975,6 @@ describe('API/win', function() | ||||
|     it('with wrapped lines', function() | ||||
|       local X = api.nvim_get_vvar('maxcol') | ||||
|       local screen = Screen.new(45, 22) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { foreground = Screen.colors.Blue1, bold = true }, | ||||
|         [1] = { foreground = Screen.colors.Brown }, | ||||
|         [2] = { background = Screen.colors.Yellow }, | ||||
|       }) | ||||
|       screen:attach() | ||||
|       exec([[ | ||||
|         set number cpoptions+=n | ||||
| @@ -1035,26 +997,26 @@ describe('API/win', function() | ||||
|       ) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         {1:  1 }^foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         {8:  1 }^foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         -foobar-foobar-foobar-foobar-foobar-foobar-fo| | ||||
|         obar-foobar-foobar-foobar-foobar-foobar-fooba| | ||||
|         r-foobar-foobar-foobar-foobar-foobar-foobar-f| | ||||
|         oobar-foobar-foobar-foobar-foobar-foobar-foob| | ||||
|         ar-foobar-foobar-foobar-foobar-              | | ||||
|         {1:  2 }foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         {8:  2 }foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         -foobar-foobar-foobar-foobar-foobar-foobar-fo| | ||||
|         obar-foobar-fo{2:???????????????}obar-foobar-foob| | ||||
|         obar-foobar-fo{10:???????????????}obar-foobar-foob| | ||||
|         ar-foobar-foobar-foobar-foobar-foobar-foobar-| | ||||
|         foobar-foobar-foobar-foobar-foobar-foobar-foo| | ||||
|         bar-foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         -                                            | | ||||
|         {1:  3 }foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         {8:  3 }foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         -foobar-foobar-foobar-foobar-foobar-foobar-fo| | ||||
|         obar-foobar-foobar-foobar-foobar-foobar-fooba| | ||||
|         r-foobar-foobar-foobar-foobar-foobar-foobar-f| | ||||
|         oobar-foobar-foobar-foob{2:!!!!!!!!!!!!!!!!!!!!!}| | ||||
|         {2:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}| | ||||
|         {2:!!!!!!!!!}ar-foobar-foobar-foobar-foobar-fooba| | ||||
|         oobar-foobar-foobar-foob{10:!!!!!!!!!!!!!!!!!!!!!}| | ||||
|         {10:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}| | ||||
|         {10:!!!!!!!!!}ar-foobar-foobar-foobar-foobar-fooba| | ||||
|         r-foobar-foobar-                             | | ||||
|                                                      | | ||||
|       ]], | ||||
| @@ -1062,7 +1024,7 @@ describe('API/win', function() | ||||
|       screen:try_resize(45, 2) | ||||
|       screen:expect { | ||||
|         grid = [[ | ||||
|         {1:  1 }^foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|         {8:  1 }^foobar-foobar-foobar-foobar-foobar-foobar| | ||||
|                                                      | | ||||
|       ]], | ||||
|       } | ||||
| @@ -2563,10 +2525,6 @@ describe('API/win', function() | ||||
|  | ||||
|     it('updates statusline when moving bottom split', function() | ||||
|       local screen = Screen.new(10, 10) | ||||
|       screen:set_default_attr_ids({ | ||||
|         [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText | ||||
|         [1] = { bold = true, reverse = true }, -- StatusLine | ||||
|       }) | ||||
|       screen:attach() | ||||
|       exec([[ | ||||
|         set laststatus=0 | ||||
| @@ -2575,10 +2533,10 @@ describe('API/win', function() | ||||
|       ]]) | ||||
|       screen:expect([[ | ||||
|         ^            | | ||||
|         {0:~           }|*3 | ||||
|         {1:[No Name]   }| | ||||
|         {1:~           }|*3 | ||||
|         {3:[No Name]   }| | ||||
|                     | | ||||
|         {0:~           }|*3 | ||||
|         {1:~           }|*3 | ||||
|                     | | ||||
|       ]]) | ||||
|     end) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bfredl
					bfredl