Tuesday, May 24, 2011

Re: Unexpected special keys' behaviour.

On Wed, 25 May 2011 06:07:08 +0300, Daniel Fishman <quantera@gmail.com> wrote:

>if you start insert mode
>and type:
>
>'abc <BS>xyz<ctrl-o>u'
>
>then you get to the initial state (empty screen) instead of 'abc '.
>
>
>In case of ':<ctrl-k><ctrl-h>': you get ':?', which is identical
>to typing just ':<ctrl-k>'

Well, now after writing a second time about the problem I started
to understand something: backspace is not the key labeled 'Backspace'
on the keyboard: this key emits ascii code 127, which is the delete key
(<Del>). So this explains why the first case ':inoremap <C-H> <C-G>u<C-H>'
doesn't work with the key labeled 'Backspace': because it is not
backspace (which emits ascii code 8, like <c-h>), this is the delete key.

It still does not explain why ':inoremap <BS> <BS>u<C-H>' work for
key labeled 'Backspace'. Also, it doesn't explain the second case.
Moreover, typing '<c-k><key labeled 'Backspace'>' results in ':<BS>'
written on the command line instead of the expected ':<Del>'. You
get ':<Del>' by typing '<c-k><key labeled 'Delete'>', which is
incorrect, since the key labeled 'Delete' emits a sequence of ascii codes
27, 92, 51, 126 (unlike regular keys), but certainly not ascii code 127
of the delete key.

--
You received this message from the "vim_use" 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

No comments: