nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

[BUG] keymaps: mapping telescope's undo extension breaks custom keymaps

Open PowerUser64 opened this issue 1 year ago • 0 comments

Field Description
Plugin telescope
Nixpkgs 63c3a29ca82437c87573e4c6919b09a24ea61b0f
Home Manager 9036fe9ef8e15a819fa76f47a8b1f287903fb848

  • [x] I have read the FAQ and my bug is not listed there.

Description

Binding a key to Telescope's undo plugin causes custom keymaps to stop working.

Minimal, Reproducible Example

programs.nixvim = {
  plugins.which-key.enable = true; # helps see what's happening
  plugins.telescope = {
    enable = true;
    keymaps = {

        ###### the problematic line - comment this to "fix" the bug
        "<leader>fu" = { action = "undo";         options.desc = "Telescope Undo"; };

        # These should work fine
        "<leader>ff" = { action = "builtin";      options.desc = "Telescope Builtin"; };
        "<leader>fg" = { action = "live_grep";    options.desc = "Telescope Live Grep"; };
    };
    # NOTE: the undo plugin doesn't have to be enabled
    #extensions.undo.enable = true;
  };

  # test keymaps
  globals.mapleader = " ";
  keymaps = [
    {
      action = "<cmd>help<CR>";
      key = "gh";
      mode = [ "n" ];
    }
    {
      action = "<cmd>help<CR>";
      key = "yu";
      mode = [ "n" ];
    }
    {
      action = "<cmd>help<CR>";
      key = "<leader>g";
      mode = [ "n" ];
    }
  ];
}

Steps to reproduce

  1. load nixvim with the config above
  2. try using any of the custom keymaps (gh, yu, <leader>g)
    • they don't work (help page doesn't open)
    • note that <leader>ff and the other telescope.keymaps options work (as they should)
  3. comment line 8 (the problematic line)
  4. try using the custom keymaps from before
    • help page opens, they work
    • all other telescope.keymaps options still work

it took me 2 days to find this :sob:

PowerUser64 avatar May 06 '24 08:05 PowerUser64