Skip to content

Commit 37f52f0

Browse files
Bekaboobekaboo
andauthored
fix: not updating when window scrolled (#185)
\#\# Details The rendering is not updated when the window is scrolled while the cursor is fixed (can be reproduces using `<C-y>`, `<C-e>`, `zz`, `zt`, `zb` to scroll the window). This leaves new elements that becomes visible in current window undecorated. To fix this simply add 'WinScrolled' event to the updating events. Co-authored-by: bekaboo <[email protected]>
1 parent aad1a12 commit 37f52f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/render-markdown/manager.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function M.attach(buf)
5252
return
5353
end
5454
local config = state.get(buf)
55-
local events = { 'BufWinEnter', 'BufLeave', 'CursorHold', 'CursorMoved' }
55+
local events = { 'BufWinEnter', 'BufLeave', 'CursorHold', 'CursorMoved', 'WinScrolled' }
5656
local change_events = { 'DiffUpdated', 'ModeChanged', 'TextChanged' }
5757
if config:render('i') then
5858
vim.list_extend(events, { 'CursorHoldI', 'CursorMovedI' })

0 commit comments

Comments
 (0)