mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
fix: handle context-commentstring setup (#4451)
This commit is contained in:
parent
d8ffab83be
commit
38216e6701
2 changed files with 14 additions and 4 deletions
|
@ -102,14 +102,24 @@ function M.setup()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs")
|
local ts_status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs")
|
||||||
if not status_ok then
|
if not ts_status_ok then
|
||||||
Log:error "Failed to load nvim-treesitter.configs"
|
Log:error "Failed to load nvim-treesitter.configs"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local status_ok, ts_context_commentstring = pcall(require, "ts_context_commentstring")
|
||||||
|
if not status_ok then
|
||||||
|
Log:error "Failed to load ts_context_commentstring"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local opts = vim.deepcopy(lvim.builtin.treesitter)
|
local opts = vim.deepcopy(lvim.builtin.treesitter)
|
||||||
|
|
||||||
|
-- handle deprecated API, https://github.com/JoosepAlviste/nvim-ts-context-commentstring/issues/82
|
||||||
|
ts_context_commentstring.setup(opts.context_commentstring)
|
||||||
|
opts.context_commentstring = nil
|
||||||
|
|
||||||
treesitter_configs.setup(opts)
|
treesitter_configs.setup(opts)
|
||||||
|
|
||||||
if lvim.builtin.treesitter.on_config_done then
|
if lvim.builtin.treesitter.on_config_done then
|
||||||
|
|
|
@ -87,10 +87,10 @@
|
||||||
"commit": "64f61e4"
|
"commit": "64f61e4"
|
||||||
},
|
},
|
||||||
"nvim-treesitter": {
|
"nvim-treesitter": {
|
||||||
"commit": "1e64838"
|
"commit": "d5a1c2b"
|
||||||
},
|
},
|
||||||
"nvim-ts-context-commentstring": {
|
"nvim-ts-context-commentstring": {
|
||||||
"commit": "b8ff464"
|
"commit": "0bdccb9"
|
||||||
},
|
},
|
||||||
"nvim-web-devicons": {
|
"nvim-web-devicons": {
|
||||||
"commit": "5b90678"
|
"commit": "5b90678"
|
||||||
|
|
Loading…
Reference in a new issue