smart-snippet update: skip field with the same name

Consider the following snippet for TeX:

\begin{$${env}}
$.
\end{$${env}}
You may want to fill env and go directly to $.. But pressing TAB will bring you to line 3, and then line 2 -- where you want to go. Here the problem is when you've filled a field, what's your next action by pressing a TAB?
  1. If there's next field, go to that field.
  2. If there's no next field, exit the snippet -- go to the place marked by $. , or the end of snippet if no such marker.
That's it. Consider the 1st rule, why do you want to go to a field? To type something to replace the default value (env here). Then if the next field has the same name as the current field, there's no need to go to that field -- it will be automatically updated when you're typing in the current field. So I made an update to smart-snippet, if the next (and the next next, the next next next, etc. if any) field has the same name with the current field, pressing TAB will skip it (or them). However, this new feature may confuse old users. So I made a variable snippet-skip-same-field to disable/enable this feature (disabled by default). BTW: Someone asked me where's the mailing list. So I created a discuss group in google groups for smart-snippet.

Comments (2)

piteqiu December 04, 2007
It's perfect !
This new version is used very well .
pluskid December 04, 2007
I'm very glad to see that you like it. :)