Skip to content

Commit

Permalink
perf(options): better detection for foldtext,statuscolumn,folexpr sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
folke committed Oct 3, 2023
1 parent 1b74d67 commit e105c9d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lua/lazyvim/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,15 @@ end

-- Folding
vim.opt.foldlevel = 99
if vim.treesitter.foldexpr then
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"

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()]]
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
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
end

-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0

0 comments on commit e105c9d

Please sign in to comment.