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

fix regexes

Open max397574 opened this issue 2 years ago • 11 comments

This fixes the regexes to only match at the beginning of the file before all the completions which included any of the regexes (e.g. to) didn't work

max397574 avatar Apr 16 '22 14:04 max397574

It looks ok but I didn't understand why this is needed. Could you explain the fail case?

hrsh7th avatar Apr 16 '22 14:04 hrsh7th

for me Neorg toc didn't work When I printed cmdline just before the vim.fn.getcompletion call it was just c

max397574 avatar Apr 16 '22 14:04 max397574

Sorry. I can't reproduce with neorg... (I'd install it but I can't see :Neorg toc command)

hrsh7th avatar May 01 '22 13:05 hrsh7th

did you load the toc module?

max397574 avatar May 01 '22 13:05 max397574

Sorry. I can't reproduce with neorg... (I'd install it but I can't see :Neorg toc command)

Hi, So if you quickly open a norg file, so something like nvim test.norg - you should be able to use Neorg toc [options] in maxes branch he fixed this issue, but to replicate

setup neorg config - open neorg file like nvim test.norg :Neorg toc [tab or what ever you use to get to the next argument] and that should be able to replicate it :)

vsedov avatar May 01 '22 13:05 vsedov

Sorry. neorg looks like a powerful plugin. I didn't know how to use it easily.

hrsh7th avatar May 01 '22 13:05 hrsh7th

require("neorg").setup({
    load = {
        ["core.defaults"] = {}, -- Load all the default modules
        ["core.norg.qol.toc"] = {}
    }
})

max397574 avatar May 01 '22 13:05 max397574

Thank you! I can see :Neorg toc completion.

But I can't reproduce issue. I think the latest cmp-cmdline has not this issue.

hrsh7th avatar May 01 '22 14:05 hrsh7th

-cmdline has not this

ah for me cmp here reverts back to normal cmd mode if that makes sense ?

so with maxes branch i can do the following :

image image

While in master i get :

image image

In this case you revert back to normal cmd if that makes sense

cmp.setup.cmdline(":", {
    window = {
        completion = {
            border = { "🭽", "▔", "🭾", "▕", "🭿", "▁", "🭼", "▏" },
            scrollbar = { "║" },
        },
        documentation = {
            border = { "🭽", "▔", "🭾", "▕", "🭿", "▁", "🭼", "▏" },
            scrollbar = { "║" },
        },
    },
    sources = cmp.config.sources({

        { name = "cmdline", group_index = 1 },
        -- { name = "cmdline_history", group_index = 2 },
    }),
    enabled = function()
        return true
    end,
})```
is the config im using 

vsedov avatar May 01 '22 22:05 vsedov

normal mode -> native completion ig

max397574 avatar May 02 '22 04:05 max397574

This fixes my #38 . I don't know if it's the right fix, but it works.

WhoIsSethDaniel avatar May 27 '22 18:05 WhoIsSethDaniel

I've fixed this problem with another commit that including this approach. Thank you!

hrsh7th avatar Nov 13 '22 04:11 hrsh7th