helix icon indicating copy to clipboard operation
helix copied to clipboard

Globbing support in `:open`

Open mo8it opened this issue 1 year ago • 6 comments

Closes https://github.com/helix-editor/helix/issues/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?

mo8it avatar Feb 25 '24 13:02 mo8it

Great functionality, testing here and works good!

daedroza avatar Feb 29 '24 06:02 daedroza

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 😃

mo8it avatar Feb 29 '24 21:02 mo8it

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

postsolar avatar Mar 11 '24 15:03 postsolar

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

mo8it avatar Mar 11 '24 17:03 mo8it

Fixed opening non-existent files and merge conflicts.

mo8it avatar Mar 23 '24 16:03 mo8it

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

mo8it avatar May 10 '24 16:05 mo8it