martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 259 forks source link

:help doesn't display mappings starting with <Space> correctly #1060

Closed henricattoire closed 11 months ago

henricattoire commented 1 year ago

If I create a mapping that starts with a space, the help page only shows the space (and not the rest of the mapping).

vis:map(vis.modes.NORMAL, " s", function()
   vis:info("Hello!")
end, "Mapping that starts with <Space>.")
␣                   Mapping that starts with <Space>.

In the code below, vis will try to replace a literal space at the start of a key with . Doing this, vis disregards all other characters in the key.

Is this expected behaviour? I would expect vis to replace all instances of a literal space (in the key) with .