diff --git a/lua/telescope/builtin/__internal.lua b/lua/telescope/builtin/__internal.lua index d7e342c..38c9cf9 100644 --- a/lua/telescope/builtin/__internal.lua +++ b/lua/telescope/builtin/__internal.lua @@ -1074,7 +1074,17 @@ internal.marks = function(opts) local marks_table = {} local marks_others = {} local bufname = vim.api.nvim_buf_get_name(opts.bufnr) - for _, cnf in ipairs { local_marks, global_marks } do + local all_marks = {} + opts.mark_type = vim.F.if_nil(opts.mark_type, "all") + if opts.mark_type == "all" then + all_marks = { local_marks, global_marks } + elseif opts.mark_type == "local" then + all_marks = { local_marks } + elseif opts.mark_type == "global" then + all_marks = { global_marks } + end + + for _, cnf in ipairs(all_marks) do for _, v in ipairs(cnf.items) do -- strip the first single quote character local mark = string.sub(v.mark, 2, 3) diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua index 4e8d217..df9f92f 100644 --- a/lua/telescope/builtin/init.lua +++ b/lua/telescope/builtin/init.lua @@ -359,6 +359,7 @@ builtin.colorscheme = require_on_exported_call("telescope.builtin.__internal").c --- Lists vim marks and their value, jumps to the mark on `` ---@param opts table: options to pass to the picker ---@field file_encoding string: file encoding for the previewer +---@field mark_type "all"|"global"|"local": filter marks by type (default: "all") builtin.marks = require_on_exported_call("telescope.builtin.__internal").marks --- Lists vim registers, pastes the contents of the register on ``