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

Command line tab completion doesn't handle nested paths #911

Closed
awilkins opened this issue May 20, 2022 · 6 comments
Closed

Command line tab completion doesn't handle nested paths #911

awilkins opened this issue May 20, 2022 · 6 comments
Labels
bug Something isn't working manager: command_line

Comments

@awilkins
Copy link

awilkins commented May 20, 2022

Reproduce :

❯ tree
.
├── database
│   └── tables
└── schema.sql
  • Open schema.sql

    • (which has a DDL schema in it for sake of argument, pretend we're selecting individual table statements and want to write them into separate files in tables/)
  • Select some lines of text

  • Open the command line :

  • Start a command that uses a path e.g. w

  • Start to type a path that exists inside the directory of the current buffer schema.sql

    • e.g. datab
    • Note that completion list highlights database/
  • Hit Tab

At this point, I was trying to reproduce this in a temp folder, and it was behaving differently to the tree where I noticed it...

At this point the command line contains

'<,'>w database/
  • Start to type the second component of your path, e.g. tabl
  • What should happen :
    • Drop list under command line offers tables/ as a completion (and schema.sql)
    • You hit Tab
    • Command line appends tables/ to the existing path
    • Command line now contains the following
      • And the completion list should show things from inside tables/
'<,'>w database/tables/
  • What actually happens, in my real workspace
    • Drop list under command line offers tables/ as a completion (alongside other items in the folder)
    • You hit Tab
    • Command line replaces database/ with tables/
'<,'>w tables/
  • What happened in the temp folder I tried reproduction of bug in
    • Drop list under command line .. continues to only offer tables/ and schema.sql as completions
    • Hitting Tab changes nothing
@theol0403
Copy link
Member

This should be fixed by #860 - can you give it a try? Otherwise, I can look into adding a more general fix to #908.

@awilkins
Copy link
Author

awilkins commented May 23, 2022

This is great - my only tiny complaint now is that it doesn't offer file names as completions after the second nest (ie, files inside database/ are offered, but not inside database/functions/), but as this stands it's a large improvement.

Edit : aha, it doesn't offer ANY completions below the second nest, I'm guessing there's no logic here to reload the suggestions as you proceed down a given path.

@theol0403
Copy link
Member

Strange, it seems to offer completions below the second nest for me. Maybe also try #908?

@awilkins
Copy link
Author

awilkins commented May 26, 2022

Merged #908 into #860 and still only goes into the second nest and doesn't offer files as completions.

Will try #908 on it's own .... that suffers from the original problem of replacing the path entirely with the suggested completion in nested folders.

@theol0403 theol0403 added bug Something isn't working manager: command_line labels Jul 4, 2023
@xiyaowong
Copy link
Collaborator

xiyaowong commented May 19, 2024

To be aware, Vim's default wildmenu isn't very efficient. There are numerous wildmenu plugins available. We can emulate such plugins to implement our cmdline. Early attempt

(If we implement cmdline-related events in nvim ourselves, we can cancel ext_cmdline. Then potential issues caused by neovim/neovim#28800 (comment) can be avoided. Interesting.)

@theol0403
Copy link
Member

Fixed by #2001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working manager: command_line
Projects
None yet
Development

No branches or pull requests

3 participants