Open Bekaboo opened 1 month ago
There's a few issues here,
At the moment it's not possible to handle multiple windows. But maybe in the future this can be added.
How about just not to clear off screen extmarks as a workaround?
That leaves different kinds of edge cases.
If you have something like this in a help file.
>lua
vim.print("something");
<
If any of the line is within the range of the renderer the entire thing will be rendered.
Let's say, you open the file and started at the bottom of the file and the last line of the code block was in the range.
Then you did gg
, this time you went to the top of the file and only the first line of the code block was in the range.
Now, you permanently have 2 extmarks that won't go away unless you manually scroll over them.
This becomes an issue with headings
.
Plus some lines in the help file contain a lot of inline elements. They would be duplicated.
And the modeline
will also have a lot of duplicate lines.
I see.
There's no clean way to get all the attached windows so the plugin doesn't work well when you have multiple windows with a single buffer.
FYI vim.fn.win_findbuf(bufnr)
returns a list of windows that contains the given buffer. I think it's quite clean.
When a help file is splitted into two windows and one of the window scrolls, the visual effects can be cleared in another window, expect both windows render normally.
I believe this is because helpview clears "off-screen" extmarks but it only considers visible range of the current window instead of all windows that contain the help file.
https://github.com/user-attachments/assets/940a270e-20a8-40c0-ba22-9710d69f4ee6