✨ feat(nvim): added glance before open hook
This commit is contained in:
parent
e3a1b8d97c
commit
6a9ab71ee4
1 changed files with 16 additions and 0 deletions
|
@ -13,6 +13,22 @@ return {
|
||||||
border = {
|
border = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
|
hooks = {
|
||||||
|
before_open = function(results, open, jump, method)
|
||||||
|
local uri = vim.uri_from_bufnr(0)
|
||||||
|
if #results == 1 then
|
||||||
|
local target_uri = results[1].uri or results[1].targetUri
|
||||||
|
|
||||||
|
if target_uri == uri then
|
||||||
|
jump(results[1])
|
||||||
|
else
|
||||||
|
open(results)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
open(results)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "gd", "<CMD>Glance definitions<CR>", desc = "Goto Definition" },
|
{ "gd", "<CMD>Glance definitions<CR>", desc = "Goto Definition" },
|
||||||
|
|
Loading…
Add table
Reference in a new issue