Allow Chinese characters in tags

This commit is contained in:
Liu Kehong
2023-07-21 13:35:51 +08:00
parent 4a5e57eee9
commit f2fba2c3cc
2 changed files with 19 additions and 21 deletions

View File

@@ -2081,29 +2081,24 @@ local function FollowLink(opts)
local filename_part = ""
-- first: check if we're in a tag or a link
local kind, atcol, tag
local kind
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()
kind, _ = check_for_link_or_tag()
end
if kind == "tag" then
if atcol ~= nil then
tag = taglinks.get_tag_at(
vim.api.nvim_get_current_line(),
atcol,
M.Cfg
)
end
search_mode = "tag"
title = tag
local saved_reg = vim.fn.getreg('"0')
vim.cmd("normal yiw")
title = vim.fn.getreg('"0')
vim.fn.setreg('"0', saved_reg)
else
local saved_reg = vim.fn.getreg('"0')
if kind == "link" then