any keys remapped by a langmap are not restricted
Describe the bug any keys remapped by a langmap are not restricted when added to restricted keys.
Config options
The options table passed into the setup() function.
opts = {
restriction_mode = "block",
restricted_keys = {
['n'] = { 'n', 'x' },
['e'] = { 'n', 'x' },
['i'] = { 'n', 'x' },
},
or, alternatively
opts = {
restriction_mode = "block",
restricted_keys = {
['j'] = { 'n', 'x' },
['k'] = { 'n', 'x' },
['l'] = { 'n', 'x' },
},
To Reproduce Steps to reproduce the behavior:
- Set a langmap, like the one below that I use, which runs before plugins are loaded:
vim.opt.langmap = vim.fn.join({
'nN' .. ';' .. 'jJ',
'eE' .. ';' .. 'kK',
'iI' .. ';' .. 'lL',
'kK' .. ';' .. 'nN',
'uU' .. ';' .. 'iI',
'lL' .. ';' .. 'uU',
'fF' .. ';' .. 'eE',
'tT' .. ';' .. 'fF',
'jJ' .. ';' .. 'tT',
}, ',')
- Load plugins (in this case with
lazy.nvim). - press restricted key repeatedly
Expected behavior
should get notification saying "You pressed
Screenshots N/A
Additional context
I saw people ran into similar issues when remapping the movement keys, but I can't move my langmap into keys the way a single binding can be moved. For keys/sequences which were affected using hint, I had to manually change the hotkeys, but after doing so, they worked. However, since the restriction of the movement keys are taken care of in the init.lua function rather than the config, I couldn't find any way to customize/change this:
https://github.com/m4xshen/hardtime.nvim/blob/6513bf42cd9261669d1ee41ff8b4065dfdc53a09/lua/hardtime/init.lua#L98-L107