<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-02-26 19:54 GMT+01:00 Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 26.02.2015, at 04:05, Marcel Taeumel &lt;<a href="mailto:marcel.taeumel@student.hpi.uni-potsdam.de">marcel.taeumel@student.hpi.uni-potsdam.de</a>&gt; wrote:<br>
&gt;<br>
&gt; Okay. Tim just explained to me, what Bert&#39;s &quot;stack&quot; actually means, and that<br>
&gt; it is not necessarily a stack from an implementation point of view but<br>
&gt; merely a smart counter. :)<br>
&gt;<br>
&gt; Sounds reasonable. And much cheaper than asking the Parser if there are too<br>
&gt; few closing brackets. And similar (even better) from a usability<br>
&gt; perspective.<br>
<br>
</span>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&#39;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&#39;re back to regular, non-magic editing.<br>
<br>
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&#39;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.<br>
<span class=""><br>
&gt; I will look into it later this day.<br>
<br>
</span>Awesome!<br>
<span class="HOEnZb"><font color="#888888"><br>
- Bert -<br>
<br>
</font></span><br></blockquote><div>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?<br><br></div><div>This is somehow a light way to stack the states...<br></div></div><br></div></div>