Skip to content

In nested code I can't tell which brace closes which block #336

Description

@a-team-app

Opportunity

In nested code I can't tell which closing brace belongs to which block, or where the block I'm in ends.

Reading unfamiliar code is most of the vision's user's day. A C# method with a switch inside a foreach inside a using ends in a staircase of }, and a long LINQ or JSON expression ends in ))) or ]}. To find where a block ends, or what a } closes, I scroll and count by eye. Delete or add one while editing and nothing tells me the pairs no longer line up until the build fails.

TuiCode gives no help here: nothing is highlighted when the cursor sits on a bracket, there's no command to jump to the partner, and no guide or colour ties pairs together.

Evidence

  • The code on origin/main (5cd1883) has no bracket matching of any kind: no match on bracket, brace or MatchPair under src/. None of the ~70 commands moves to a matching bracket.
  • No existing issue, open or closed, covers it.
  • Every editor the user comes from has it. VS Code highlights the matching bracket, has Go to Bracket (Ctrl+Shift+\), and made bracket pair colours and guides built-in because the extension doing it was so widely used (Bracket pair colorization 10,000x faster, bracket guides). JetBrains highlights pairs by default.
  • So do the terminal editors people would otherwise use. micro has a matchbrace option on by default, styled by a match-brace theme colour (micro options). Vim's % and Helix's mm are among the first keys people learn.

Why it fits

  • Familiar: a VS Code user expects the partner of a bracket to light up, and reaches for the jump without thinking. Its absence is one of the small things that sends them back to another editor (theme 1, daily-driver gaps).
  • The vision's user "spend[s] most of their time navigating code bases… and trying to understand existing/new code": seeing structure is core to that.
  • Cheap on the terminal: a highlight is two cells, works over SSH and in every terminal, and costs nothing at startup.
  • micro isn't named in the vision's list of products it learns from; it's the closest terminal editor with the same non-modal, familiar-keys goal.

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

    a-team:ideaFound by the a-team Lead; give it a Priority to have it pitched

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions