You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's currently no way to inspect the command state, i.e. which keys have been punched in and what command is in the process of being built. Knowing this would be useful for a couple of features:
Displaying the current command state, which characters and what count, if any, has been entered, in case you get distracted in the middle of something and forget.
To provide contextual help. This will both reduce the need to memorize commands AND make it easier to learn them. For example, if g has been entered, the UI could display a list of possible characters to "complete" the command:
g - Go to top
t - Go to next tab
T - Go to previous tab
u - Convert to lowercase
U - Convert to uppercase
~ - Swap case
] - See all definitions
Technical details
The command state, at least in normal mode, is stored in state_current->context->ca, a cmdarg_T. state_current->context is a void* and will point to different data structures depending on mode, but normal mode is mostly what I'm interested in here (or "Normal", "Visual" and "Operator" I guess, according to get_real_state()).
A new function vimGetCommandState could return either the entire cmdarg_T struct, or a subset if that's easier to bind to from Reason. Or null if the stars aren't aligned.
The text was updated successfully, but these errors were encountered:
This is a great suggestion, @glennsl ! Thank you! I like the idea of vimGetCommandState. Seems like this wouldn't be too hard to wire up - all the information is around.
Contextual help would be an amazing feature and help lower the learning curve & barrier to entry significantly.
…#218)
This adds an API to get the current pending-operator information (what operator is pending, any associated register, and count). This is part of a fix for #163 - there are still some items that would be useful that this doesn't provide (ie, typed characters _prior_ to an operator becoming active).
There's currently no way to inspect the command state, i.e. which keys have been punched in and what command is in the process of being built. Knowing this would be useful for a couple of features:
Displaying the current command state, which characters and what count, if any, has been entered, in case you get distracted in the middle of something and forget.
To provide contextual help. This will both reduce the need to memorize commands AND make it easier to learn them. For example, if g has been entered, the UI could display a list of possible characters to "complete" the command:
Technical details
The command state, at least in normal mode, is stored in
state_current->context->ca
, acmdarg_T
.state_current->context
is avoid*
and will point to different data structures depending on mode, but normal mode is mostly what I'm interested in here (or "Normal", "Visual" and "Operator" I guess, according toget_real_state()
).A new function
vimGetCommandState
could return either the entirecmdarg_T
struct, or a subset if that's easier to bind to from Reason. Or null if the stars aren't aligned.The text was updated successfully, but these errors were encountered: