Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set switchbuf if it is empty (the default)
Try to avoid people running into this issue: #289 If people end up complaining about this will have to document how to avoid this (ie. by setting up a non-default setting in `~/.vim/vimrc`, or setting back to the empty default in an "after" file).
- Loading branch information
3f0d21a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like to be the one to "complain" but here goes. ;-)
I just ran into the problem you're alluding to in the commit message while using https://github.com/derekwyatt/vim-fswitch. I noticed that plugin's behavior was different on two of my machines and eventually traced it back to
switchbuf
being set by command-t on one of them.I'm not sure I would have found it if it had been documented but perhaps this mechanism here would work for command-t as well?
https://github.com/AndrewRadev/linediff.vim/blob/master/autoload/linediff/controller.vim#L83
It has the advantage of leaving the user's
switchbuf
setting intact while still temporarily changing the behavior.3f0d21a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murbli: does the discussion on #309 resolve this satisfactorily for you?
3f0d21a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wincent Thanks for following up and the pointer. Setting
switchbuf=useopen
isn't an option for me because I specifically don't want that behavior. My goal in this specific case is for:FSHere
to not reuse any open windows at all, soswitchbuf=
is the only valid option for me.I ended up working around it by clearing
switchbuf
before calling:FSHere
. According to my notes resetting it after command-t is loaded didn't work for me if thevim-command-t
Debian package was installed but I can't recall whether I tried the after-directory at the time.I guess I still think that only temporarily changing the setting is the cleanest option for a plug-in but my workaround works for me. :-)