Home Download Buy Blog Forum Support

keybinding issues

keybinding issues

Postby vim on Sun Nov 01, 2009 8:38 pm

keybinding... as discussed already there is a problem with the current implementation.

if have you have bindings that look like that:
action1 - a
action2 - a,b
action3 - a,b,c

on the above case sublime won't trigger actions till it is not absolutely sure the user doesn't try to do action3, so pressing a and waiting will hang for ever, or at least till you press something different than b. if you wrote all the binding you may know what to expect, but imagine many people wrote their binding, you can never know which sequence was used, and you don't have any feedback. for example, say another person just added the following bindings:
action 100a - a,b,c,a
action 100b - a,b,c,b
action 100z - a,b,c,z

suddenly you will enter a,b,c, and nothing will happen, more over your bind will never trigger because a,b,c,X is masked by the new bindings.

this system is not good.

VIM solves this by a timeout which after it the editor understands the sequence has ended, only when there is a valid sequence, i.e. it won't timeout in the middle if there is no valid sequence, so when u have:

action 1 - a,b,c
action 2 - a,b,c,b

and u press a,b and wait, it is ok, then if u press c and pause briefly it will invoke action3
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: keybinding issues

Postby tgkeul on Mon Nov 02, 2009 7:34 pm

Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: keybinding issues

Postby jps on Thu Nov 05, 2009 11:53 am

I'll add this in the next beta
Site Admin
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: keybinding issues

Postby vim on Thu Nov 05, 2009 12:02 pm

i was trying to think of a better solution then a timeout (like termination unique key) but i can't come up with better ideas...
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: keybinding issues

Postby dimituri on Sun Nov 08, 2009 11:30 pm

Is this thread abbout snippet keybindings? If so, have you considered making it TextMate-ish?

In TextMate the actual key sequence doesn't matter. The <Tab> key, when pressed, makes the editor look at the word to the left of the caret, and trigger the corresponding snippet, if such exists.

In my opinion, this makes much more sense, as making a typo while writing a long snippet name wouldn't make you start over. :)
Posts: 1
Joined: Sun Nov 08, 2009 11:20 pm

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 8 guests