When I activate the typewriter option, there is noticeable "jitter"—a brief vertical shift/distortion of the text—on every keystroke. This happens whether typing new text, cutting/pasting, or simply moving the cursor left or right with the arrow keys, and it causes eyestrain, so I find the option unusable :(
Zen seems to implement this option by listening for the event did-change-cursor-position. Two ideas for a fix (that I'm sorry I don't have bandwidth to experiment with right now):
Check if the changed cursor position involves a change of row. If the cursor has not changed rows, don't scroll.
Zen calls the low-level method TextEditorElement.setScrollTop(). There is an official API method TextEditor.scrollToCursorPosition() that, by default, tries to center the cursor. It invokes some complex autoscrolling mechanism, which might avoid producing jitter.
Running:
When I activate the typewriter option, there is noticeable "jitter"—a brief vertical shift/distortion of the text—on every keystroke. This happens whether typing new text, cutting/pasting, or simply moving the cursor left or right with the arrow keys, and it causes eyestrain, so I find the option unusable :(
Zen seems to implement this option by listening for the event
did-change-cursor-position
. Two ideas for a fix (that I'm sorry I don't have bandwidth to experiment with right now):TextEditorElement.setScrollTop()
. There is an official API methodTextEditor.scrollToCursorPosition()
that, by default, tries to center the cursor. It invokes some complex autoscrolling mechanism, which might avoid producing jitter.