Home Download Buy Blog Forum Support

tab driven snippets

Re: tab driven snippets

Postby jps on Sun Apr 20, 2008 3:36 pm

One of the advantages of the current system is that it enables $SELECTION to be used: For example, you select some lines, split the selection into lines, then type l,i,tab and have each line enclosed in a <li></li> pair.

The nature of the sequence key bindings is that once a key sequence is matched, the changes to the buffer are rolled back, and the command is run. This means that the selection is available within the snippet, but it wouldn't be if they were triggered off the contents of the buffer.

It does have the problem you mention though, where it doesn't play well with typos.

Perhaps a reasonable middle-ground that doesn't involve adding much complexity to the system is to make backspace a special case in sequence key bindings, causing the last entered character to be forgotten, e.g., t,a,b,p,backspace,l,e would be equivalent to t,a,b,l,e. This would make most of the cases work (using the arrow keys when fixing the typo would make the key binding not trigger), but would avoid some issues too.
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests