Skip to content

Commit 240377e

Browse files
committed
feat(status): use default fold column in Neovim v0.12 after addition of foldinner
1 parent 1e36aa9 commit 240377e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lua/astroui/ffi.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
-- AstroUI C Extensions
22

3+
-- TODO: Delete when dropping support for Neovim v0.11
4+
35
local ffi = require "ffi"
46

57
-- Custom C extension to get direct fold information from Neovim

lua/astroui/status/provider.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ end
8181

8282
--- A provider function for building a foldcolumn
8383
---@param opts? AstroUIProviderFoldcolumnOpts provider options
84-
---@return function # a custom foldcolumn function for the statuscolumn that doesn't show the nest levels
84+
---@return function|string # a custom foldcolumn function for the statuscolumn that doesn't show the nest levels
8585
-- @usage local heirline_component = { provider = require("astroui.status").provider.foldcolumn }
8686
-- @see astroui.status.utils.stylize
8787
function M.foldcolumn(opts)
8888
opts = extend_tbl(vim.tbl_get(config, "providers", "foldcolumn"), opts)
89+
if vim.fn.has "nvim-0.12" == 1 then return status_utils.stylize("%C", opts) end
90+
-- TODO: Remove code when deprecating Neovim 0.11 support
8991
local ffi = require "astroui.ffi" -- get AstroUI C extensions
9092
local fillchars = vim.opt.fillchars:get()
9193
local foldopen = fillchars.foldopen or get_icon "FoldOpened"

0 commit comments

Comments
 (0)