Skip to content

Tab/S-Tab overridden after accepting snippet #289

@chaozwn

Description

@chaozwn

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

I didn't add snippet_forward in <Tab>, but it actually works,I just hit <Tab> in the video, can remove it from <Tab>.

blink.mp4

Relevant configuration

keymap = {
      ["<Up>"] = { "select_prev", "fallback" },
      ["<Down>"] = { "select_next", "fallback" },
      ["<C-N>"] = {
        "snippet_forward",
        "fallback",
      },
      ["<C-P>"] = {
        "snippet_backward",
        "fallback",
      },
      ["<C-J>"] = { "select_next", "fallback" },
      ["<C-K>"] = { "select_prev", "fallback" },
      ["<C-U>"] = { "scroll_documentation_up", "fallback" },
      ["<C-D>"] = { "scroll_documentation_down", "fallback" },
      ["<C-E>"] = { "hide", "fallback" },
      ["<CR>"] = { "accept", "fallback" },
      ["<Tab>"] = {
        function(cmp)
          if cmp.windows.autocomplete.win:is_open() then
            return cmp.accept()
          elseif has_words_before() then
            return cmp.show()
          end
        end,
        "fallback",
      },
      ["<S-Tab>"] = {
        function(cmp)
          if cmp.windows.autocomplete.win:is_open() then return cmp.select_prev() end
        end,
        "fallback",
      },
    },

neovim version

nvim 0.10.2

blink.cmp version: branch, tag, or commit

version: "*"

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogLikely not getting to it anytime soonbugSomething isn't workingkeymap

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions