-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Bug: Scroll position gets lost in presentation mode #1019
Comments
Fixed. Added explicit check for presentation mode, but also needed to check sync mode on every back scroll operation in the script code to detect state changes. This was also broken previously (ie. if you switched modes). |
I believe this fix also fixes #1020 as I can not longer duplicate that. |
When you switch from default mode (editor and internal preview) to presentation mode (internal preview only) by
The suggested symmetric synchronization would be practical for example when you want to proofread a long document. In this use case you switch to the presentation mode for the complete reader experience. As soon as you find some issue in your document you would like to fix it quickly with the editor, without needing to find the position again that was just shown in the presentation mode. |
Unfortunately there's only so much I can do with this. I've been playing around with this for a while today and I've made some progress here. To recap what's actually happening: The reason that the original issue of the preview jumping is cropping up, it's due to the fact that the editor - while active - is invisible and the WebView2 control that underlies stops accepting events consistently (or at all) while invisible. So the normal behavior is, that in sync mode when you navigate the preview, the editor navigates to keep in sync. What's happening now is that the editor line update is sent and while the code eventually runs it's either delayed or pointing at an incorrect location. So I turned that off yesterday and that fixes the jumping problem but it introduces a whole new set of issues because now the two panes are not synced in any way and there's no easy way to trigger the editor to update from the preview manually (this usually fires off scroll events). So I'm thinking of making a different change which is to make the editor not quite invisible but leave a tiniest sliver of the editor visible. This seems to fix the problem including having the editor come up near the preview scroll location when switching back. Here's what that looks like: I played with making this as small as possible but if the size is too small it starts behaving as if it's completely hidden with a 0 width. It's certainly not perfect, but actually a big improvement over previous behavior in general as location is maintained (assuming sync is on). |
Narrowing the editor to a hairline instead of making it invisible is a nice idea and would be good enough. However sometimes MM v2.8.11 hangs when you return to non-presentation mode. The problem seems to occur between restoring the editor to its normal width and refreshing its contents, that is, in the end you see a blank editor as in the following example: Also note that SampleMarkdown.md is marked as modified ( |
Not sure I can't duplicate the lock up you describe. IAC I don't think think that's not directly related to the presentation mode switch but to editor activation. Please file a separate issue for that if it keeps occurring. I must have switched between modes yesterday around 1000 times and I didn't run into any failures. I have seen that in other situations (usually when the app is idle for a long period of time and then reactivated and windows are activated) but even then that is rare. IAC. It needs a separate issue... Closing this one |
Context
Initially MM v2.8.9.15 is in non-presentation mode (may be named normal mode).
By default the non-presentation mode shows the editor and the internal HTML preview.
Essentially the presentation mode shows only the internal HTML preview.
The
F11
key and the following button (in the title bar) toggle between non-presentation and presentation mode.Bug
The current scroll position gets lost in presentation mode a few seconds after scrolling in a large document if the
PreviewSyncMode
isEditorAndPreview
(default:EditorToPreview
).It seems that the preview is continuously synchronized with the editor although synchronization is needed only once when the presentation mode begins and should be suspended until the presentation mode ends.
The behavior can be reproduced with any document containing text for multiple screen pages.
Example:
Preview sync mode
isEditor And Preview
with button in lower right corner....\Markdown Monster\SampleMarkdown.md
withHelp > Show Markdown Feature Sample Document
.F11
.Related minor issues
Related mini-feature request
It would be nice if the transition presentation mode --> normal mode could be achieved also by the
Esc
key which is the longstanding de facto standard for returning to the previous state (and is deeply burned into my muscle memory).Motivation
I think the presentation mode is especially useful for proofreading when only a small monitor is available. So the external preview (preferably on a second monitor) is not practical or not applicable.
The competitor typora shines in this case because it allows you to edit in the presentation mode.
The text was updated successfully, but these errors were encountered: