vim-matchup icon indicating copy to clipboard operation
vim-matchup copied to clipboard

[Bug] Sniprun + matchup cause snippets to automatically be expanded in nvim-cmp

Open Ajaymamtora opened this issue 6 months ago • 0 comments

Explain the issue

When enabling vim-matchup and while using luasnip, while tabbing onto a snippet item in the nvim-cmp menu: image

The snippet is immediately expanded.

  1. Using vim 0.10 stable
  2. Install nvim cmp, luasnip, and setup the plugin based on the wiki in sniprun https://github.com/L3MON4D3/LuaSnip/wiki/Nice-Configs
cmp.setup({

  -- ... Your other configuration ...

  mapping = {

    -- ... Your other mappings ...

    ["<Tab>"] = cmp.mapping(function(fallback)
      if cmp.visible() then
        cmp.select_next_item()
      elseif luasnip.expand_or_locally_jumpable() then
        luasnip.expand_or_jump()
      elseif has_words_before() then
        cmp.complete()
      else
        fallback()
      end
    end, { "i", "s" }),
  }
}

I've not changed any matchup settings, just loaded it with lazy

modules["andymass/vim-matchup"] = {
  version = false,
  lazy = false,
  dependencies = { "nvim-treesitter/nvim-treesitter" },
}
  1. Expected behavior: tab should move past the snippet (because cmp.visible() is true)
  2. Observed behavior -- snippets are expanded, lsp items arent automatically accepted

Ajaymamtora avatar Jul 28 '24 10:07 Ajaymamtora