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.22k stars 87 forks source link

Don't save <Plug>VinegarUp as a prior netrw_up - map #129

Closed merrilymeredith closed 2 years ago

merrilymeredith commented 2 years ago

Occasionally I've run into this error when tapping -:

Error detected while processing function <SNR>42_opendir[7]..<SNR>42_opendir[7].. [etc.]
line    7:
E169: Command too recursive
Press ENTER or type command to continue

Today I tracked it down to only netrw buffers, and figured out that If a session saved with ssop options or localoptions has a netrw buffer shown, when that session is loaded you run into the above in that buffer. When s:setup_vinegar autoruns, it saves its own VinegarUp mapping into s:netrw_up, so there's an infinite recursion when opendir is called.

I'm not sure if this is the best fix, just a quick fix.

tpope commented 2 years ago

This might mean loaded sessions will suffer from the same edge case this was added to solve, but it's better than being broken.