Skip to content

Commit

Permalink
feat(concealer): use empty foldmethod on nightly releases (for full f…
Browse files Browse the repository at this point in the history
…olding passthrough)
  • Loading branch information
vhyrro committed Mar 4, 2024
1 parent ee020b8 commit 086891d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/neorg/modules/core/concealer/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,8 @@ local function handle_init_event(event)
local wo = vim.wo[event.window]
wo.foldmethod = "expr"
wo.foldexpr = vim.treesitter.foldexpr and "v:lua.vim.treesitter.foldexpr()" or "nvim_treesitter#foldexpr()"
wo.foldtext = "v:lua.require'neorg'.modules.get_module('core.concealer').foldtext()"
wo.foldtext = utils.is_minimum_version(0, 10, 0) and ""
or "v:lua.require'neorg'.modules.get_module('core.concealer').foldtext()"

local init_open_folds = module.config.public.init_open_folds
local function open_folds()
Expand Down

2 comments on commit 086891d

@j-xella
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, would it be possible to comment on the reasons for this commit? I build nvim from the latest sources, and foldtext was working so far. Well, maybe it was not perfect, see #1121, but still miles better than not having it. Why disabling?

P.S. A hint for people like me to temporarily re-enable the foldtext for a neorg buffer:

setlocal foldtext=v:lua.require'neorg'.modules.get_module('core.concealer').foldtext()

@vhyrro
Copy link
Member Author

@vhyrro vhyrro commented on 086891d Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @j-xella - the latest nightly release of Neovim will use its own "passthrough" fold method when it's set to the empty string -- it fixes all of the issues we have had with displaying folds thus far. Make sure you're on the latest nightly for this to work :)

Please sign in to comment.