Skip to content

Commit

Permalink
fix(hop): describe which links are currently unsupported instead of "…
Browse files Browse the repository at this point in the history
…not found"
  • Loading branch information
vhyrro committed Jun 25, 2024
1 parent 7fc91bb commit 9626def
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lua/neorg/modules/core/esupports/hop/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ module.public = {
end

lib.match(located_link_information.type)({
-- Filter the currently unsupported link types and let the user know that they do not work
wiki = function()
vim.notify(
"Neorg doesn't support wiki links yet, please use a more specific link type instead.",
vim.log.levels.WARN
)
end,

-- If we're dealing with a URI, simply open the URI in the user's preferred method
external_app = function()
os_open_link(located_link_information.uri)
Expand Down Expand Up @@ -414,6 +422,7 @@ module.public = {
(link_target_heading5)
(link_target_heading6)
(link_target_line_number)
(link_target_wiki)
]? @link_type
text: (paragraph)? @link_location_text
)
Expand Down Expand Up @@ -442,6 +451,7 @@ module.public = {
(link_target_heading4)
(link_target_heading5)
(link_target_heading6)
(link_target_wiki)
]? @link_type
text: (paragraph)? @link_location_text
)
Expand Down Expand Up @@ -517,6 +527,11 @@ module.public = {
end

return lib.match(parsed_link_information.link_type)({
-- Wiki links are currently unsupported, so we simply forward the link type
wiki = function()
return { type = "wiki" }
end,

url = function()
return { type = "external_app", uri = parsed_link_information.link_location_text }
end,
Expand Down

0 comments on commit 9626def

Please sign in to comment.