mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-30 20:44:35 +02:00
fix(ui): use custom fold when treesitter foldtext returns a string
This commit is contained in:
parent
417de0193d
commit
35053290bf
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ end
|
||||||
function M.foldtext()
|
function M.foldtext()
|
||||||
local ok = pcall(vim.treesitter.get_parser, vim.api.nvim_get_current_buf())
|
local ok = pcall(vim.treesitter.get_parser, vim.api.nvim_get_current_buf())
|
||||||
local ret = ok and vim.treesitter.foldtext and vim.treesitter.foldtext()
|
local ret = ok and vim.treesitter.foldtext and vim.treesitter.foldtext()
|
||||||
if not ret then
|
if not ret or type(ret) == "string" then
|
||||||
ret = { { vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1], {} } }
|
ret = { { vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1], {} } }
|
||||||
end
|
end
|
||||||
table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots })
|
table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue