Skip to content

Add cursor-following scroll sync to browser preview#6

Open
halkn wants to merge 1 commit intomasterfrom
claude/cursor-following-preview-uDO3o
Open

Add cursor-following scroll sync to browser preview#6
halkn wants to merge 1 commit intomasterfrom
claude/cursor-following-preview-uDO3o

Conversation

@halkn
Copy link
Owner

@halkn halkn commented Feb 25, 2026

  • server.lua: add scroll_to(cursor_line, total_lines) that broadcasts a
    named SSE event (event: scroll) with the cursor ratio (0–1)
  • init.lua: register CursorMoved/CursorMovedI autocmd with a 50 ms
    debounce that calls srv.scroll_to() on each cursor movement
  • template.lua: add evtSource.addEventListener('scroll', ...) that maps
    the ratio to window.scrollTo with smooth behavior

https://claude.ai/code/session_01TvNMfivCRVGW9mEmZpqAxp

- server.lua: add scroll_to(cursor_line, total_lines) that broadcasts a
  named SSE event (event: scroll) with the cursor ratio (0–1)
- init.lua: register CursorMoved/CursorMovedI autocmd with a 50 ms
  debounce that calls srv.scroll_to() on each cursor movement
- template.lua: add evtSource.addEventListener('scroll', ...) that maps
  the ratio to window.scrollTo with smooth behavior

https://claude.ai/code/session_01TvNMfivCRVGW9mEmZpqAxp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants