Skip to content

Entering `:Gdiff` and then closing the new window leaves the original window folded. #317

Closed
Peeja opened this Issue Mar 11, 2013 · 8 comments

4 participants

@Peeja
Peeja commented Mar 11, 2013

#36 has changed topics from the original post, so I'm opening this for the new issue.

@hkjels pointed out that, at least for him, the original window is not left in diff-mode as it might appear, but simply has foldlevel=0.

@tpope mentioned that he saw this issue when he tried a Janus setup.

Is this simply a matter of having foldmethod=syntax turned on for the filetype you're working in? I feel like I started to see the issue myself when I turned on foldmethod=syntax for Ruby files.

@tpope
Owner
tpope commented Mar 11, 2013

To be clear, what I was experiencing on Janus was more severe: 'diff' and all associated settings were still in effect. But I have been annoyed by folding as well.

@hkjels, what was the setting of 'foldlevel' before starting :Gdiff? If it was already zero, I'm afraid that's a tough nut to crack. I don't think there's a way to restore the exact positions of all open folds. It's burned me too, mainly when editing my own Vim plugins where I use {{{ and }}} all over the place.

@Peeja
Peeja commented Mar 11, 2013

I'm seeing the 'foldlevel' problem as well: I start with a Ruby file with foldlevel=99, I :Gdiff, then <C-W><C-O>, and I'm at foldlevel=0.

@tpope
Owner
tpope commented Mar 11, 2013
@Peeja
Peeja commented Mar 11, 2013

Ah, no, I wasn't. I am now, and that's fixed it for me. Many thanks!

@Peeja
Peeja commented Mar 11, 2013

@hkjels, how about you?

@hkjels
hkjels commented Mar 12, 2013

That solved it for sure. Thank you!

@davidgaleano

With latest I still have fold issues, in my case I have nofoldenable by default which gets changed to foldenable by :Gdiff and never restored.

@tpope
Owner
tpope commented Jun 21, 2014

There's another tweak that I'm pretty sure solves this once and for all.

@tpope tpope closed this Jun 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.