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

Cmdline completion displaying wrong arg #874

Open
2 tasks done
ibhagwan opened this issue Jan 3, 2025 · 0 comments
Open
2 tasks done

Cmdline completion displaying wrong arg #874

ibhagwan opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working cmdline Related to the command line

Comments

@ibhagwan
Copy link

ibhagwan commented Jan 3, 2025

Make sure you have done the following

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

Bug Description

Post the latest commit supporting custom cmdline completion 7e7deaa blink will display the wrong arg when using backspace after completion.

Few examples:

fzf-lua

:FzfLua fi<tab><space><backspace>x3

nvim-cmp shows correct 2nd arg (picker name)
image

blink shows 3rd pos argument variables (picker options)
image

vim-fugitive

:Git reb<tab><space><backspace>x4

nvim-cmp shows correc 2nd arg (git operation)
image

blink shows 3rd pos arguments (git branch)
image

Relevant configuration

{
  "saghen/blink.cmp",
  enabled = require("utils").USE_BLINK_CMP ~= nil,
  build = "cargo +nightly build --release",
  event = { "InsertEnter", "CmdLineEnter" },
  opts = {
    keymap = {
      ["<CR>"] = { "accept", "fallback" },
      ["<Esc>"] = { "hide", "fallback" },
      -- ["<C-c>"] = { "cancel", "fallback" },
      ["<Up>"] = { "select_prev", "fallback" },
      ["<Down>"] = { "select_next", "fallback" },
      ["<C-e>"] = { "cancel", "show", "fallback" },
      ["<C-p>"] = { "select_prev", "fallback" },
      ["<C-n>"] = { "select_next", "fallback" },
      ["<C-y>"] = { "select_and_accept" },
      ["<C-k>"] = { "show", "show_documentation", "hide_documentation" },
      ["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
      ["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
      ["<S-up>"] = { "scroll_documentation_up", "fallback" },
      ["<S-down>"] = { "scroll_documentation_down", "fallback" },
      cmdline = {
        ["<CR>"] = { "accept", "fallback" },
        ["<Esc>"] = { "hide", "fallback" },
        ["<Tab>"] = { "select_next", "fallback" },
        ["<S-Tab>"] = { "select_prev", "fallback" },
        ["<C-e>"] = { "cancel", "fallback" },
        ["<C-y>"] = { "select_and_accept" },
      }
    },
    -- sources = { cmdline = {} }, -- Disable cmdline for now (buggy)
    completion = {
      -- list = { selection = "manual" },
      list = { selection = "auto_insert" },
      accept = {
        create_undo_point = true,
        auto_brackets = { enabled = true },
      },
      menu = {
        draw = {
          treesitter = { "lsp" },
        }
      },
      documentation = {
        auto_show = true,
        auto_show_delay_ms = 100,
      },
      ghost_text = { enabled = true },
    },
    signature = { enabled = true }
  },
}

neovim version

0.10.3

blink.cmp version: branch, tag, or commit

HEAD

@ibhagwan ibhagwan added the bug Something isn't working label Jan 3, 2025
@Saghen Saghen added the cmdline Related to the command line label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmdline Related to the command line
Projects
None yet
Development

No branches or pull requests

2 participants