diff options
| author | Nitin Chaudhary <nitinmax1000@gmail.com> | 2021-04-09 15:22:26 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-09 12:52:26 +0300 |
| commit | 2ebbf7f9d4fbc29b6075dd8fce86e05675a745c2 (patch) | |
| tree | d27c389097a9445d2c6ffe28c44f37d9921be6d7 /lua | |
| parent | 64e59060b1750d0c86761693b6847c3db07afcd2 (diff) | |
pickers(buffers): added only_cwd opt (#739)
closes #733
Co-authored-by: Nitin Chaudhary <nitin.chaudhary@sap.com>
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin/internal.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lua/telescope/builtin/internal.lua b/lua/telescope/builtin/internal.lua index 7d2d716..a58c354 100644 --- a/lua/telescope/builtin/internal.lua +++ b/lua/telescope/builtin/internal.lua @@ -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 |
