neovim / node-client

Nvim Node.js client and plugin host
https://neovim.io/node-client/
MIT License
464 stars 49 forks source link

findNvim - Add an option to "stop searching after a match" #370

Open xiyaowong opened 2 weeks ago

xiyaowong commented 2 weeks ago

I think this title needs no further explanation. :)

justinmk commented 2 weeks ago

It probably should do this by default, rather than making it optional.

The main (intended) reason that findNvim returns multiple results is for the case where none of the results are valid, and then the caller can mention these results in a user-facing error message, like:

Nvim X.Y not found. Found:

- /usr/local/bin/nvim 0.3 (too old)
- /foo/bar/nvim (failed to run)
- ...

Edit: OTOH, maybe it's useful to be able to select the most-recent Nvim, when there are multiple valid matches.