Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmdline "help" gives nonsense suggestions. #818

Closed
2 tasks done
ad-on-is opened this issue Dec 29, 2024 · 3 comments
Closed
2 tasks done

cmdline "help" gives nonsense suggestions. #818

ad-on-is opened this issue Dec 29, 2024 · 3 comments
Labels
bug Something isn't working cmdline Related to the command line

Comments

@ad-on-is
Copy link

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

When using cmdline the suggesetions show env vars and other useless nonsense.

ScreenCapture-2024-12-29_15.36.20.mp4

Relevant configuration

sources = {
        cmdline = function()
          local type = vim.fn.getcmdtype()
          -- Search forward and backward
          if type == "/" or type == "?" then
            return { "buffer" }
          end
          -- Commands
          if type == ":" then
            return { "cmdline" }
          end
          return {}
        end,
      }

neovim version

v0.10.3

blink.cmp version: branch, tag, or commit

v0.8.2

@ad-on-is ad-on-is added the bug Something isn't working label Dec 29, 2024
@ad-on-is ad-on-is changed the title cmdline gives nonsense suggestions. cmdline "help" gives nonsense suggestions. Dec 29, 2024
Saghen added a commit that referenced this issue Dec 29, 2024
@Saghen Saghen added the cmdline Related to the command line label Dec 29, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 29, 2024

It'll now filter the items correctly when you use a .. The "nonsense" items are real help tags, but I agree that they shouldn't be first on the list. Any ideas on how we should be sorting? Some specific help menus that are more relevant typically?

@ad-on-is
Copy link
Author

Ohh.. nice... will update as soon as it's available. sorry for my phrasing... I meant, when using a dot, they shouldn't be shown.. So, initially showing them is fine, but not when there's already some input provided like "vim."

To not "flood" the list, could they perhaps be hidden initially, and show a "$" (or any other special character) single entry instead?

I'd imagine something like this, let's assume blink is configured to show automatically

  • open cmdline
  • if the helptag doesn't start with an alphanumeric character, show only one entry with the first special character .. like "$"
  • if user starts typing a "$", only then expand the completions to filter by the users prefix. "$H" -> "$HOME, etc.."

@Saghen Saghen closed this as completed in ae3bf0d Jan 3, 2025
@Saghen
Copy link
Owner

Saghen commented Jan 3, 2025

That's a great idea! Sorry I shouldn't have put nonsense in quotes, didn't mean for it to come off that way :D I've gone the simpler route and put anything starting with a special character at the end of the list, so you'll need to type said special character for it to show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmdline Related to the command line
Projects
None yet
Development

No branches or pull requests

2 participants