robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
1.4 KiB42 linesraw
1local n = require('test.functional.testnvim')()
2local t = require('test.testutil')
3local Screen = require('test.functional.ui.screen')
4
5local describe, it, before_each = t.describe, t.it, t.before_each
6local clear = n.clear
7local exec = n.exec
8local api = n.api
9
10describe('Vimscript syntax highlighting', function()
11  local screen --- @type test.functional.ui.screen
12
13  before_each(function()
14    clear()
15    n.add_builddir_to_rtp()
16    exec([[
17      setfiletype vim
18      syntax on
19    ]])
20    screen = Screen.new()
21    screen:set_default_attr_ids({
22      [0] = { foreground = Screen.colors.Blue, bold = true },
23      [1] = { foreground = Screen.colors.Brown, bold = true },
24      [2] = { foreground = tonumber('0x6a0dad') },
25    })
26  end)
27
28  it('prefixed boolean options are highlighted properly', function()
29    api.nvim_buf_set_lines(0, 0, -1, true, {
30      'set number incsearch hlsearch',
31      'set nonumber noincsearch nohlsearch',
32      'set invnumber invincsearch invhlsearch',
33    })
34    screen:expect([[
35      {1:^set} {2:number} {2:incsearch} {2:hlsearch}                        |
36      {1:set} {2:nonumber} {2:noincsearch} {2:nohlsearch}                  |
37      {1:set} {2:invnumber} {2:invincsearch} {2:invhlsearch}               |
38      {0:~                                                    }|*10
39                                                           |
40    ]])
41  end)
42end)