Skip to content

Jitter in typewriter mode #118

@khaeru

Description

@khaeru

Running:

  • Zen 0.18.0
  • Atom 1.24.1
  • Ubuntu Linux 17.10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions