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: incorrect completion if there's text after the cursor #1288

Closed
2 tasks done
memchr opened this issue Feb 21, 2025 · 0 comments
Closed
2 tasks done

cmdline: incorrect completion if there's text after the cursor #1288

memchr opened this issue Feb 21, 2025 · 0 comments
Labels
bug Something isn't working cmdline Related to the command line

Comments

@memchr
Copy link
Contributor

memchr commented Feb 21, 2025

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

When there's text after the cursor, the completion result of next arg is used instead of current arg. This is probably an error in the calculation of arg_number, which causes a wrong query string to be used to call vim.fn.getcompletion().

For example, :lua bit.| vim.api. returns the completion result for the table vim.api instead of bit.

Demo using repro.lua

relevant locals in the demo:

{
  arg_number = 3,
  ['context.line'] = "lua bit. vim.api.",
  current_arg = "vim.api.",
  current_arg_prefix = "vim.api.",
  text_before_argument = "lua bit. "
  query = "lua bit. vim.api."
}

neovim version

v0.10.4

blink.cmp version

main

@memchr memchr added the bug Something isn't working label Feb 21, 2025
@Saghen Saghen closed this as completed in 79aa4e5 Feb 21, 2025
@Saghen Saghen added the cmdline Related to the command line label Feb 21, 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