-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
Describe the bug
mapset() doesn't translate special key codes.
To Reproduce
Write this in /tmp/t.vim:
nno K :echom 'original mapping'<cr>
let save_map = maparg('K', 'n', 0, 1)
nunmap K
call mapset('n', 0, save_map)
call feedkeys('K')
Start Vim with this shell command:
vim -Nu NONE -S /tmp/t.vim
The command-line is populated with:
echom 'original mapping'<cr>
Notice that <cr> has not been translated into a literal carriage return.
Expected behavior
When K is pressed, the Ex command :echom 'original mapping' is executed, just like it would have been before the mapping was removed by :nunmap.
Environment
- Vim version: 8.2 Included patches: 1-807
- OS: Ubuntu 16.04.6 LTS
- Terminal: XTerm(322)
Additional context
It's as if 'cpo' included the < flag which disables the recognition of special key codes.
However, that's not the issue here; 'cpo' does not contain this flag when started with -Nu NONE (-N resets 'compatible' which resets 'cpo' to aABceFs).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels