Skip to content

Lag in bringing the cursor back to it's original postion after tidy operation. #1705

Closed
@namanarora00

Description

@namanarora00

Nature of issue?

Found a bug

Details about the bug:

There is a small lag in moving the cursor to its original position after the tidy operation. This I believe is because we wrap the function in a setTimeout which delays it.

setTimeout(() => {
      this._cm.focus();
      this._cm.doc.setCursor({ line: currentPosition.line, ch: currentPosition.ch + INDENTATION_AMOUNT });
}, 0);

Why do we need to use setTimeout here as the position to which we're bringing back the cursor is simply the old line number and character number.

  • Web browser and version: Chrome Version 87.0.4280.88
  • Operating System: MacOS Big Sur
  • Steps to reproduce this bug: Execute the tidy operation using either the keyboard shortcut or in the menu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions