tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
20.03k stars 1.01k forks source link

G(v)diffsplit issue(?) #2317

Closed componhead closed 4 months ago

componhead commented 4 months ago

Hi. Why the choice to ignore splitright and splitbelow vim option? From the manual:

                                                *:Gdiffsplit*
:Gdiffsplit [object]    Perform a |vimdiff| against the given file, or if a
                        commit is given, the current file in that commit.
                        With no argument, the version in the index or work
                        tree is used, AND THE WORK TREE VERSION IS ALWAYS
                        PLACED TO THE RIGHT OR BOTTOM, depending on available
                        width.  Use Vim's |do| and |dp| to stage and unstage
                        changes.

thank you

tpope commented 4 months ago

The original reason was for a consistent user experience. Regardless of whether you start :Gdiffsplit from an old buffer or a new buffer, the end result is the same.

I've since decided that matching the behavior of the vanilla :diffsplit is more important, so the modern reason is for backwards compatibility. As a compromise, the behavior was narrowed to the "no argument" case, which means it's extremely easy to bypass with :Gdiffsplit % for example if you don't want it.