Skip to content
Snippets Groups Projects
Unverified Commit df297e3c authored by zeertzjq's avatar zeertzjq Committed by GitHub
Browse files

fix(runtime): don't set gx mapping if already mapped (#24262)

This matches netrw's use of maparg().
parent 317038e7
Branches
Tags
No related merge requests found
......@@ -36,9 +36,13 @@ local function do_open(uri)
vim.notify(err, vim.log.levels.ERROR)
end
end
if vim.fn.maparg('gx', 'n') == '' then
vim.keymap.set({ 'n' }, 'gx', function()
do_open(vim.fn.expand('<cfile>'))
end, { desc = gx_desc })
end
if vim.fn.maparg('gx', 'x') == '' then
vim.keymap.set({ 'x' }, 'gx', function()
do_open(get_visual_selection())
end, { desc = gx_desc })
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment