Skip to content

Auto-pair brackets option and VARIABLES lead to four closing brackets #566

Closed

Description

@ryanthara

When editing a template with the activated Auto-pair brackets option, additional two closing brackets are inserted every time, when using VARIABLES which are enclosed by design in double brackets.

Example: {{cursor}} is completed to {{cursor}}}}

Activity

  1. adibhanna commented on Aug 10, 2026

    @adibhanna
    Contributor

    Thanks for the report, and for naming the exact interaction: it is the combination of the two features, not either one alone.

    What happened: with auto-pair brackets on, typing {{ gives you {{}} with the caret in the middle, which is correct on its own. But the template variable completion then replaced only the text from the opening braces to the caret with the full {{cursor}}, so the auto-paired }} sitting after the caret survived, and every accepted variable came out as {{cursor}}}}. (Typing the braces out by hand was never affected: typing } over an auto-paired closer steps over it. Only accepting a variable from the popup left the extras behind.)

    Fixed in f872b5b on the v2.27.0 branch: the completion's inserted text carries its own closing braces, so applying it now swallows up to two } characters already at the caret. That also fixes a cousin you could hit without auto-pair: editing an existing variable in place (say {{date}} down to {{ti}}) and accepting {{time}} used to leave the old pair's braces behind too.

    How to test locally once it ships (or from the branch): with Settings > Editor > Auto-pair brackets on, open Settings > Templates > New template, type {{cur and accept the completion. Before: {{cursor}}}}. After: {{cursor}}. Ships in 2.27.0.

  2. adibhanna commented on Aug 10, 2026

    @adibhanna
    Contributor

    Closing as fixed by f872b5b on the v2.27.0 branch; ships with 2.27.0.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions