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

feat: support vim.ui.open for GBrowse on Neovim #2322

Closed
wants to merge 1 commit into from

Conversation

stevearc
Copy link

It is not uncommon for Neovim users to have netrw disabled in favor of other file explorers. When this is the case, :GBrowse fails. Neovim 0.10 ships with a new vim.ui.open helper method that is designed to replace this exact functionality.

This PR simply preferentially uses vim.ui.open in Neovim 0.10+ over netrw. I have tested it with a simple :GBrowse in a file and it appears to work well.

@tpope tpope closed this in 0444df6 Jul 18, 2024
@tpope
Copy link
Owner

tpope commented Jul 18, 2024

Netrw brings a bit more to the table than just opening a URL: It also displays an error message if something went wrong. Despite having ui in the name, vim.ui.open doesn't concern itself with this UI affordance, or indeed, any other UI at all. We'd need a dozen lines of Lua to achieve the same behavior as Netrw, and I don't want to add a _fugitive.lua just for that.

As a compromise, I have added support with more limited error handling, but given it a priority below Netrw.

@stevearc
Copy link
Author

Works for me, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants