Skip to content

Commit

Permalink
fix(ui): fixed foldtext on Neovim < 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 3, 2023
1 parent b1ad480 commit 1b74d67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/lazyvim/util/ui.lua
Expand Up @@ -28,6 +28,15 @@ function M.foldtext()
ret = { { vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1], {} } }
end
table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots })

if not vim.treesitter.foldtext then
return table.concat(
vim.tbl_map(function(line)
return line[1]
end, ret),
" "
)
end
return ret
end

Expand Down

0 comments on commit 1b74d67

Please sign in to comment.