On 5/5/06, Mikolaj Machowski <[EMAIL PROTECTED]> wrote:
Dnia piątek, 5 maja 2006 14:35, Eric Arnold napisał:
> I think [email protected] is probably a place to start...
>
> I've been hacking the statusline for a long time to do various things
> a keystroke at a time.  I've finally got a compiling env, so I decided
> to take a stab a creating a key-event.

Very, very, very good thing. It makes possible high-level of automation
for some things - eg. map Space and pry it will not interfere with some
scripts.

Personally I'd like to see separation for Insert and Normal mode
(GetChar, GetCharI?).


I think 'mode()' will probably suffice for this?  I don't see any
place inside Vim where it distinguishes keys in the typeahead buffer
as to what mode they were entered in.  However, in all practical
circumstances, if you call "mode()" from inside the handler for the
GetChar event, you should get what you want.


Also for practical purposes it would be probably better to return actual
letter.


Actually, I'm in the process of trying to get the correct multi-byte
and function key strings.  As for single byte chars, the default
behavior for getchar() is to return a number, as in C.  Returning a
string consistenly would be nice, but I don't know what to think about
the clash with getchar().


warning in gcc 4.0.1
eval.c: In function 'set_getchar_event_vvars':
eval.c:21116: warning: pointer targets in assignment differ in signedness
eval.c:21118: warning: pointer targets in assignment differ in signedness
eval.c:21120: warning: pointer targets in assignment differ in signedness

Oddly, my gcc didn't show this.  This is actually a string literal
assignment for v:getchartype.  I'm not sure why this is, but maybe I
need to use Vim STRCPY(), or maybe it just needs a (char *) or
whatever.

Reply via email to