diff --git a/lua/neorg/modules/core/esupports/hop/module.lua b/lua/neorg/modules/core/esupports/hop/module.lua index aa3748321..64d04f1ed 100644 --- a/lua/neorg/modules/core/esupports/hop/module.lua +++ b/lua/neorg/modules/core/esupports/hop/module.lua @@ -34,6 +34,7 @@ module.load = function() dirman_utils = module.required["core.dirman.utils"] vim.keymap.set("", "(neorg.esupports.hop.hop-link)", module.public.hop_link) vim.keymap.set("", "(neorg.esupports.hop.hop-link.vsplit)", lib.wrap(module.public.hop_link, "vsplit")) + vim.keymap.set("", "(neorg.esupports.hop.hop-link.tab-drop)", lib.wrap(module.public.hop_link, "tab-drop")) end module.config.public = { @@ -208,9 +209,16 @@ module.public = { end, buffer = function() - open_split() + if open_mode ~= "tab-drop" then + open_split() + end if located_link_information.buffer ~= vim.api.nvim_get_current_buf() then + if open_mode ~= "tab-drop" then + vim.cmd("tab drop " .. vim.api.nvim_buf_get_name(located_link_information.buffer)) + return + end + vim.api.nvim_buf_set_option(located_link_information.buffer, "buflisted", true) vim.api.nvim_set_current_buf(located_link_information.buffer) end