fix: do not show tags in template (closes 133)

This commit is contained in:
lambtho12
2022-05-18 13:52:59 +02:00
parent abe8e8b441
commit 08a785482d

View File

@@ -2132,10 +2132,14 @@ local function FollowLink(opts)
-- first: check if we're in a tag or a link
local kind, atcol, tag
local globArg = ""
if opts.follow_tag ~= nil then
kind = "tag"
tag = opts.follow_tag
if opts.templateDir ~= nil then
globArg = "--glob=!" .. "**/" .. opts.templateDir .. "/*.md"
end
else
kind, atcol = check_for_link_or_tag()
end
@@ -2498,6 +2502,7 @@ local function FollowLink(opts)
search_command = {
"rg",
"--vimgrep",
globArg,
"-e",
prompt,
"--",
@@ -2720,7 +2725,8 @@ local function FindAllTags(opts)
local i = opts.i
opts.cwd = M.Cfg.home
opts.tag_notation = M.Cfg.tag_notation
opts.templateDir = Path:new(M.Cfg.templates):make_relative(M.Cfg.home)
local templateDir = Path:new(M.Cfg.templates):make_relative(M.Cfg.home)
opts.templateDir = templateDir
if not global_dir_check() then
return
@@ -2787,6 +2793,7 @@ local function FindAllTags(opts)
local follow_opts = {
follow_tag = selection,
show_link_counts = true,
templateDir = templateDir,
}
actions._close(prompt_bufnr, false)
vim.schedule(function()