SuperBo / fugit2.nvim

Neovim git GUI powered by libgit2
MIT License
352 stars 7 forks source link

bug: foldlevel=0 makes patch view borderline unusable #8

Closed ceuk closed 4 months ago

ceuk commented 4 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.9.5

Operating system/version

Arch Linux

Describe the bug

This might be more of a feature request, but when foldlevel is set to 0 the hunks in the patch view are collapsed by default, which I gues makes complete sense but it isn't very desirable.

More problematic is that staging/unstaging these hunks often causes them to be collapsed again.

Steps To Reproduce

  1. :set foldlevel=0
  2. Open :Fugit2 (make sure the working directory has some changes)
  3. Open patch view (=)
  4. Observe that all hunks are folded
  5. Enter patch view (l)
  6. Stage a hunk (s)
  7. Observe that the hunk is folded again

Expected Behavior

I'd suggest either something like a :setlocal on the patch buffer to override the foldlevel to something like 99 - or an option to set buffer options as part of the plugin config so users can elect to do this themselves. User autocmds would work too but that seems less ergonomic

SuperBo commented 4 months ago

Thank @ceuk , will make quick fix for this. I think setlocal is a good solution. Thank you!

SuperBo commented 4 months ago

Hi @ceuk, please update your plugin and help me verify again. Default foldlevel for patchview now is set to 99.

ceuk commented 4 months ago

Seems to work great now :+1: