Skip to content

Globbing support in :open - #9723

Open
mo8it wants to merge 18 commits into
helix-editor:masterfrom
mo8it:open-glob
Open

Globbing support in :open#9723
mo8it wants to merge 18 commits into
helix-editor:masterfrom
mo8it:open-glob

Conversation

@mo8it

@mo8it mo8it commented Feb 25, 2024

Copy link
Copy Markdown
Contributor

Closes #5706

The functionality is almost done, but I would like to have feedback on how to improve the error handling.

Please tell me if you prefer moving the two inner functions to somewhere else.

Things to discuss:

  • Should I ignore directories when globbing? Currently, running something like :open * opens all files in the current directory and multiple file pickers for all directories in the current directory. Update: I ignore directories when globbing now.
  • We probably should set an upper limit of paths to open. How should this limit be set? Should it be configurable or just a constant? Currently, it is a constant set to 32.
  • Should I add tests for the globing functionality? If yes, where?

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Feb 25, 2024
@daedroza

Copy link
Copy Markdown
Contributor

Great functionality, testing here and works good!

@mo8it

mo8it commented Feb 29, 2024

Copy link
Copy Markdown
Contributor Author

I added an upper limit of files to open with a glob and implemented ignoring directories when globbing. The PR is ready to be merged after a review 😃

@archseer archseer added this to the next milestone Mar 4, 2024
@postsolar

Copy link
Copy Markdown
Contributor

Currently this breaks opening non-existent file, e.g. :o file_which_doesnt_exist.txt.

@mo8it

mo8it commented Mar 11, 2024

Copy link
Copy Markdown
Contributor Author

@postsolar You are right. I will fix it in the next days.

@mo8it

mo8it commented Mar 23, 2024

Copy link
Copy Markdown
Contributor Author

Fixed opening non-existent files and merge conflicts.

Comment thread helix-term/src/commands/typed.rs Outdated
Comment thread helix-term/src/commands/typed.rs Outdated
Comment thread helix-term/src/commands/typed.rs Outdated
Comment thread helix-term/src/commands/typed.rs Outdated
@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from a maintainer. labels Apr 9, 2024
@mo8it
mo8it requested a review from pascalkuthe May 10, 2024 00:21
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 10, 2024
@mo8it

mo8it commented May 10, 2024

Copy link
Copy Markdown
Contributor Author

I was too focused on skipping non-relevant parents 😅 I just use the parallel ignore walker now. Ready for a review :)

@gyreas

gyreas commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

Your work is a prerequisite for a similar one that I have in mind which requires file globbing. Can I trouble you to factor out the code that retrieves matching paths, so I don't have to do it later on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-command Area: Commands S-waiting-on-review Status: Awaiting review from a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

:open should support globbing / wildcards

7 participants