Skip to content

Problems editing parentheses (and other paired characters) (low priority) #64

@david-a-wheeler

Description

@david-a-wheeler

Currently when you edit and you press "left parenthesis", the tool adds "right parenthesis". This makes sense in some contexts, but it's annoying in others - in many cases you are certain to need to delete the right parenthesis, and their insertion is more trouble than help.

I think using them should be an editor setting (on/off), so if you hate them they stop getting added.

If it's on, it'd be nice if they were inserted using a smarter algorithm. Here's a simple one (algorithm 1):

Insert the matching closing "paren" after the opening if the expression is at the end or the expression is followed by a closing "paren-like" symbol.

Algorithm 1 is at least simple to simple to implement.

Another algorithm (algorithm 2) would be:

only add the right paren after the left one if the whole statement would be syntactically valid (once the "(...)" expression was completed).

However, this second one is complicated, I'm not sure how to do that quickly & I doubt it's worth the trouble.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions