2015-02-26 19:54 GMT+01:00 Bert Freudenberg <bert@freudenbergs.de>:
On 26.02.2015, at 04:05, Marcel Taeumel <marcel.taeumel@student.hpi.uni-potsdam.de> wrote:
>
> Okay. Tim just explained to me, what Bert's "stack" actually means, and that
> it is not necessarily a stack from an implementation point of view but
> merely a smart counter. :)
>
> Sounds reasonable. And much cheaper than asking the Parser if there are too
> few closing brackets. And similar (even better) from a usability
> perspective.

What I was proposing (and what is *standard* behavior in about any code editor) has nothing to do with the parser. It is not counting any parens that are in the text already. It's not even aware of syntax. It merely temporarily keeps track of what was auto-inserted, on a single line, not globally, not forever. As soon as you move the cursor you're back to regular, non-magic editing.

Auto-inserted parens are magic. This magic lasts until the user is done editing that single expression. It should be nothing fancy from a user's point of view. Using it should not be any more complicated than using a non-magic editor. But most importantly, the magic must not get in the way. We should delight our users with magic, not make them wish for a dumb editor because the magic is annoying.

> I will look into it later this day.

Awesome!

- Bert -


What if we used a specific emphasis like maybe #autoInserted with a specific rendering (i.e. a fade gray background...) until there is a right arrow key, or a closing parenthesis, a delete key, or a left click positionning the cursor over the magically inserted characters?

This is somehow a light way to stack the states...