Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronised scrolling is not bidirectional between panes #621

Open
donjan opened this issue May 29, 2023 · 3 comments
Open

Synchronised scrolling is not bidirectional between panes #621

donjan opened this issue May 29, 2023 · 3 comments

Comments

@donjan
Copy link
Contributor

donjan commented May 29, 2023

Using ReText 7.2.3 on Ubuntu 22.04.

Enabled the WebKit renderer option, as well as Preferences -> Enable synchronized scrolling for Markdown.
With live preview on.

Observed behaviour

Scrolling in the editor pane synchronises the live preview.
Scrolling in the live preview render does not scroll synchronise the editor, which stays still.

In large documents, when something to improve is found by scrolling through the preview, finding the location in the editor is tedious. Moving the mouse to the editor pane and starting to scroll immediately loses the point of interest in the preview.

Expected behaviour

Scrolling in either pane should synchronise the other.

A less convenient but functional alternative might be a "go to current location in editor" context menu in the preview.

Additional info

Issue #108 requests "sync, no matter in which window the user scrolls" and is marked as closed, but doesn't match the expected behaviour.
Issue #513 is still open but the comment history doesn't clarify directionality.

https://github.com/retext-project/retext/blob/master/ReText/syncscroll.py gives the impression that only the direction editor->preview is implemented.

@donjan
Copy link
Contributor Author

donjan commented May 30, 2023

Thinking some more about it, here are two additional possible workarounds:

  1. Disable scrolling in the right pane. Always moving the mouse to the left pane requires minimal adaptation and guides the user into avoiding the issue. Probably easy to implement.
  2. Disconnect scrolling from moving the content in the right pane and apply it to the left pane instead. I.e. scrolling in either pane scrolls the left one, which then synchronises the right one. Provides unified scrolling feeling.

@donjan
Copy link
Contributor Author

donjan commented Jun 4, 2023

Now switched to Retext 8.0.1, issue as described in OP persists.

@donjan
Copy link
Contributor Author

donjan commented Apr 9, 2024

In webenginepreview.py::ReTextWebEnginePreview, only the editBox (left side) is hooked up to events.
We can hook up the preview (right side) to events (after the variable webPage is defined in the constructor):

webPage.scrollPositionChanged.connect(lambda value: print(value))

But as mentioned, SyncScroll is currently not equipped to update the editor window.

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

No branches or pull requests

1 participant