refactor!: update to Neovim 0.7 APIs

* set highlight groups via nvim_set_hl
* define autocommands via nvim_create_autocmd
* port plugin/nvim-treesitter.vim to Lua
* port healthcheck to Lua
This commit is contained in:
Christian Clason 2022-04-16 17:49:17 +02:00 committed by Christian Clason
parent bc25a6a5c4
commit 07eb437bb1
8 changed files with 168 additions and 148 deletions

View file

@ -195,7 +195,10 @@ local indent_funcs = {}
function M.attach(bufnr)
indent_funcs[bufnr] = vim.bo.indentexpr
vim.bo.indentexpr = "nvim_treesitter#indent()"
vim.api.nvim_command("au Filetype " .. vim.bo.filetype .. " setlocal indentexpr=nvim_treesitter#indent()")
vim.api.nvim_create_autocmd("Filetype", {
pattern = vim.bo.filetype,
command = "setlocal indentexpr=nvim_treesitter#indent()",
})
end
function M.detach(bufnr)