Skip to content

Commit 2ebbf7f

Browse files
nc1337nitin6793
andauthored
pickers(buffers): added only_cwd opt (#739)
closes #733 Co-authored-by: Nitin Chaudhary <nitin.chaudhary@sap.com>
1 parent 64e5906 commit 2ebbf7f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lua/telescope/builtin/internal.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,9 @@ internal.buffers = function(opts)
544544
if opts.ignore_current_buffer and b == vim.api.nvim_get_current_buf() then
545545
return false
546546
end
547+
if opts.only_cwd and not string.find(vim.api.nvim_buf_get_name(b), vim.loop.cwd()) then
548+
return false
549+
end
547550
return true
548551
end, vim.api.nvim_list_bufs())
549552
if not next(bufnrs) then return end

0 commit comments

Comments
 (0)