uga-rosa / cmp-dictionary

A dictionary completion source for nvim-cmp
MIT License
237 stars 17 forks source link

Unable to set keyword_length > 2 #15

Closed pfries closed 2 years ago

pfries commented 2 years ago

Hi @uga-rosa, thanks for the great work on this plugin. I have it working fine when I have keyword_length <= 2 but anything above that disables Dictionary source completion.

    sources = {
        { name = "dictionary", keyword_length = 5 }
    }
uga-rosa commented 2 years ago

What happens if you set exact (in setup function) to more than keyword_length?

pfries commented 2 years ago

Still not seeing the completion source with keyword_length = 4 and exact = 5 or exact = 4.

uga-rosa commented 2 years ago

Hmm. It doesn't reproduce. Please provide detailed settings and steps to reproduce. Animation

pfries commented 2 years ago

Still seeing it with a minimal cmp config, all plugins except cmp and cmp-dictionary removed, and no custom configuration.

nvim --version
NVIM v0.7.0-dev+2261-g9804a2870
require("cmp").setup({
    sources = {
        {
            name = "dictionary",
            keyword_length = 4
        },
    },
})

require("cmp_dictionary").setup({
    dic = {
        ["*"] = { "/usr/share/dict/words" },
    },
})

asciicast

uga-rosa commented 2 years ago

Can you try to reproduce it in the release version?

pfries commented 2 years ago

Same behavior with v0.6.1

uga-rosa commented 2 years ago

Even v0.6.1 didn't reproduce it for me... I wonder what could be the cause?

pfries commented 2 years ago

Not sure but it sounds like it's something on my end I'll need to troubleshoot. Thanks for looking into it.

uga-rosa commented 2 years ago

Did you solve the problem? I'd like to close this issue, since there are no similar reports and the problem probably depends on your environment.

pfries commented 2 years ago

FYI this was fixed by 9ae00514826bd26b84d86d67ed999cb4155c33e4

Thanks!