fix(action): ensure delete_mark handles uppercase marks

* fix(action): delete_mark can not delete an uppercase named mark which
not in the current buffer

* Update init.lua

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>

* format and lint

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
Co-authored-by: James Trew <j.trew10@gmail.com>
This commit is contained in:
Liu
2023-12-03 06:01:46 +08:00
committed by GitHub
parent 84c5a71d82
commit 5f18f3dc51

View File

@@ -1463,7 +1463,13 @@ actions.delete_mark = function(prompt_bufnr)
local bufname = selection.filename
local bufnr = vim.fn.bufnr(bufname)
local mark = selection.ordinal:sub(1, 1)
local success = pcall(vim.api.nvim_buf_del_mark, bufnr, mark)
local success
if mark:match "%u" then
success = pcall(vim.api.nvim_del_mark, mark)
else
success = pcall(vim.api.nvim_buf_del_mark, bufnr, mark)
end
return success
end)
end