Kemap expr stopped working in Neovim 0.8

After installing Neovim 0.8, this keymap stopped working:

vim.keymap.set("n", "<Leader>/",
               "expand('%') == '' ? '<Cmd>Lp %:p:h<CR>' : '<Cmd>Lp %<CR>'",
               {noremap = true, expr = true})

It used to work with Neovim 0.7. I couldn’t find anything related in the release notes. Any idea why?

No error is thrown when the keymap is defiened. However, invoking the mapping doesn’t have an effect.

Add replace_keycodes = false to opts

1 Like