chipsenkbeil / org-roam.nvim

Port of org-roam to neovim using orgmode
MIT License
107 stars 9 forks source link

[UPSTREAM] Preview highlighting does not work for more than 5 lines #9

Closed chipsenkbeil closed 6 months ago

chipsenkbeil commented 6 months ago

Tied to https://github.com/neovim/neovim/discussions/28158.

When using nvim_buf_call to detect the filetype and redraw the lines for an orgmode buffer, the "autocmd window" created has a height of 5 lines, which seems to result in subsequent lines not getting any extmarks applied.

One potential solution I can think of is to break up the lines into chunks of 5 to render. This may work, but means even more fragmentation with the highlighting.

Ideally, we'd find a way to apply treesitter highlights to a range. I think that would be better than proceeding any further with the current hack. To do the treesitter range, we'd just have treesitter do the parsing as a string parser, use the highlights query and others to apply captures, iterate the captures, generate the highlights on relevant lines, and then translate the highlights to our range.

chipsenkbeil commented 6 months ago

Resolved by #10 where we create a custom window the size of the editor.