cmp-cmdline icon indicating copy to clipboard operation
cmp-cmdline copied to clipboard

Support for magic mode

Open JoseConseco opened this issue 2 years ago • 2 comments

cmp.setup.cmdline('/', {
  sources = {
		{name = 'buffer'}
		-- { name = 'rg'}, 
		-- {name = 'fuzzy_buffer'}   
  }
})

magic search in vim simplifies regex but it confuses cmp.cmdline, eg when I search for import word: /\vimp the buffers will not show suggestions related to 'imp' but to 'vimp'. Issue is affecting other sources that are attached to cmdline sources /imp works ok though. I hope there is way to filter out the magic characters.

JoseConseco avatar Nov 10 '21 10:11 JoseConseco

How about this?

  cmp.setup.cmdline('/', {
    completion = { autocomplete = false },
    sources = {
      {
        name = 'buffer',
        option = {
          keyword_pattern = [=[[^\v[:blank:]].*]=],
        }
      }
    }
  })

msva avatar Dec 01 '21 02:12 msva

It seems to show the whole line for which there is a match rather than string itself.

gegoune avatar Dec 01 '21 06:12 gegoune