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

Accepting item in command mode appends to trigger characters #883

Closed
2 tasks done
antonk52 opened this issue Jan 4, 2025 · 3 comments
Closed
2 tasks done

Accepting item in command mode appends to trigger characters #883

antonk52 opened this issue Jan 4, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@antonk52
Copy link

antonk52 commented Jan 4, 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

When attempting to edit a file by entering a file path in command mode, selecting an item from completion menu inserts full completion item to what triggered the completion.

Example in command mode let's say you want to edit ~/.config/nvim/init.lua, you type :e ~/.con and you see the completion menu and want to select ~/.config, you press to select the item and to insert it. Your command line now has :e ~/.~/.config/ which is an incorrect file path. Expected behaviour: the command line has :e ~/.config/

Relevant configuration

{
    'saghen/blink.cmp',
    version = 'v0.*',
    opts = {}
}

neovim version

0.10.3

blink.cmp version: branch, tag, or commit

0.9.2

@antonk52 antonk52 added the bug Something isn't working label Jan 4, 2025
@b0o
Copy link
Contributor

b0o commented Jan 4, 2025

Related: #46, #541, #555

@MrConnorKenway
Copy link

Maybe related: #887

@Aym3nJ
Copy link

Aym3nJ commented Jan 29, 2025

it seems the bug still persist if the with any command with this syntax :command [range] [arguments]
for example :set when writing :set sy^y ( so far good you get :set syntax) :set sy^y=js^y (you get :set json instead of :set syntax=json)

this could be fixed with

-- line 91 lua/blink/cmp/sources/cmdline/init.lua
        if not has_prefix and cmd == 'lua' or 'set' then new_text = current_arg_prefix .. completion end

but then again the bug will persist in other cases like :w ~/dir1^y/dir2^y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants