Paul Evans wrote:

> On Sat, 4 Oct 2014 12:37:45 -0700
> "/#!/JoePea" <[email protected]> wrote:
> 
> > Hmmm, yep. I just tested. gvim and MacVim both don't differentiate
> > tab and ctrl_i!
> > 
> > */#!/*JoePea
> > 
> > On Sat, Oct 4, 2014 at 12:34 PM, Ingo Karkat <[email protected]>
> > wrote:
> > 
> > > On 04-Oct-2014 15:43 +0200, Bram Moolenaar wrote:
> > >
> > > > Not sure what your problem is.  This works just fine:
> > > >
> > > > imap <C-I> <Up>
> > > >
> > > > It does require gvim, since a terminal doesn't make a difference
> > > > between Tab and CTRL-I.
> 
> This, Bram, is exactly the thing I have been arguing at you for years
> now. You keep deflecting this down to make it sound like the terminal's
> fault, when we both know it isn't.
> 
> You and I both know full well that terminals don't distinguish them; I
> accept that. That's why I designed a better system, in cooperation with
> Thomas Dickey (the current xterm author). I have a terminal now that
> distinguishes any and all possible combinations of keypresses, and
> programs that understand it. Most of the programs I run regularly now
> do understand this - I can type Ctrl-I and Ctrl-Shift-A and so on
> absolutely fine. Vim is one of the few programs remaining that doesn't.
> (see attached screenshot-1).
> 
> Vim - I am talking specifically about vim here - conflates the possible
> keypresses of Ctrl-I vs Tab, of Ctrl-M(or is it Ctrl-J I forget) and
> Enter, of Ctrl-H and Backspace. It further conflates Ctrl-S and
> Ctrl-Shift-S, etc etc... And lets not get started on Unicode vs.
> Alt-letters.
> 
> Blaming terminals for this is just deflecting from the fact that vim's
> internals aren't sufficiently generic to represent the possible
> keypresses, regardless of how they arrive. That 1980s-style terminals
> couldn't do it is one thing but that is no excuse that a 2014-style
> GTK/Win32-driven GUI program cannot.
> 
> You cannot reply to the original poster of this email and claim that it
> works, until you can perform the following test IN GVIM to demonstrate
> it so.
> 
>   :imap <Tab> You typed tab
>   :imap <C-i> You typed Ctrl-I
>   :imap <C-S-I> You typed Ctrl-Shift-I
> 
> Then press all three keypresses and show it inserting different text.
> Do this in gvim, so as to avoid any reason to blame the terminal. For
> me, right now in GTK2-driven gvim, I get the Ctrl-Shift-I version all
> three times. (see attached screenshot-2)
> 
> Only when that works can you reply to the OP and say "this works".

This hack means backwards compatibility is dropped, it can't be included
without breaking lots of things.  Don't forget that users today rely on
CTRL-I doing the same as Tab.  Only when they are mapped separately
should the mean something different.

Your page doesn't say how to switch between the old mode, where CTRL-I
produces a 0x09 character, and one where it produces a different
character.  This is required for the terminal to be used with programs
that do not support the new codes.  One can't expect to have all
programs that a user uses to suddenly accept the new characters, thus a
switch between two modes is required.  Vim could switch to the new mode
and take care of a default set of mappings to the old meaning.  That's a
lot of work though.

Also, I don't see any note about different language keyboards.  There
are many, and the mechanism should work for all, with proper
documentation what happens for different keyboards.  Also, I don't see
anything for keypad keys, the numlock key and other keys that some
keyboards have that change what other keys mean.

-- 
hundred-and-one symptoms of being an internet addict:
226. You sit down at the computer right after dinner and your spouse
     says "See you in the morning."

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui