Skip to content

Key mappings through 'langmap' don't respect mappings, if "from" key is not 7-bit ASCII #7458

@filbranden

Description

@filbranden

Describe the bug
When using the 'langmap' setting to map keys from non-English keyboard layouts into keys such as braces and brackets in Normal mode, if the "from" key in the mapping is an accented character such as á, é or ø, or an extended symbol such as , the "to" is not used to expand mappings defined with that symbol. If the "from" character is a basic symbol such as (, [ or 3, it works as expected.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean
  2. Create a mapping to make < turn the text object uppercase: nmap < gU
  3. Set a langmap with a special key mapping to <, for example :set langmap=á<
  4. Type some contents into the buffer, preferrably lines with lowercase letters and with some indentation.
  5. Use the áj command.

Expected behavior
I'd expect this to behave the same as gUj, meaning turn the current and following line to uppercase.

Instead, this ends up executing the original behavior of <, which is to unindent the current and following line.

The 'langremap' setting doesn't seem to make a difference here. (As I understand it, it defines how the RHS of mappings work.)

Using a symbol in the 7-bit ASCII range seems to work fine, for example :set langmap=[< or :set langmap=3<.

Environment (please complete the following information):

  • Vim version 8.2.2127 (latest from GH), Vim 8.2.1885 (Fedora), (also DroidVim, version 8.2.1704)
  • OS: Linux (also Android for DroidVim)
  • Terminal: GNOME Terminal (DroidVim ships its own copy of the Android Terminal Emulator)

Additional context
Uncovered in this question on the Vi & Vim Stack Exchange.

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