Allow "passthrough" of extmarks
I would like to keep the extmarks already set in my highlighting of the current window/buffer in the context if that is possible.
E.g., in this picture:
It would be better to keep the rainbow delimiter highlighting so that the first { is red, and I also think it would look nicer if the left most indent guide continued all the way to the top line.
I am not sure if what I want is already possible? But I couldn't find a way to achieve it.
If anyone has any idea how to implement this, I can spend some time working on it, but I am not sure where to start for now.
Now we no longer collapse lines in the context, this should be a lot easier to implement.
Now we no longer collapse lines in the context, this should be a lot easier to implement.
I have a version of this working with rainbow-delimiters now, but it is hard to make it work with all kinds of extmarks.
E.g. I wanted to transfer gitsigns's extmarks too, but it messes with the alignment of the line numbers, and I couldn't figure out how to easily fix it. I also wanted to transfer indent-blankline extmarks, but usually indent-blankline doesn't render indentation guides except for a few lines up and down (to save a lot of calculation).
I can make a draft pull request with the basic idea if you want? But I assume you wouldn't want to include code covering only specific extmarks from certain plugins?
I find nvim_buf_get_extmarks don't return the same information as specified with nvim_buf_set_extmark, which makes it hard to implement right. For example, mini.indentscope returns
{
hl_mode = "combine",
ns_id = 24,
priority = 2,
right_gravity = false,
virt_text = { { "│", "MiniIndentscopeSymbol" } },
virt_text_hide = false,
virt_text_pos = "win_col",
virt_text_repeat_linebreak = false,
virt_text_win_col = 4
}
while "win_col" is an invalid value that throws an error if apply directly in context buffer.
E5108: Error executing lua: ...vim-treesitter-context/lua/treesitter-context/render.lua:94: Invalid 'virt_text_pos': 'win_col'