Skip to content

Completing \overline, \sqrt, \hat... in LaTeX mode leaves the caret after an empty argument #3084

Open

Description

@hkarlsen06

Environment

  • MathLive 0.110.0
  • macOS, Chrome/Electron

Steps to reproduce

  1. Focus a mathfield.
  2. Type \overline and press Space (or Enter) to complete it.
  3. Type AB.

Expected

\overline{AB}: the caret goes into the argument, like it does for \frac.

Actual

\overline{} is inserted with the caret after it, so nothing is visible and AB lands outside. The same happens for \sqrt, \boxed, \hat, \vec, \underline. \frac and \binom get \placeholder{} arguments and work.

A missing argument parses to an empty body (scanArgument returns null, argAtoms(null) is []) instead of a placeholder, so complete()'s selectionMode: 'placeholder' has nothing to select.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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