tpope / vim-vinegar

vinegar.vim: Combine with netrw to create a delicious salad dressing
https://www.vim.org/scripts/script.php?script_id=5671
2.23k stars 87 forks source link

Changed/odd behavior with "-" #100

Closed theunraveler closed 6 years ago

theunraveler commented 6 years ago

Hello. It seems that the most recent commit (https://github.com/tpope/vim-vinegar/commit/0620d01986d178ea98165597f3e3dd44e9b6ebfa) introduced a few issues:

  1. When I press - while editing a file, netrw opens to what appears to be vim's pwd, not the directory that the file is in.
  2. After doing the above, then navigating to the same file, opening it again, then pressing - again, netrw opens to the same directory as above, but all of the file/directory names in the listing are duplicated. Do it again and all of the listings appear 3x, and so on.

I used git bisect to narrow it down to the commit above, and everything seems to work fine before that. Thanks!

tpope commented 6 years ago

Is b:netrw_curdir set while editing the file?

theunraveler commented 6 years ago

If you mean am I explicitly setting it in my config, then no. If you're wondering what the value of that variable is while editing a file, I'm not sure how to find that out (vimscript illiterate).

tpope commented 6 years ago

:echo b:netrw_curdir

theunraveler commented 6 years ago

Yes, it seems to be set to vim's pwd. For example, if I do vim ~/my_project, then navigate to ~/my_project/some_directory/another_directory/some_file.txt by just clicking through in netrw, the value of :echo b:netrw_curdir is just ~/my_project. Hope that helps...

theunraveler commented 6 years ago

Thanks for the quick responses; https://github.com/tpope/vim-vinegar/commit/9477d436f908c7419176f03be494dcfda3e15a2d seems to have fixed the first issue. I'm still getting the second issue though. Any thoughts there?

theunraveler commented 6 years ago

Wonderful; both issues seem to be fixed now. Thanks for the quick attention, and sorry if you had to revert back to a hack.