Closed Zeioth closed 3 months ago
It would be extra nice if we could specify width instead, but it seems this is not currently possible for [nvim_buf_set_extmark()](https://neovim.io/doc/user/api.html#nvim_buf_set_extmark()).
It would be extra nice if we could specify width instead, but it seems this is not currently possible for [nvim_buf_set_extmark()](https://neovim.io/doc/user/api.html#nvim_buf_set_extmark()).
This is possible, but not directly via the vim API. Instead you would need to create 2 separate marks. One that highlights the text and another that starts after the text using virt_text_win_col
and does an overlay
with spaces to fill the remaining gap.
I think it makes sense to leave the door open for supporting a width
or right_pad
attribute in the future.
I don't think the background_eol
argument would fit nicely with that. To keep some internal consistency can you follow the code
configuration example and add a width
field instead with values of full
which would be for the current behavior & block
for the new behavior.
Then the mark logic becomes: hl_eol = heading.width == 'full',
.
Code block PR for reference: https://github.com/MeanderingProgrammer/markdown.nvim/pull/88.
In the future we can add something like right_pad
but not necessary in this PR.
If you wanna take it from here it's ok. Otherwise I can come back to it in a few days.
Cool, merged it here: https://github.com/MeanderingProgrammer/markdown.nvim/commit/426b13574c8264636e5660e5f5a3b4f5e3d5a937.
Mostly just the rename to heading.width
instead of heading.background_eol
.
Thanks for the PR!
left_pad, right_pad, and min_width have all been added as options for headings: https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/6392a5dfa10f367e10fe58ea9c2faf3179b145d5
The new option
When set to false, it allow rendering the background until the
end of the text
, instead of until theend of the line
:Which again, it's really nice for people using
vim.opt.colorcolumn
.