Indent blankline integration

Add an option to show the indent guides from indent-blankline.nvim in the diagnostic lines, while still giving priority to lsp_lines' text. indent guides

Assigned to
9 months ago
7 months ago
No labels applied.

~whynothugo 9 months ago

I use indent-blankline.nvim as well, and would like to see this feature too...

To be honest, I'm not sure how to to implement it. I have an impression that the same plugin would need to implement both features with awareness of each other.

~thesast 9 months ago

Opened up an issue on indent-blankline.nvim 's github page: #596

~lukas-reineke 7 months ago

Hey ~whynothugo,

I am making progress with v3 of indent blankline. I built a system that would allow other plugins to hook into the logic of indent blankline. Do you want to take a look and see if this would work for you?

The code is on the v3 branch https://github.com/lukas-reineke/indent-blankline.nvim/tree/v3 This is still very much work in progress. And there is no documentation yet.

To try it, you can use this

local hooks = require "indent_blankline.hooks"
require("indent_blankline.hooks").register(hooks.TYPE.VIRTUAL_TEXT, function(tick, bufnr, row, virt_text)
    -- do stuff with the virtual text here
    return virt_text

I would guess you would need to have a table of row to IB virtual text per buffer. Then, when you make the virtual text for lsp lines, use the IB virtual text as the base and overwrite it with lsp lines where needed.

Let me know what you think, I'm happy to make changes.

Register here or Log in to comment, or comment via email.