mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 14:25:32 +00:00
feat(ui): gx: use url extmark attribute and tree-sitter directive (#30192)
Use the "url" extmark attribute as well as the "url" tree-sitter metadata key to determine if the cursor is over something Nvim considers a URL.
This commit is contained in:
@@ -113,9 +113,11 @@ do
|
||||
local gx_desc =
|
||||
'Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)'
|
||||
vim.keymap.set({ 'n' }, 'gx', function()
|
||||
local err = do_open(require('vim.ui')._get_url())
|
||||
if err then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
for _, url in ipairs(require('vim.ui')._get_urls()) do
|
||||
local err = do_open(url)
|
||||
if err then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end, { desc = gx_desc })
|
||||
vim.keymap.set({ 'x' }, 'gx', function()
|
||||
|
||||
Reference in New Issue
Block a user