Skip to content

&isident option is responsible for parsing special characters #2389

@ZyX-I

Description

@ZyX-I

Consider the following script:

% vim -u NONE -i NONE -N --cmd 'nnoremap <C-u> x' --cmd 'set isident=' --cmd 'nnoremap <C-x> u' --cmd $'nnoremap \C-x|nnoremap \C-u|echo "-"|nnoremap' --cmd cq
No mapping found
n  <C-U>       * x
-
n  <C-U>       * x
n  <C-x>       * u

You may see here that while <C-u> mapping was defined as expected <C-x> mapping was defined exactly as if I used <LT>C-x>, which is not the case. I do not really see why &isident option needs to affect VimL parsing at all (I mean parsing $env, this does not include /\i and “after a match of the 'define' option”: $env is editor-global, /\i and &define could be/are filetype-specific), but this specific case is listed neither under :h 'isident' nor under :h key-notation.

The root of the problem is the use of vim_isIDc() in find_special_key().

Vim version 8.0.1358.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions