hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
566 stars 45 forks source link

Does not work with `sort /searchstring/` command #37

Open David-Else opened 2 years ago

David-Else commented 2 years ago

random document:

hello everyone
goodbye
hello nobody
:sort /he

the screen starts to highlight hello but I get no autocompletion

:sort /hello/

correctly sorts by the string hello

cmp.setup {
  sources = {
    { name = 'nvim_lsp' },
    { name = 'nvim_lsp_signature_help' },
    { name = 'path' },
    { name = 'buffer', keyword_length = 4 },
  },
}

cmp.setup.cmdline('/', {
  sources = {
    { name = 'buffer', keyword_length = 4 },
  },
})

cmp.setup.cmdline(':', {
  sources = cmp.config.sources({
    { name = 'path' },
  }, {
    { name = 'cmdline' },
  }),
})