kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.34k stars 49 forks source link

[Enhancement] Integrate with indent-blankline.nvim or provide an API for an integration #19

Closed akinsho closed 2 years ago

akinsho commented 2 years ago

Feature description

Hi,

Thanks for your work on this plugin, it's the first time in many years of using (neo)vim that I've ever had normal looking folds šŸš€.

One thing that using folds more has re-introduced for me though is the gaps appearing between my indent lines. The plugin https://github.com/lukas-reineke/indent-blankline.nvim fixes this limitation in normal lines by using extmarks to draw the indent lines and cover the gaps that exist in conceal based solutions.

With this plugin enabled, though, these extmarks are no longer visible and folded section introduce gaps between my indent lines.

Describe the solution you'd like

I don't know how this plugin is designed i.e. extmarks (most likely I think) or floating windows, but I'm wondering if there's some chance of either blending the extmarks not sure if this could work or if it's possible to query for the existing indent lines (extmarks) via nvim_buf_get_extmarks and re-apply/add them to the extmarks this plugin creates and if it's via floating window then it should already be working.

If it isn't entirely easy or possible on this side then maybe the author of that plugin would be willing to provide an API to get the indents for a line so they can be prepended to the fold text. I'm happy to ask if you are amenable but I don't really know how this is structured and what approach would make sense

Additional context

Example in vscode with indents extending beyond folds (I know vscode is rarely 100% applicable, I just meant for reference of what the desired result looks like)

image

Unfolded indents across blank lines

image

Current indent lines across folds

image
kevinhwang91 commented 2 years ago

https://github.com/lukas-reineke/indent-blankline.nvim/blob/6177a59552e35dfb69e1493fd68194e673dc3ee2/lua/indent_blankline/init.lua#L565

priority greater than 10 will work.

akinsho commented 2 years ago

@kevinhwang91 I tried increasing the value all the way up to 50 and that didn't make a difference

kevinhwang91 commented 2 years ago

Have you updated nvim-ufo after I close this issue?

akinsho commented 2 years ago

Oh sorry no I didn't realise you had committed a change

kevinhwang91 commented 2 years ago

674 line should be changed also.

akinsho commented 2 years ago

Ah thanks, after I updated and changed the other line that worked well šŸ‘šŸæ I'll raise an issue over there to make the priority configurable thanks.