Commit 966472e
committed
Disable rendering on next listened to event after horizontal scroll
# Details
This plugin does not and will not gracefully handle horizontal
scrolling.
As such add logic to validation to check the left column of the
current window attempting to be rendered.
If this value is larger than zero rendering will not proceed.
We could add an additional event to listen to scroll events, like so:
```lua
vim.api.nvim_create_autocmd({ 'WinScrolled' }, {
group = group,
callback = function()
for win, changes in pairs(vim.v.event) do
if win ~= 'all' and changes.leftcol ~= 0 then
local buf = util.win_to_buf(win)
vim.schedule(function()
ui.refresh(buf)
end)
end
end
end,
})
```
Which would disable and re-enable rendering on horizontal scroll
events as appropriate.
However listening to every single scroll event seems heavy for this
plugin to do, so I would rather avoid it. Maybe make it opt-in, at
some point in the future if users want.1 parent 2263b7d commit 966472e
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
0 commit comments