voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.47k stars 78 forks source link

remove empty pattern #341

Closed balazser closed 2 years ago

balazser commented 2 years ago

What?

Reduce noise by preventing ripgrep to matching everything

Why?

Since ripgrep gets an empty pattern it matches every file which is then passed to FZF. I'm not sure was it on purpose but because of this, there is a lot of noise for further fzf filtering.

How?

Remove empty args from ripgrep call.

Testing?

Manually

Screenshots (optional)

Anything Else?

balazser commented 2 years ago

I noticed if there are no results an error message is shown. It's probably because of the exit code 1. Maybe we should handle only exit status 2 according to the rg man. What do you think? :thinking:

EXIT STATUS
       If ripgrep finds a match, then the exit status of the program is 0. If no match could be found, then the exit status is 1. If an error occurred, then the exit status is always 2 unless ripgrep was
       run with the --quiet flag and a match was found. In summary:
       •   0 exit status occurs only when at least one match was found, and if no error occurred, unless --quiet was given.
       •   1 exit status occurs only when no match was found and no error occurred.
       •   2 exit status occurs when an error occurred. This is true for both catastrophic errors (e.g., a regex syntax error) and for soft errors (e.g., unable to read a file).
voldikss commented 2 years ago

Thanks