mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 05:28:33 +00:00

This is the first installment of a multi-PR series significantly refactoring how highlights are being specified. The end goal is to have a base set of 20 ish most common highlights, and then specific files only need to add more groups to that as needed. As a complicating factor, we also want to migrate to the new default color scheme eventually. But by sharing a base set, that future PR will hopefully be a lot smaller since a lot of tests will be migrated just simply by updating the base set in place. As a first step, fix the anti-pattern than Screen defaults to ignoring highlights. Highlights are integral part of the screen state, not something "extra" which we only test "sometimes". For now, we still allow opt-out via the intentionally ugly screen._default_attr_ids = nil The end goal is to get rid of all of these eventually (which will be easier as part of the color scheme migration)
29 lines
762 B
Lua
29 lines
762 B
Lua
local helpers = require('test.functional.helpers')(after_each)
|
|
local Screen = require('test.functional.ui.screen')
|
|
local clear = helpers.clear
|
|
local command = helpers.command
|
|
local feed = helpers.feed
|
|
|
|
before_each(clear)
|
|
|
|
describe('cpoptions', function()
|
|
it('$', function()
|
|
local screen = Screen.new(30, 6)
|
|
screen:attach()
|
|
command('set cpo+=$')
|
|
command([[call setline(1, 'one two three')]])
|
|
feed('c2w')
|
|
screen:expect([[
|
|
^one tw$ three |
|
|
{1:~ }|*4
|
|
{5:-- INSERT --} |
|
|
]])
|
|
feed('vim<Esc>')
|
|
screen:expect([[
|
|
vi^m three |
|
|
{1:~ }|*4
|
|
|
|
|
]])
|
|
end)
|
|
end)
|