Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ajaymamtora opened this issue Jul 28, 2024 · 0 comments
Labels

Comments

@Ajaymamtora
Copy link

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 Ajaymamtora changed the title [Bug] Sniprun + matchup treesitter cause snippets to automatically be expanded in nvim-cmp [Bug] Sniprun + matchup cause snippets to automatically be expanded in nvim-cmp Jul 28, 2024
loqusion added a commit to loqusion/dotfiles that referenced this issue Aug 2, 2024
This fixes a really annoying issue where pressing `<C-p>` or `<C-n>`
when a cmp window is open closes the window, losing your place in the
suggestions.

This seems to be related to
andymass/vim-matchup#354.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant