Refresh generated neovim config
This commit is contained in:
@ -45,6 +45,7 @@ describe('Buffer Manipulation', function()
|
||||
nvim:exec_lua('TSEnsure(...)', {'lua', 'markdown'})
|
||||
nvim:buf_set_lines(0, 0, -2, true, vim.fn.split(markdown_with_injected_lua, '\n'))
|
||||
nvim:buf_set_option(0, 'filetype', 'markdown')
|
||||
nvim:exec_lua('vim.treesitter.start()', {})
|
||||
assert.nvim(nvim).has_extmarks_at(3, 5, 'lua')
|
||||
|
||||
-- Move Lua line out of code block
|
||||
@ -60,6 +61,7 @@ describe('Buffer Manipulation', function()
|
||||
nvim:exec_lua('TSEnsure(...)', {'lua', 'markdown'})
|
||||
nvim:buf_set_lines(0, 0, -2, true, vim.fn.split(markdown_without_injected_lua, '\n'))
|
||||
nvim:buf_set_option(0, 'filetype', 'markdown')
|
||||
nvim:exec_lua('vim.treesitter.start()', {})
|
||||
assert.nvim(nvim).Not.has_extmarks_at(4, 5, 'lua')
|
||||
|
||||
-- Move Lua line out of code block
|
||||
|
||||
@ -5,27 +5,50 @@ describe('We can disable rainbow delimiters for certain languages', function()
|
||||
|
||||
before_each(function()
|
||||
nvim = yd.start()
|
||||
nvim:exec_lua('the_strategy = require("rainbow-delimiters.strategy.track")(require("rainbow-delimiters.strategy.no-op"))', {})
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
yd.stop(nvim)
|
||||
end)
|
||||
|
||||
it('Does not run for a blacklisted language', function()
|
||||
nvim:exec_lua('the_strategy = require("rainbow-delimiters.strategy.track")(require("rainbow-delimiters.strategy.no-op"))', {})
|
||||
nvim:exec_lua('vim.g.rainbow_delimiters = {blacklist = {"lua"}, strategy = {[""] = the_strategy}}', {})
|
||||
nvim:buf_set_lines(0, 0, -1, true, {'print "Hello world"', '-- vim:ft=lua'})
|
||||
nvim:command('filetype detect')
|
||||
local attachments = nvim:exec_lua('return the_strategy.attachments[1]', {})
|
||||
assert.is.equal(0, attachments)
|
||||
describe('For the given language', function()
|
||||
before_each(function()
|
||||
nvim:buf_set_lines(0, 0, -1, true, {'print "Hello world"', '-- vim:ft=lua'})
|
||||
end)
|
||||
|
||||
it('Does not run when blacklisted', function()
|
||||
nvim:exec_lua('vim.g.rainbow_delimiters = {strategy = {[""] = the_strategy}, blacklist = {"lua"}}', {})
|
||||
nvim:command('filetype detect')
|
||||
local attachments = nvim:exec_lua('return the_strategy.attachments[1]', {})
|
||||
assert.is.equal(0, attachments)
|
||||
end)
|
||||
|
||||
it('Runs when whitelisted', function()
|
||||
nvim:exec_lua('vim.g.rainbow_delimiters = {strategy = {[""] = the_strategy}, whitelist = {"lua"}}', {})
|
||||
nvim:command('filetype detect')
|
||||
local attachments = nvim:exec_lua('return the_strategy.attachments[1]', {})
|
||||
assert.is.equal(1, attachments)
|
||||
end)
|
||||
end)
|
||||
|
||||
it('Runs for a whitelisted language', function()
|
||||
nvim:exec_lua('the_strategy = require("rainbow-delimiters.strategy.track")(require("rainbow-delimiters.strategy.no-op"))', {})
|
||||
nvim:exec_lua('vim.g.rainbow_delimiters = {whitelist = {"lua"}, strategy = {[""] = the_strategy}}', {})
|
||||
nvim:buf_set_lines(0, 0, -1, true, {'print "Hello world"', '-- vim:ft=lua'})
|
||||
nvim:command('filetype detect')
|
||||
local attachments = nvim:exec_lua('return the_strategy.attachments[1]', {})
|
||||
assert.is.equal(1, attachments)
|
||||
describe('For another language', function()
|
||||
before_each(function()
|
||||
nvim:buf_set_lines(0, 0, -1, true, {'echo "Hello world"', '" vim:ft=vim'})
|
||||
end)
|
||||
|
||||
it('Runs when not blacklisted', function()
|
||||
nvim:exec_lua('vim.g.rainbow_delimiters = {strategy = {[""] = the_strategy}, blacklist = {"lua"}}', {})
|
||||
nvim:command('filetype detect')
|
||||
local attachments = nvim:exec_lua('return the_strategy.attachments[1]', {})
|
||||
assert.is.equal(1, attachments)
|
||||
end)
|
||||
|
||||
it('Does not run when not whitelisted', function()
|
||||
nvim:exec_lua('vim.g.rainbow_delimiters = {strategy = {[""] = the_strategy}, whitelist = {"lua"}}', {})
|
||||
nvim:command('filetype detect')
|
||||
local attachments = nvim:exec_lua('return the_strategy.attachments[1]', {})
|
||||
assert.is.equal(0, attachments)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user