-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
"Shaky" text when typing each character (short documents) #47
Comments
PS: It is as if Typewriter Scroll was hesitating between two positions on the screen: a first position where the text is shown for a very short time, and then the final position. Each time I press a key, the first position is used, and then the final position. |
I have the same effect, but it appears on any note. When I activated the plugin, at first everything worked almost normally. These jumps also happened, but much less often. But then for some reason they also began to happen from every click. Although I did not change anything. Reboot did not help. OS: Windows 10 |
Same issue. |
This plugin works perfectly: https://github.com/davisriedel/obsidian-typewriter-mode |
@fcFn I found the other plugin to be really buggy. Utterly unusable. This seems to be linked to a previously closed issue #6 but I checked my current plugin is up to date and the code changes for the I have also found the same problem of 'each character causes the window to go up and down' but my zen mode is deactivated and the document is rather long. This doesn't happen for all lines, but a shaky line remains shaky for the whole line. I think this may be due to how we divide the offsetHeight - how is it rounded? function onRefresh(cm) {
const halfWindowHeight = Math.ceil(cm.getWrapperElement().offsetHeight / 2);
const linesEl = cm.getScrollerElement().querySelector('.CodeMirror-lines');
linesEl.style.paddingTop = `${halfWindowHeight}px`;
linesEl.style.paddingBottom = `${halfWindowHeight}px`; // Thanks @walulula!
if (cm.getSelection().length === 0) {
cm.execCommand("scrollSelectionToCenter");
}
} so I did this fix |
When a note is not very long (like when it starts empty) and is entered in a "tall" window, each typed character makes the whole not text "shake". This is not very convenient.
In case this matters:
Thanks!
The text was updated successfully, but these errors were encountered: