mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-05 15:04:37 +02:00
perf(options): better detection for foldtext,statuscolumn,folexpr support
This commit is contained in:
parent
1b74d67a0d
commit
e105c9daf6
1 changed files with 5 additions and 9 deletions
|
@ -62,18 +62,14 @@ end
|
||||||
|
|
||||||
-- Folding
|
-- Folding
|
||||||
vim.opt.foldlevel = 99
|
vim.opt.foldlevel = 99
|
||||||
if vim.treesitter.foldexpr then
|
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"
|
||||||
vim.opt.foldmethod = "expr"
|
|
||||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
|
||||||
else
|
|
||||||
vim.opt.foldmethod = "indent"
|
|
||||||
end
|
|
||||||
if vim.treesitter.foldtext then
|
|
||||||
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"
|
|
||||||
end
|
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
|
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
|
||||||
|
else
|
||||||
|
vim.opt.foldmethod = "indent"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Fix markdown indentation settings
|
-- Fix markdown indentation settings
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue