Skip to content

Conversation

@nc1337
Copy link
Contributor

@nc1337 nc1337 commented Apr 8, 2021

This PR is the implementation for a new option in buffers listing which allows viewing of buffers which are in the current working directory which resolves #733

@tami5 Could you kindly give me some feedback :)

@nc1337
Copy link
Contributor Author

nc1337 commented Apr 9, 2021

Apr-09-2021-11-25-27

@tami5 This is how it works.

@kkharji
Copy link
Member

kkharji commented Apr 9, 2021

Works very well, LGTM. I expected to be much more complex than that 😆 well done.

@kkharji kkharji merged commit 2ebbf7f into nvim-telescope:master Apr 9, 2021
@thornomad
Copy link
Contributor

@nc1337 — thanks so much for implementing this quickly. Amazing!

I am having an issue though with this working when I start outside my own $HOME directory. This seems strange to me and maybe it's my own configuration so forgive me. I wonder if you are seeing this same behavior? (I am not very proficient at nvim and haven't tried disabling all my own settings or plugins yet (sigh) or maybe there is something I have setup wrong) ... but here are my reproducible steps:

  1. Open new file in $HOME directory nvim test1.txt
  2. Confirm :pw is /User/damon (correct)
  3. Run :lua require('telescope.builtin').buffers({only_cwd = true}) (works!)

But if I move into a sub directory it stops working (?!)

  1. cd ~/test-one
  2. Open new file nvim test.txt
  3. Confirm :pw is /Users/damon/test-one (correct)
  4. Run :lua require('telescope.builtin').buffers({only_cwd = true}) (nothing happens!)

Here is a video

out2

@nc1337
Copy link
Contributor Author

nc1337 commented Apr 9, 2021

Hey @thornomad,
I have checked the same scenario and it works for me. Could you check your config?

@thornomad
Copy link
Contributor

Hey @thornomad,
I have checked the same scenario and it works for me. Could you check your config?

Thank you for checking. If it works for you must be something wrong with my setup. Hmm. I am not sure where to start looking ... if I have time I will have to start with a clean config and work my way back up to see what is causing that issue for me. Thanks again for your help!

@thornomad
Copy link
Contributor

@nc1337 — I tried loading a new empty configuration by setting $XDG_CONFIG_HOME to a new folder with a simple nvim/init.vim file that just loads Telescope and nothing else. But I am seeing the same behavior I outlined above. Curses!

disrupted added a commit to disrupted/dotfiles that referenced this pull request Apr 12, 2021
williamboman added a commit to williamboman/telescope.nvim that referenced this pull request Apr 14, 2021
* upstream/master:
  picker(live_grep): add option to grep only over open files (nvim-telescope#666)
  git(action): create and checkout branch (nvim-telescope#755)
  readme: fix broken links and spelling errors (nvim-telescope#753)
  added a new DynamicFinder (which can be used with rust_analyzer) (nvim-telescope#705)
  feat: add icons to git_status finder (nvim-telescope#401)
  fix: update to newer code (nvim-telescope#744)
  pickers(buffers): added only_cwd opt (nvim-telescope#739)
  feat: asyncify pickers - except for live_grep (nvim-telescope#709)
  fix: Use standardized names for current buffer fuzzy find (nvim-telescope#737)
  fix(git_branches): use the quoted fields instead of json-formatting and fix regressions with nvim-telescope#695 (nvim-telescope#704)
  feat: buf highlights for current buffer fuzzy find (nvim-telescope#732)
@thornomad
Copy link
Contributor

I was able to resolve the intermittent issue I had been having with a small fix; submitted PR #849 to close the loop on this. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New builtin to list buffers in current working directory only

4 participants