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 an item in search command line removes magic flag prefixes (\v, \V) #855

Open
2 tasks done
WieeRd opened this issue Jan 2, 2025 · 3 comments
Open
2 tasks done
Labels
backlog Likely not getting to it anytime soon bug Something isn't working cmdline Related to the command line

Comments

@WieeRd
Copy link

WieeRd commented Jan 2, 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

image
image

When the search pattern is prefixed with \v or \V to enable literal or regex search, accepting a completion item removes v or V.

Relevant configuration

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

Default configuration is enough to reproduce this behavior by accepting a search completion with <C-y>

neovim version

NVIM v0.10.3

blink.cmp version: branch, tag, or commit

v0.9.0

@WieeRd WieeRd added the bug Something isn't working label Jan 2, 2025
@Marwwin
Copy link

Marwwin commented Jan 2, 2025

I'm also experiencing a similar issue when coding in clojure where keywords (:foo :bar) etc. are commonly used. Blink will override the leading : when accepting a completion

image

image

I am using the same simple configuration

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

Neovim version

v0.10.2

blink.cmp version

v0.9.0

@Saghen
Copy link
Owner

Saghen commented Jan 2, 2025

@Marwwin You seem to be running into a different issue, where \k in vim.regex includes : / and a few others in clojure. That should get resolved with #46. You could temporarily set your completion.keyword.regex to [-_A-z0-9].

@WieeRd Do you happen to know if nvim-cmp handles this case? It's quite tricky since it's against the existing rules so the buffer source would need a special case for it

@WieeRd
Copy link
Author

WieeRd commented Jan 3, 2025

Tried out cmdline completion in nvim-cmp for the first time, and it seems to have a same problem, unfortunately.
Including v and V in the search pattern and overwriting them on accept.

{
  "hrsh7th/nvim-cmp",
  dependencies = "hrsh7th/cmp-buffer",
  config = function()
    local cmp = require("cmp")
    cmp.setup.cmdline({ "/", "?" }, {
      mapping = cmp.mapping.preset.cmdline(),
      sources = {
        { name = "buffer" },
      },
    })
  end,
},

image

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

No branches or pull requests

3 participants