fix: follow_links with headerlinks, closes 109

This commit is contained in:
Lambtho
2022-04-17 22:11:34 +02:00
parent 591e8d2956
commit 1acfb01d75

View File

@@ -10,6 +10,7 @@ M.is_tag_or_link_at = function(line, col, opts)
local seen_bracket = false
local seen_parenthesis = false
local seen_hashtag = false
local cannot_be_tag = false
while col >= 1 do
@@ -41,7 +42,11 @@ M.is_tag_or_link_at = function(line, col, opts)
end
end
else
if char == "#" and opts.tag_notation == "#tag" then
if char == "#" then
seen_hashtag = true
end
-- Tags should have a space before #, if not we are likely in a link
if char == " " and seen_hashtag and opts.tag_notation == "#tag" then
if not cannot_be_tag then
return "tag", col
end