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 completion in := lua cmdline removes prior input #1240

Closed
2 tasks done
disrupted opened this issue Feb 16, 2025 · 2 comments · Fixed by #1282
Closed
2 tasks done

Accepting completion in := lua cmdline removes prior input #1240

disrupted opened this issue Feb 16, 2025 · 2 comments · Fixed by #1282
Labels
bug Something isn't working cmdline Related to the command line

Comments

@disrupted
Copy link
Contributor

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 using := cmdline (short form for :lua ={expr}) I noticed that when I accept a completion candidate it gets inserted but prior input is deleted.

repro

| is cursor position

  1. :=vim.tbl_|
  2. accept tbl_deep_extend completion
  3. :=tbl_deep_extend|

counter check long form

the same works for the long form

  1. :lua =vim.tbl_|
  2. accept tbl_deep_extend completion
  3. :lua =vim.tbl_deep_extend|

Relevant configuration

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

neovim version

v0.11.0-dev-1756+gc091bc3b9a

blink.cmp version

v0.12.3

@disrupted disrupted added the bug Something isn't working label Feb 16, 2025
@disrupted disrupted changed the title Accepting completion in := cmdline removes prior input Accepting completion in := lua cmdline removes prior input Feb 16, 2025
@MrConnorKenway
Copy link

Similar cmdline completion issues have been occurred multiple times in previous releases (#883 (comment), #887 (comment)), is there any chance for blink to have unit tests to test them automatically?

@memchr
Copy link
Contributor

memchr commented Feb 20, 2025

possible workaround: append a space after := , and the previous input will be kept.

memchr pushed a commit to memchr/blink.cmp that referenced this issue Feb 20, 2025
Fixes a special case where `:=prefix.` is used without a space after the
`=`, which causes the prefix to be discarded when the completion is
accepted.

Closes Saghen#1240
memchr pushed a commit to memchr/blink.cmp that referenced this issue Feb 20, 2025
Fixes a special case where `:=prefix.` is used without a space after the
`=`, which causes the prefix to be discarded when the completion is
accepted.

Closes Saghen#1240
memchr added a commit to memchr/blink.cmp that referenced this issue Feb 20, 2025
Fixes a special case where `:=prefix.` is used without a space after the
`=`, which causes the prefix to be discarded when the completion is
accepted.

Closes Saghen#1240
memchr added a commit to memchr/blink.cmp that referenced this issue Feb 21, 2025
Fixes a special case where `:=prefix.` is used without a space after the
`=`, which causes the prefix to be discarded when the completion is
accepted.

Closes Saghen#1240
@Saghen Saghen added the cmdline Related to the command line label Feb 25, 2025
@Saghen Saghen closed this as completed in 30d9081 Feb 25, 2025
@Saghen Saghen marked this as a duplicate of #1320 Feb 26, 2025
@Saghen Saghen marked this as a duplicate of #1319 Feb 26, 2025
@Saghen Saghen marked this as not a duplicate of #1320 Feb 26, 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

Successfully merging a pull request may close this issue.

4 participants