max397574/better-escape.nvim

better-escape is too eager to delete mappings

gsinclair opened this issue · 1 comments

I have a visual-mode mapping for j that is independent of better-escape. I then call better-escape's setup with options default_mappings = false and I only set up an insert-mode mapping. But the effect of loading better-escape is that my visual-mode mapping for j is deleted.

Looking at the code, I see that unmap_keys acts on every mapping in the default mappings. It is not sensitive to what the user has provided.

Version of plugin used: latest as at 20 July 2023.

Configuration:

  {
    "max397574/better-escape.nvim",
    config = function()
      require('better_escape').setup {
        default_mappings = false,
        mappings = {
          i = {
            j = {
              k = '<Esc>'
            }
          }
        }
      }
    end
  },

should be fixed now