pickers(buffers): added only_cwd opt (#739)

closes #733 
Co-authored-by: Nitin Chaudhary <nitin.chaudhary@sap.com>
This commit is contained in:
Nitin Chaudhary
2021-04-09 15:22:26 +05:30
committed by GitHub
parent 64e59060b1
commit 2ebbf7f9d4

View File

@@ -544,6 +544,9 @@ internal.buffers = function(opts)
if opts.ignore_current_buffer and b == vim.api.nvim_get_current_buf() then
return false
end
if opts.only_cwd and not string.find(vim.api.nvim_buf_get_name(b), vim.loop.cwd()) then
return false
end
return true
end, vim.api.nvim_list_bufs())
if not next(bufnrs) then return end