Merge pull request #112 from renerocksai/109-bug-headerlinks

fix: follow_links with headerlinks, closes 109
This commit is contained in:
lambtho
2022-04-17 20:13:43 +00:00
committed by GitHub

View File

@@ -10,6 +10,7 @@ M.is_tag_or_link_at = function(line, col, opts)
local seen_bracket = false local seen_bracket = false
local seen_parenthesis = false local seen_parenthesis = false
local seen_hashtag = false
local cannot_be_tag = false local cannot_be_tag = false
while col >= 1 do while col >= 1 do
@@ -41,7 +42,11 @@ M.is_tag_or_link_at = function(line, col, opts)
end end
end end
else 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 if not cannot_be_tag then
return "tag", col return "tag", col
end end