-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
vim.ui.open: "gx" without netrw #23401
Conversation
5edb19f
to
938e299
Compare
the |
No, please leave it as is (for now). It's better to set the corresponding global variables to skip setting up the mapping. We'll completely remove netrw once we have a full replacement.
Yes, that would be the place. But maybe make it opt-in for now? |
God, the commit history in this PR is a complete mess lmao |
I am confused about the execution order, where would you set a global variable in time? I cannot find a place where this is done
Im not entirely sure what you mean. Most applications will not understand what |
it's a markdown link return by some lsp server. it has a |
In your |
vim.ui.open_uri
& "gx" in lua without netrwvim.ui.os_open
& "gx" in lua without netrw
Problem: Showing an error via vim.notify() makes it awkward for callers such as lsp/handlers.lua to avoid showing redundant errors. Solution: Return the message instead of showing it. Let the caller decide whether and when to show the message.
I do hate But |
without "https://" that would be treated as a filepath on any system, afaik. If you find that netrw's neovim/runtime/autoload/netrw.vim Lines 5431 to 5433 in 3ecd45d
|
I should be able to not load netrw plugin completely after this, shouldn't I? vim.g.loaded_netrwPlugin = 1
vim.g.loaded_netrw = 1
Thanks. |
Cannot reproduce |
May need to revert #24262 , or move this mapping to neovim/runtime/lua/vim/_editor.lua Line 1008 in 06c4edf
|
@justinmk On Windows this call fails:
I think that the reason is that Explorer doesn't accept the URL: The message says the its an invalid URL but its a valid one for devdocs. Is there any alternative to avoid this dependency? |
See above, #23401 (comment) . Patch welcome, having someone with a Windows machine would be helpful. |
maybe it's worth switching the opener strategy on windows |
is that different than what i said in #23401 (comment) ? |
It's the same issue. I had confirmed that with this fix |
Problem: On Windows, `explorer.exe` fails to open some URLs, for example: :lua vim.ui.open('https://devdocs.io/#q=lua%20lua_call') neovim#23401 (comment) Solution: Use rundll32 instead.
Fix #23231
vim.ui.os_open
is partially based off https://github.com/folke/lazy.nvim/blob/main/lua/lazy/util.lua#L13-L44, as recommended by @folke on the original issue.vim.ui.os_open(uri: string | vim.uri.Uri)
string
asuri
Accept avim.uri.Uri
asuri
g:netrw_gx
.vim.func.on_func(vim.ui, 'open_uri', …)