Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lua/telescope/builtin/__internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,13 @@ internal.marks = function(opts)
end
marks_table = vim.fn.extend(marks_table, marks_others)

if opts.cwd_only or opts.cwd then
local cwd = opts.cwd_only and vim.loop.cwd() or opts.cwd
marks_table = vim.tbl_filter(function(row)
return buf_in_cwd(row.filename, cwd)
end, marks_table)
end

pickers
.new(opts, {
prompt_title = "Marks",
Expand Down
2 changes: 2 additions & 0 deletions lua/telescope/builtin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ builtin.colorscheme = require_on_exported_call("telescope.builtin.__internal").c
---@param opts table: options to pass to the picker
---@field file_encoding string: file encoding for the previewer
---@field mark_type string: filter marks by type (default: "all", options: "all"|"global"|"local")
---@field cwd string: specify a working directory to filter marks list by
---@field cwd_only boolean: if true, only show marks in the current working directory (default: false)
builtin.marks = require_on_exported_call("telescope.builtin.__internal").marks

--- Lists vim registers, pastes the contents of the register on `<cr>`
Expand Down