fix for new mason, rollback folding to treesitter
This commit is contained in:
@@ -17,6 +17,7 @@ require("fidget").setup({
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {'bashls', 'clangd', 'marksman', 'pylsp', 'ruff', 'texlab'},
|
||||
automatic_enable = false,
|
||||
})
|
||||
require('mason-nvim-dap').setup({
|
||||
ensure_installed = {'bash', 'cppdbg', 'python'},
|
||||
|
||||
@@ -25,19 +25,19 @@ require'nvim-treesitter.configs'.setup {
|
||||
}
|
||||
local vim = vim
|
||||
|
||||
-- vim.o.foldmethod = 'expr'
|
||||
-- -- Default to treesitter folding
|
||||
-- vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
-- -- Prefer LSP folding if client supports it
|
||||
-- vim.api.nvim_create_autocmd('LspAttach', {
|
||||
-- callback = function(args)
|
||||
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
-- if client:supports_method('textDocument/foldingRange') then
|
||||
-- local win = vim.api.nvim_get_current_win()
|
||||
-- vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
vim.o.foldmethod = 'expr'
|
||||
-- Default to treesitter folding
|
||||
vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
-- Prefer LSP folding if client supports it
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client:supports_method('textDocument/foldingRange') then
|
||||
local win = vim.api.nvim_get_current_win()
|
||||
vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
|
||||
end
|
||||
end,
|
||||
})
|
||||
local opt = vim.opt
|
||||
local api = vim.api
|
||||
local M = {}
|
||||
|
||||
Reference in New Issue
Block a user