hrsh7th / cmp-cmdline

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

Variable type? #95

Closed windowsrefund closed 1 year ago

windowsrefund commented 1 year ago

This doesn't look correct?

Screenshot_2023-05-21_01-56-01

fmoda3 commented 1 year ago

I have the same problem. After trying various commits, looks like this one broke it: https://github.com/hrsh7th/cmp-cmdline/commit/d8738f0104a8e2fd71e7e0ecef229423107fa11a

image
JKubovy commented 1 year ago

I've got same problem.

fmoda3 commented 1 year ago

@uga-rosa @hrsh7th Any chance we can revert https://github.com/hrsh7th/cmp-cmdline/commit/d8738f0104a8e2fd71e7e0ecef229423107fa11a to fix this issue?

uga-rosa commented 1 year ago

What makes it VARIABLE is that it is defined as such. https://github.com/hrsh7th/cmp-cmdline/blob/5af1bb7d722ef8a96658f01d6eb219c4cf746b32/lua/cmp_cmdline/init.lua#L72 What does this revert mean? The number that comes right after the : represents a range, and it would be correct to line up a command that can take a range (:h :range).

fmoda3 commented 1 year ago

I goto line all the time with :150 as an example, which used to work fine, but now creates a very incorrect completion list like you can see above. Perhaps reverting isnt the right solution, but that commit did break something (as seen in the images above). Note the first image too, where it happens with non-number prefixes. I've pinned my plugin to the commit prior to this, but would prefer not to do that, if there is an appropriate fix.

uga-rosa commented 1 year ago

It is true that there are some commands out there that do not allow range, but it is correct in itself that the command is completed with :{number}. For example, :1w is a formal command. And isn't this issue a report that the kind is variable? I explained in my earlier reply that that is the spec.

fmoda3 commented 1 year ago

Perhaps there is a separate underlying issue. I don't know the codebase, and i dont know what the right fix would be. All i know is that its basically unusable in its current form, and i had only found the commit where the issue started occurring.

uga-rosa commented 1 year ago

I have no idea what you think the problem is, or how reverting back to before that commit will fix it. I can't reply any further if you don't explain it to me in detail from scratch. You and I do not share the same premise.

fmoda3 commented 1 year ago

Here's how it worked before https://github.com/hrsh7th/cmp-cmdline/commit/d8738f0104a8e2fd71e7e0ecef229423107fa11a:

typing just :150 shows no completions yet:

image

then when you type another character, it starts to complete:

image

but now typing just :150 shows a huge list:

image

while I understand that the large list in the second technically is correct in that its showing every possible completion, I would argue that the previous behavior was more useful. Similarly, if i just type : it doesn't show me everything i can complete with yet, it waits until i have one character to start completing. The way numbers complete now, feels equivalent to just showing me every possible command right off the bat. At least I think having the option to complete using the old behavior should be made available.

fmoda3 commented 1 year ago

ah, i think my issue is different that the one from the original poster (when i originally thought it was the same). I can move it to its own issue, though i don't think i can move the discussion.

uga-rosa commented 1 year ago

Let's make another issue.

windowsrefund commented 1 year ago

I can no longer reproduce this and assume a recent update must be responsible for the fix.

windowsrefund commented 1 year ago

The original issue is back now that I've updated to commit 8ee981b4a91f536f52add291594e89fb6645e451

hrsh7th commented 1 year ago

Please create new issue.

The Variable type issue is not a valid issue.