mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	fix(highlight): add StatusLineTerm/StatusLineTermNC to :color vim (#29313)
				
					
				
			Problem: both `StatusLineTerm`/`StatusLineTermNC` are now explicitly
  used, but `:color vim` does not set them to the values used in Vim.
  This might be fine if `:color vim` is treated as "the state of default
  color scheme prior the big update", but it seems to be better treated
  as "Vim's default color scheme" (how it is documented in its header).
Solution: add `StatusLineTerm`/`StatusLineTermNC` definitions to
  'runtime/colors/vim.lua'.
  Use explicit foreground colors ('Whte'/'Black') instead of `guifg=bg`
  used in source, as the latter caused some problems in the past (if
  `Normal` is not defined, `nvim_set_hl()` can't recognize `'bg'` as the
  foreground value).
  Also realign the rest of the background conditional highlight groups.
			
			
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							0a9c81d709
						
					
				
				
					commit
					458473acb8
				
			@@ -209,81 +209,85 @@ hi('@lsp.type.variable',      { link = 'Identifier' })
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if vim.o.background == 'light' then
 | 
					if vim.o.background == 'light' then
 | 
				
			||||||
  -- Default colors only used with a light background.
 | 
					  -- Default colors only used with a light background.
 | 
				
			||||||
  hi('ColorColumn',  { bg = 'LightRed',                            ctermbg = 'LightRed' })
 | 
					  hi('ColorColumn',      { bg = 'LightRed',                             ctermbg = 'LightRed' })
 | 
				
			||||||
  hi('CursorColumn', { bg = 'Grey90',                              ctermbg = 'LightGrey' })
 | 
					  hi('CursorColumn',     { bg = 'Grey90',                               ctermbg = 'LightGrey' })
 | 
				
			||||||
  hi('CursorLine',   { bg = 'Grey90',                              cterm = { underline = true } })
 | 
					  hi('CursorLine',       { bg = 'Grey90',                               cterm = { underline = true } })
 | 
				
			||||||
  hi('CursorLineNr', { fg = 'Brown', bold = true,                  ctermfg = 'Brown', cterm = { underline = true } })
 | 
					  hi('CursorLineNr',     { fg = 'Brown', bold = true,                   ctermfg = 'Brown', cterm = { underline = true } })
 | 
				
			||||||
  hi('DiffAdd',      { bg = 'LightBlue',                           ctermbg = 'LightBlue' })
 | 
					  hi('DiffAdd',          { bg = 'LightBlue',                            ctermbg = 'LightBlue' })
 | 
				
			||||||
  hi('DiffChange',   { bg = 'LightMagenta',                        ctermbg = 'LightMagenta' })
 | 
					  hi('DiffChange',       { bg = 'LightMagenta',                         ctermbg = 'LightMagenta' })
 | 
				
			||||||
  hi('DiffDelete',   { fg = 'Blue', bg = 'LightCyan', bold = true, ctermfg = 'Blue', ctermbg = 'LightCyan' })
 | 
					  hi('DiffDelete',       { fg = 'Blue', bg = 'LightCyan', bold = true,  ctermfg = 'Blue', ctermbg = 'LightCyan' })
 | 
				
			||||||
  hi('Directory',    { fg = 'Blue',                                ctermfg = 'DarkBlue' })
 | 
					  hi('Directory',        { fg = 'Blue',                                 ctermfg = 'DarkBlue' })
 | 
				
			||||||
  hi('FoldColumn',   { fg = 'DarkBlue', bg = 'Grey',               ctermfg = 'DarkBlue', ctermbg = 'Grey' })
 | 
					  hi('FoldColumn',       { fg = 'DarkBlue', bg = 'Grey',                ctermfg = 'DarkBlue', ctermbg = 'Grey' })
 | 
				
			||||||
  hi('Folded',       { fg = 'DarkBlue', bg = 'LightGrey',          ctermfg = 'DarkBlue', ctermbg = 'Grey' })
 | 
					  hi('Folded',           { fg = 'DarkBlue', bg = 'LightGrey',           ctermfg = 'DarkBlue', ctermbg = 'Grey' })
 | 
				
			||||||
  hi('LineNr',       { fg = 'Brown',                               ctermfg = 'Brown' })
 | 
					  hi('LineNr',           { fg = 'Brown',                                ctermfg = 'Brown' })
 | 
				
			||||||
  hi('MatchParen',   { bg = 'Cyan',                                ctermbg = 'Cyan' })
 | 
					  hi('MatchParen',       { bg = 'Cyan',                                 ctermbg = 'Cyan' })
 | 
				
			||||||
  hi('MoreMsg',      { fg = 'SeaGreen', bold = true,               ctermfg = 'DarkGreen' })
 | 
					  hi('MoreMsg',          { fg = 'SeaGreen', bold = true,                ctermfg = 'DarkGreen' })
 | 
				
			||||||
  hi('Pmenu',        { bg = 'LightMagenta',                        ctermfg = 'Black', ctermbg = 'LightMagenta' })
 | 
					  hi('Pmenu',            { bg = 'LightMagenta',                         ctermfg = 'Black', ctermbg = 'LightMagenta' })
 | 
				
			||||||
  hi('PmenuSel',     { bg = 'Grey',                                ctermfg = 'Black', ctermbg = 'LightGrey' })
 | 
					  hi('PmenuSel',         { bg = 'Grey',                                 ctermfg = 'Black', ctermbg = 'LightGrey' })
 | 
				
			||||||
  hi('PmenuThumb',   { bg = 'Black',                               ctermbg = 'Black' })
 | 
					  hi('PmenuThumb',       { bg = 'Black',                                ctermbg = 'Black' })
 | 
				
			||||||
  hi('Question',     { fg = 'SeaGreen', bold = true,               ctermfg = 'DarkGreen' })
 | 
					  hi('Question',         { fg = 'SeaGreen', bold = true,                ctermfg = 'DarkGreen' })
 | 
				
			||||||
  hi('Search',       { bg = 'Yellow',                              ctermbg = 'Yellow' })
 | 
					  hi('Search',           { bg = 'Yellow',                               ctermbg = 'Yellow' })
 | 
				
			||||||
  hi('SignColumn',   { fg = 'DarkBlue', bg = 'Grey',               ctermfg = 'DarkBlue', ctermbg = 'Grey' })
 | 
					  hi('SignColumn',       { fg = 'DarkBlue', bg = 'Grey',                ctermfg = 'DarkBlue', ctermbg = 'Grey' })
 | 
				
			||||||
  hi('SpecialKey',   { fg = 'Blue',                                ctermfg = 'DarkBlue' })
 | 
					  hi('SpecialKey',       { fg = 'Blue',                                 ctermfg = 'DarkBlue' })
 | 
				
			||||||
  hi('SpellBad',     { sp = 'Red', undercurl = true,               ctermbg = 'LightRed' })
 | 
					  hi('SpellBad',         { sp = 'Red', undercurl = true,                ctermbg = 'LightRed' })
 | 
				
			||||||
  hi('SpellCap',     { sp = 'Blue', undercurl = true,              ctermbg = 'LightBlue' })
 | 
					  hi('SpellCap',         { sp = 'Blue', undercurl = true,               ctermbg = 'LightBlue' })
 | 
				
			||||||
  hi('SpellLocal',   { sp = 'DarkCyan', undercurl = true,          ctermbg = 'Cyan' })
 | 
					  hi('SpellLocal',       { sp = 'DarkCyan', undercurl = true,           ctermbg = 'Cyan' })
 | 
				
			||||||
  hi('SpellRare',    { sp = 'Magenta', undercurl = true,           ctermbg = 'LightMagenta' })
 | 
					  hi('SpellRare',        { sp = 'Magenta', undercurl = true,            ctermbg = 'LightMagenta' })
 | 
				
			||||||
  hi('TabLine',      { bg = 'LightGrey', underline = true,         ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } })
 | 
					  hi('StatusLineTerm',   { fg = 'White', bg = 'DarkGreen', bold = true, ctermfg = 'White', ctermbg = 'DarkGreen', cterm = { bold = true } })
 | 
				
			||||||
  hi('Title',        { fg = 'Magenta', bold = true,                ctermfg = 'DarkMagenta' })
 | 
					  hi('StatusLineTermNC', { fg = 'White', bg = 'DarkGreen',              ctermfg = 'White', ctermbg = 'DarkGreen' })
 | 
				
			||||||
  hi('Visual',       { fg = 'Black', bg = 'LightGrey',             ctermfg = 'Black', ctermbg = 'Grey' })
 | 
					  hi('TabLine',          { bg = 'LightGrey', underline = true,          ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } })
 | 
				
			||||||
  hi('WarningMsg',   { fg = 'Red',                                 ctermfg = 'DarkRed' })
 | 
					  hi('Title',            { fg = 'Magenta', bold = true,                 ctermfg = 'DarkMagenta' })
 | 
				
			||||||
  hi('Comment',      { fg = 'Blue',                                ctermfg = 'DarkBlue' })
 | 
					  hi('Visual',           { fg = 'Black', bg = 'LightGrey',              ctermfg = 'Black', ctermbg = 'Grey' })
 | 
				
			||||||
  hi('Constant',     { fg = 'Magenta',                             ctermfg = 'DarkRed' })
 | 
					  hi('WarningMsg',       { fg = 'Red',                                  ctermfg = 'DarkRed' })
 | 
				
			||||||
  hi('Special',      { fg = '#6a5acd',                             ctermfg = 'DarkMagenta' })
 | 
					  hi('Comment',          { fg = 'Blue',                                 ctermfg = 'DarkBlue' })
 | 
				
			||||||
  hi('Identifier',   { fg = 'DarkCyan',                            ctermfg = 'DarkCyan' })
 | 
					  hi('Constant',         { fg = 'Magenta',                              ctermfg = 'DarkRed' })
 | 
				
			||||||
  hi('Statement',    { fg = 'Brown', bold = true,                  ctermfg = 'Brown' })
 | 
					  hi('Special',          { fg = '#6a5acd',                              ctermfg = 'DarkMagenta' })
 | 
				
			||||||
  hi('PreProc',      { fg = '#6a0dad',                             ctermfg = 'DarkMagenta' })
 | 
					  hi('Identifier',       { fg = 'DarkCyan',                             ctermfg = 'DarkCyan' })
 | 
				
			||||||
  hi('Type',         { fg = 'SeaGreen', bold = true,               ctermfg = 'DarkGreen' })
 | 
					  hi('Statement',        { fg = 'Brown', bold = true,                   ctermfg = 'Brown' })
 | 
				
			||||||
  hi('Underlined',   { fg = 'SlateBlue', underline = true,         ctermfg = 'DarkMagenta', cterm = { underline = true } })
 | 
					  hi('PreProc',          { fg = '#6a0dad',                              ctermfg = 'DarkMagenta' })
 | 
				
			||||||
  hi('Ignore',       {                                             ctermfg = 'White' })
 | 
					  hi('Type',             { fg = 'SeaGreen', bold = true,                ctermfg = 'DarkGreen' })
 | 
				
			||||||
 | 
					  hi('Underlined',       { fg = 'SlateBlue', underline = true,          ctermfg = 'DarkMagenta', cterm = { underline = true } })
 | 
				
			||||||
 | 
					  hi('Ignore',           {                                              ctermfg = 'White' })
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  -- Default colors only used with a dark background.
 | 
					  -- Default colors only used with a dark background.
 | 
				
			||||||
  hi('ColorColumn',  { bg = 'DarkRed',                            ctermbg = 'DarkRed' })
 | 
					  hi('ColorColumn',      { bg = 'DarkRed',                               ctermbg = 'DarkRed' })
 | 
				
			||||||
  hi('CursorColumn', { bg = 'Grey40',                             ctermbg = 'DarkGrey' })
 | 
					  hi('CursorColumn',     { bg = 'Grey40',                                ctermbg = 'DarkGrey' })
 | 
				
			||||||
  hi('CursorLine',   { bg = 'Grey40',                             cterm = { underline = true } })
 | 
					  hi('CursorLine',       { bg = 'Grey40',                                cterm = { underline = true } })
 | 
				
			||||||
  hi('CursorLineNr', { fg = 'Yellow', bold = true,                ctermfg = 'Yellow', cterm = { underline = true } })
 | 
					  hi('CursorLineNr',     { fg = 'Yellow', bold = true,                   ctermfg = 'Yellow', cterm = { underline = true } })
 | 
				
			||||||
  hi('DiffAdd',      { bg = 'DarkBlue',                           ctermbg = 'DarkBlue' })
 | 
					  hi('DiffAdd',          { bg = 'DarkBlue',                              ctermbg = 'DarkBlue' })
 | 
				
			||||||
  hi('DiffChange',   { bg = 'DarkMagenta',                        ctermbg = 'DarkMagenta' })
 | 
					  hi('DiffChange',       { bg = 'DarkMagenta',                           ctermbg = 'DarkMagenta' })
 | 
				
			||||||
  hi('DiffDelete',   { fg = 'Blue', bg = 'DarkCyan', bold = true, ctermfg = 'Blue', ctermbg = 'DarkCyan' })
 | 
					  hi('DiffDelete',       { fg = 'Blue', bg = 'DarkCyan', bold = true,    ctermfg = 'Blue', ctermbg = 'DarkCyan' })
 | 
				
			||||||
  hi('Directory',    { fg = 'Cyan',                               ctermfg = 'LightCyan' })
 | 
					  hi('Directory',        { fg = 'Cyan',                                  ctermfg = 'LightCyan' })
 | 
				
			||||||
  hi('FoldColumn',   { fg = 'Cyan', bg = 'Grey',                  ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
 | 
					  hi('FoldColumn',       { fg = 'Cyan', bg = 'Grey',                     ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
 | 
				
			||||||
  hi('Folded',       { fg = 'Cyan', bg = 'DarkGrey',              ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
 | 
					  hi('Folded',           { fg = 'Cyan', bg = 'DarkGrey',                 ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
 | 
				
			||||||
  hi('LineNr',       { fg = 'Yellow',                             ctermfg = 'Yellow' })
 | 
					  hi('LineNr',           { fg = 'Yellow',                                ctermfg = 'Yellow' })
 | 
				
			||||||
  hi('MatchParen',   { bg = 'DarkCyan',                           ctermbg = 'DarkCyan' })
 | 
					  hi('MatchParen',       { bg = 'DarkCyan',                              ctermbg = 'DarkCyan' })
 | 
				
			||||||
  hi('MoreMsg',      { fg = 'SeaGreen', bold = true,              ctermfg = 'LightGreen' })
 | 
					  hi('MoreMsg',          { fg = 'SeaGreen', bold = true,                 ctermfg = 'LightGreen' })
 | 
				
			||||||
  hi('Pmenu',        { bg = 'Magenta',                            ctermfg = 'Black', ctermbg = 'Magenta' })
 | 
					  hi('Pmenu',            { bg = 'Magenta',                               ctermfg = 'Black', ctermbg = 'Magenta' })
 | 
				
			||||||
  hi('PmenuSel',     { bg = 'DarkGrey',                           ctermfg = 'DarkGrey', ctermbg = 'Black' })
 | 
					  hi('PmenuSel',         { bg = 'DarkGrey',                              ctermfg = 'DarkGrey', ctermbg = 'Black' })
 | 
				
			||||||
  hi('PmenuThumb',   { bg = 'White',                              ctermbg = 'White' })
 | 
					  hi('PmenuThumb',       { bg = 'White',                                 ctermbg = 'White' })
 | 
				
			||||||
  hi('Question',     { fg = 'Green', bold = true,                 ctermfg = 'LightGreen' })
 | 
					  hi('Question',         { fg = 'Green', bold = true,                    ctermfg = 'LightGreen' })
 | 
				
			||||||
  hi('Search',       { fg = 'Black', bg = 'Yellow',               ctermfg = 'Black', ctermbg = 'Yellow' })
 | 
					  hi('Search',           { fg = 'Black', bg = 'Yellow',                  ctermfg = 'Black', ctermbg = 'Yellow' })
 | 
				
			||||||
  hi('SignColumn',   { fg = 'Cyan', bg = 'Grey',                  ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
 | 
					  hi('SignColumn',       { fg = 'Cyan', bg = 'Grey',                     ctermfg = 'Cyan', ctermbg = 'DarkGrey' })
 | 
				
			||||||
  hi('SpecialKey',   { fg = 'Cyan',                               ctermfg = 'LightBlue' })
 | 
					  hi('SpecialKey',       { fg = 'Cyan',                                  ctermfg = 'LightBlue' })
 | 
				
			||||||
  hi('SpellBad',     { sp = 'Red', undercurl = true,              ctermbg = 'Red' })
 | 
					  hi('SpellBad',         { sp = 'Red', undercurl = true,                 ctermbg = 'Red' })
 | 
				
			||||||
  hi('SpellCap',     { sp = 'Blue', undercurl = true,             ctermbg = 'Blue' })
 | 
					  hi('SpellCap',         { sp = 'Blue', undercurl = true,                ctermbg = 'Blue' })
 | 
				
			||||||
  hi('SpellLocal',   { sp = 'Cyan', undercurl = true,             ctermbg = 'Cyan' })
 | 
					  hi('SpellLocal',       { sp = 'Cyan', undercurl = true,                ctermbg = 'Cyan' })
 | 
				
			||||||
  hi('SpellRare',    { sp = 'Magenta', undercurl = true,          ctermbg = 'Magenta' })
 | 
					  hi('SpellRare',        { sp = 'Magenta', undercurl = true,             ctermbg = 'Magenta' })
 | 
				
			||||||
  hi('TabLine',      { bg = 'DarkGrey', underline = true,         ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } })
 | 
					  hi('StatusLineTerm',   { fg = 'Black', bg = 'LightGreen', bold = true, ctermfg = 'Black', ctermbg = 'LightGreen', cterm = { bold = true } })
 | 
				
			||||||
  hi('Title',        { fg = 'Magenta', bold = true,               ctermfg = 'LightMagenta' })
 | 
					  hi('StatusLineTermNC', { fg = 'Black', bg = 'LightGreen',              ctermfg = 'Black', ctermbg = 'LightGreen' })
 | 
				
			||||||
  hi('Visual',       { fg = 'LightGrey', bg = '#575757',          ctermfg = 'Black', ctermbg = 'Grey' })
 | 
					  hi('TabLine',          { bg = 'DarkGrey', underline = true,            ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } })
 | 
				
			||||||
  hi('WarningMsg',   { fg = 'Red',                                ctermfg = 'LightRed' })
 | 
					  hi('Title',            { fg = 'Magenta', bold = true,                  ctermfg = 'LightMagenta' })
 | 
				
			||||||
  hi('Comment',      { fg = '#80a0ff',                            ctermfg = 'Cyan' })
 | 
					  hi('Visual',           { fg = 'LightGrey', bg = '#575757',             ctermfg = 'Black', ctermbg = 'Grey' })
 | 
				
			||||||
  hi('Constant',     { fg = '#ffa0a0',                            ctermfg = 'Magenta' })
 | 
					  hi('WarningMsg',       { fg = 'Red',                                   ctermfg = 'LightRed' })
 | 
				
			||||||
  hi('Special',      { fg = 'Orange',                             ctermfg = 'LightRed' })
 | 
					  hi('Comment',          { fg = '#80a0ff',                               ctermfg = 'Cyan' })
 | 
				
			||||||
  hi('Identifier',   { fg = '#40ffff',                            ctermfg = 'Cyan', cterm = { bold = true } })
 | 
					  hi('Constant',         { fg = '#ffa0a0',                               ctermfg = 'Magenta' })
 | 
				
			||||||
  hi('Statement',    { fg = '#ffff60', bold = true,               ctermfg = 'Yellow' })
 | 
					  hi('Special',          { fg = 'Orange',                                ctermfg = 'LightRed' })
 | 
				
			||||||
  hi('PreProc',      { fg = '#ff80ff',                            ctermfg = 'LightBlue' })
 | 
					  hi('Identifier',       { fg = '#40ffff',                               ctermfg = 'Cyan', cterm = { bold = true } })
 | 
				
			||||||
  hi('Type',         { fg = '#60ff60', bold = true,               ctermfg = 'LightGreen' })
 | 
					  hi('Statement',        { fg = '#ffff60', bold = true,                  ctermfg = 'Yellow' })
 | 
				
			||||||
  hi('Underlined',   { fg = '#80a0ff', underline = true,          ctermfg = 'LightBlue', cterm = { underline = true } })
 | 
					  hi('PreProc',          { fg = '#ff80ff',                               ctermfg = 'LightBlue' })
 | 
				
			||||||
  hi('Ignore',       {                                            ctermfg = 'Black' })
 | 
					  hi('Type',             { fg = '#60ff60', bold = true,                  ctermfg = 'LightGreen' })
 | 
				
			||||||
 | 
					  hi('Underlined',       { fg = '#80a0ff', underline = true,             ctermfg = 'LightBlue', cterm = { underline = true } })
 | 
				
			||||||
 | 
					  hi('Ignore',           {                                               ctermfg = 'Black' })
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
--stylua: ignore end
 | 
					--stylua: ignore end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1056,6 +1056,11 @@ describe('TUI', function()
 | 
				
			|||||||
    if is_ci('github') then
 | 
					    if is_ci('github') then
 | 
				
			||||||
      pending('tty-test complains about not owning the terminal -- actions/runner#241')
 | 
					      pending('tty-test complains about not owning the terminal -- actions/runner#241')
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					    screen:set_default_attr_ids({
 | 
				
			||||||
 | 
					      [1] = { reverse = true }, -- focused cursor
 | 
				
			||||||
 | 
					      [3] = { bold = true },
 | 
				
			||||||
 | 
					      [19] = { bold = true, background = 121, foreground = 0 }, -- StatusLineTerm
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
    child_exec_lua('vim.o.statusline="^^^^^^^"')
 | 
					    child_exec_lua('vim.o.statusline="^^^^^^^"')
 | 
				
			||||||
    child_exec_lua('vim.cmd.terminal(...)', testprg('tty-test'))
 | 
					    child_exec_lua('vim.cmd.terminal(...)', testprg('tty-test'))
 | 
				
			||||||
    feed_data('i')
 | 
					    feed_data('i')
 | 
				
			||||||
@@ -1063,7 +1068,7 @@ describe('TUI', function()
 | 
				
			|||||||
      tty ready                                         |
 | 
					      tty ready                                         |
 | 
				
			||||||
      {1: }                                                 |
 | 
					      {1: }                                                 |
 | 
				
			||||||
                                                        |*2
 | 
					                                                        |*2
 | 
				
			||||||
      {5:^^^^^^^                                           }|
 | 
					      {19:^^^^^^^                                           }|
 | 
				
			||||||
      {3:-- TERMINAL --}                                    |*2
 | 
					      {3:-- TERMINAL --}                                    |*2
 | 
				
			||||||
    ]])
 | 
					    ]])
 | 
				
			||||||
    feed_data('\027[200~')
 | 
					    feed_data('\027[200~')
 | 
				
			||||||
@@ -1073,7 +1078,7 @@ describe('TUI', function()
 | 
				
			|||||||
      tty ready                                         |
 | 
					      tty ready                                         |
 | 
				
			||||||
      hallo{1: }                                            |
 | 
					      hallo{1: }                                            |
 | 
				
			||||||
                                                        |*2
 | 
					                                                        |*2
 | 
				
			||||||
      {5:^^^^^^^                                           }|
 | 
					      {19:^^^^^^^                                           }|
 | 
				
			||||||
      {3:-- TERMINAL --}                                    |*2
 | 
					      {3:-- TERMINAL --}                                    |*2
 | 
				
			||||||
    ]])
 | 
					    ]])
 | 
				
			||||||
  end)
 | 
					  end)
 | 
				
			||||||
@@ -1548,10 +1553,32 @@ describe('TUI', function()
 | 
				
			|||||||
    screen:set_rgb_cterm(true)
 | 
					    screen:set_rgb_cterm(true)
 | 
				
			||||||
    screen:set_default_attr_ids({
 | 
					    screen:set_default_attr_ids({
 | 
				
			||||||
      [1] = { { reverse = true }, { reverse = true } },
 | 
					      [1] = { { reverse = true }, { reverse = true } },
 | 
				
			||||||
      [2] = { { bold = true, reverse = true }, { bold = true, reverse = true } },
 | 
					      [2] = {
 | 
				
			||||||
 | 
					        { bold = true, background = Screen.colors.LightGreen, foreground = Screen.colors.Black },
 | 
				
			||||||
 | 
					        { bold = true },
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
      [3] = { { bold = true }, { bold = true } },
 | 
					      [3] = { { bold = true }, { bold = true } },
 | 
				
			||||||
      [4] = { { fg_indexed = true, foreground = tonumber('0xe0e000') }, { foreground = 3 } },
 | 
					      [4] = { { fg_indexed = true, foreground = tonumber('0xe0e000') }, { foreground = 3 } },
 | 
				
			||||||
      [5] = { { foreground = tonumber('0xff8000') }, {} },
 | 
					      [5] = { { foreground = tonumber('0xff8000') }, {} },
 | 
				
			||||||
 | 
					      [6] = {
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          fg_indexed = true,
 | 
				
			||||||
 | 
					          bg_indexed = true,
 | 
				
			||||||
 | 
					          bold = true,
 | 
				
			||||||
 | 
					          background = tonumber('0x66ff99'),
 | 
				
			||||||
 | 
					          foreground = Screen.colors.Black,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        { bold = true, background = 121, foreground = 0 },
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      [7] = {
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          fg_indexed = true,
 | 
				
			||||||
 | 
					          bg_indexed = true,
 | 
				
			||||||
 | 
					          background = tonumber('0x66ff99'),
 | 
				
			||||||
 | 
					          foreground = Screen.colors.Black,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        { background = 121, foreground = 0 },
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    child_exec_lua('vim.o.statusline="^^^^^^^"')
 | 
					    child_exec_lua('vim.o.statusline="^^^^^^^"')
 | 
				
			||||||
@@ -1586,7 +1613,7 @@ describe('TUI', function()
 | 
				
			|||||||
      {1:t}ty ready                                         |
 | 
					      {1:t}ty ready                                         |
 | 
				
			||||||
      {4:text}colortext                                     |
 | 
					      {4:text}colortext                                     |
 | 
				
			||||||
                                                        |*2
 | 
					                                                        |*2
 | 
				
			||||||
      {2:^^^^^^^                                           }|
 | 
					      {6:^^^^^^^}{7:                                           }|
 | 
				
			||||||
      :set notermguicolors                              |
 | 
					      :set notermguicolors                              |
 | 
				
			||||||
      {3:-- TERMINAL --}                                    |
 | 
					      {3:-- TERMINAL --}                                    |
 | 
				
			||||||
    ]],
 | 
					    ]],
 | 
				
			||||||
@@ -1973,6 +2000,7 @@ describe('TUI', function()
 | 
				
			|||||||
      [3] = { bold = true },
 | 
					      [3] = { bold = true },
 | 
				
			||||||
      [4] = { foreground = tonumber('0x4040ff'), fg_indexed = true },
 | 
					      [4] = { foreground = tonumber('0x4040ff'), fg_indexed = true },
 | 
				
			||||||
      [5] = { bold = true, reverse = true },
 | 
					      [5] = { bold = true, reverse = true },
 | 
				
			||||||
 | 
					      [6] = { foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    screen:attach()
 | 
					    screen:attach()
 | 
				
			||||||
    fn.termopen({
 | 
					    fn.termopen({
 | 
				
			||||||
@@ -1998,7 +2026,7 @@ describe('TUI', function()
 | 
				
			|||||||
      {2:~                        }│{4:~                       }|*5
 | 
					      {2:~                        }│{4:~                       }|*5
 | 
				
			||||||
      {2:~                        }│{5:[No Name]   0,0-1    All}|
 | 
					      {2:~                        }│{5:[No Name]   0,0-1    All}|
 | 
				
			||||||
      {2:~                        }│                        |
 | 
					      {2:~                        }│                        |
 | 
				
			||||||
      {5:new                       }{1:{MATCH:<.*[/\]nvim }}|
 | 
					      {5:new                       }{6:{MATCH:<.*[/\]nvim }}|
 | 
				
			||||||
                                                        |
 | 
					                                                        |
 | 
				
			||||||
    ]])
 | 
					    ]])
 | 
				
			||||||
  end)
 | 
					  end)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -345,12 +345,19 @@ describe('search highlighting', function()
 | 
				
			|||||||
      bar baz foo
 | 
					      bar baz foo
 | 
				
			||||||
      bar foo baz]])
 | 
					      bar foo baz]])
 | 
				
			||||||
    feed('/foo')
 | 
					    feed('/foo')
 | 
				
			||||||
 | 
					    screen:set_default_attr_ids({
 | 
				
			||||||
 | 
					      [1] = { bold = true, foreground = Screen.colors.Blue },
 | 
				
			||||||
 | 
					      [2] = { background = Screen.colors.Yellow }, -- Search
 | 
				
			||||||
 | 
					      [3] = { reverse = true },
 | 
				
			||||||
 | 
					      [4] = { bold = true, reverse = true },
 | 
				
			||||||
 | 
					      [5] = { foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
    screen:expect([[
 | 
					    screen:expect([[
 | 
				
			||||||
      {3:foo} bar baz         │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
 | 
					      {3:foo} bar baz         │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
 | 
				
			||||||
      bar baz {2:foo}         │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
 | 
					      bar baz {2:foo}         │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
 | 
				
			||||||
      bar {2:foo} baz         │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
 | 
					      bar {2:foo} baz         │{MATCH:%d+}: {2:foo}{MATCH:%s+}|
 | 
				
			||||||
      {1:~                   }│{MATCH:.*}|*2
 | 
					      {1:~                   }│{MATCH:.*}|*2
 | 
				
			||||||
      {5:[No Name] [+]        }{3:term               }|
 | 
					      {4:[No Name] [+]        }{5:term               }|
 | 
				
			||||||
      /foo^                                    |
 | 
					      /foo^                                    |
 | 
				
			||||||
    ]])
 | 
					    ]])
 | 
				
			||||||
  end)
 | 
					  end)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -199,9 +199,13 @@ describe("'wildmenu'", function()
 | 
				
			|||||||
    feed((':terminal "%s" REP 5000 !terminal_output!<cr>'):format(testprg('shell-test')))
 | 
					    feed((':terminal "%s" REP 5000 !terminal_output!<cr>'):format(testprg('shell-test')))
 | 
				
			||||||
    feed('G') -- Follow :terminal output.
 | 
					    feed('G') -- Follow :terminal output.
 | 
				
			||||||
    feed([[:sign <Tab>]]) -- Invoke wildmenu.
 | 
					    feed([[:sign <Tab>]]) -- Invoke wildmenu.
 | 
				
			||||||
 | 
					    screen:set_default_attr_ids {
 | 
				
			||||||
 | 
					      [31] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow },
 | 
				
			||||||
 | 
					      [32] = { bold = true, foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    -- NB: in earlier versions terminal output was redrawn during cmdline mode.
 | 
					    -- NB: in earlier versions terminal output was redrawn during cmdline mode.
 | 
				
			||||||
    -- For now just assert that the screen remains unchanged.
 | 
					    -- For now just assert that the screen remains unchanged.
 | 
				
			||||||
    screen:expect { any = '{31:define}{3:  jump  list  >    }|\n:sign define^             |' }
 | 
					    screen:expect { any = '{31:define}{32:  jump  list  >    }|\n:sign define^             |' }
 | 
				
			||||||
    screen:expect_unchanged()
 | 
					    screen:expect_unchanged()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    -- cmdline CTRL-D display should also be preserved.
 | 
					    -- cmdline CTRL-D display should also be preserved.
 | 
				
			||||||
@@ -259,9 +263,13 @@ describe("'wildmenu'", function()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    feed([[<C-\><C-N>]])
 | 
					    feed([[<C-\><C-N>]])
 | 
				
			||||||
    feed([[:<Tab>]]) -- Invoke wildmenu.
 | 
					    feed([[:<Tab>]]) -- Invoke wildmenu.
 | 
				
			||||||
 | 
					    screen:set_default_attr_ids {
 | 
				
			||||||
 | 
					      [31] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow },
 | 
				
			||||||
 | 
					      [32] = { bold = true, foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    -- Check only the last 2 lines, because the shell output is
 | 
					    -- Check only the last 2 lines, because the shell output is
 | 
				
			||||||
    -- system-dependent.
 | 
					    -- system-dependent.
 | 
				
			||||||
    screen:expect { any = '{31:!}{3:  #  &  <  =  >  @  >   }|\n:!^' }
 | 
					    screen:expect { any = '{31:!}{32:  #  &  <  =  >  @  >   }|\n:!^' }
 | 
				
			||||||
    -- Because this test verifies a _lack_ of activity, we must wait the full timeout.
 | 
					    -- Because this test verifies a _lack_ of activity, we must wait the full timeout.
 | 
				
			||||||
    -- So make it reasonable.
 | 
					    -- So make it reasonable.
 | 
				
			||||||
    screen:expect_unchanged(false, 1000)
 | 
					    screen:expect_unchanged(false, 1000)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user