hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
505 stars 41 forks source link

Disable completion if the command starts with a number #45

Closed mercxry closed 2 years ago

mercxry commented 2 years ago

Hi, I would like to disable completion when the command is a number, this is a problem for me because when I want to jump to a specific line a wall of completion text appears exactly where I want to look and doesn't allow me to peek the line before jumping.

Screen Shot 2022-04-26 at 13 37 04
hrsh7th commented 2 years ago

It's expected but I can understand your expectation...

For example, 1delete should be completed... Hm...

mercxry commented 2 years ago

I was thinking that if the command it's just a number it doesn't complete, but as soon as you add a letter it shows the completions, for example :42 doesn't show anything, but :42d should show the completion menu.

Do you think this is a good solution to the problem?

hrsh7th commented 2 years ago

I think now cmp-cmdline behaves the above explanation.

mercxry commented 2 years ago

It does, thank you! 🙇‍♂️

artemave commented 2 years ago

This change should also cover ranges. I use relative numbers to copy blocks of text. E.g. :-12,-10t. copies lines from 12 lines up to 10 lines to the current line. The problem is that as soon as type in , I get this:

image

hrsh7th commented 2 years ago

PR welcome.