{"thread":{"id":"58120","subject":"Bug with splits in new nvimdiff layout","startedAt":"2022-07-07T16:59:02Z","lastAt":"2022-07-08T17:06:39Z","messageCount":3,"participants":["Matthew Klein","Junio C Hamano","Fernando Ramos"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"458578","messageId":"CACRpdvnuAYY0U1_3uD8zKgtq05+bgwjzXpZKomro6gqYDNrjGg@mail.gmail.com","threadId":"58120","inReplyTo":null,"subject":"Bug with splits in new nvimdiff layout","fromName":"Matthew Klein","fromEmail":"mklein994@gmail.com","sentAt":"2022-07-07T16:58:48Z","receivedAt":"2022-07-07T16:59:02Z","isPatch":false,"sender":{"key":"mklein994@gmail.com","avatar":null},"body":"Hi,\n\nI encountered a bug when using the new vimdiff layout format.\n\nTo recreate this, start with a merge conflict, and merge with this command:\n\n    git mergetool --tool=nvimdiff\n\nI expected the layout to be:\n\n    ------------------------------------------\n    |             |           |              |\n    |   LOCAL     |   BASE    |   REMOTE     |\n    |             |           |              |\n    ------------------------------------------\n    |                                        |\n    |                MERGED                  |\n    |                                        |\n    ------------------------------------------\n\nThe layout when I ran the command was:\n\n    ------------------------------------------\n    |                                        |\n    |                LOCAL                   |\n    |                                        |\n    ------------------------------------------\n    |             |           |              |\n    |   LOCAL     |   LOCAL   |   MERGED     |\n    |             |           |              |\n    ------------------------------------------\n\nI expected the layout to be the same as what was documented to be the default\nfor \"nvimdiff\".\n\nIn my init.vim configuration file, I have these lines set:\n\n    set splitbelow\n    set splitright\n\nThese options globally change the behaviour of the \"split\" command so that\ninstead of \"split\" creating a new window above the current window, or to the\nleft when used with \"vertical\", it does the opposite. Docs:\nhttps://neovim.io/doc/user/options.html#'splitbelow'\n\nI recommend using the \"leftabove\" (a.k.a \"aboveleft\") command together with\n\"split\". Since these windows are positioned absolutely (according to\n\"mergetool.nvimdiff.layout\"), it shouldn't depend on the user's configuration.\nDocs: https://neovim.io/doc/user/windows.html#:leftabove\n\nThe previous invocation (i.e. \"4wincmd w | wincmd J\") didn't run into this\nissue, since its not affected by the \"splitbelow\" and \"splitright\" options.\n\nHope this helps,\n\nMatthew\n\n[System Info]\ngit version:\ngit version 2.37.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.18.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 02 Jul 2022\n21:03:06 +0000 x86_64\ncompiler info: gnuc: 12.1\nlibc info: glibc: 2.35\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n"},{"id":"458594","messageId":"xmqqo7y0zrp3.fsf@gitster.g","threadId":"58120","inReplyTo":"CACRpdvnuAYY0U1_3uD8zKgtq05+bgwjzXpZKomro6gqYDNrjGg@mail.gmail.com","subject":"Re: Bug with splits in new nvimdiff layout","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-07T18:46:32Z","receivedAt":"2022-07-07T18:46:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew Klein <mklein994@gmail.com> writes:\n\n> Hi,\n>\n> I encountered a bug when using the new vimdiff layout format.\n\nThanks for a report.\n\nFernando (the author of the layout engine)?  Can you take a look?\n\n> To recreate this, start with a merge conflict, and merge with this command:\n>\n>     git mergetool --tool=nvimdiff\n>\n> I expected the layout to be:\n>\n>     ------------------------------------------\n>     |             |           |              |\n>     |   LOCAL     |   BASE    |   REMOTE     |\n>     |             |           |              |\n>     ------------------------------------------\n>     |                                        |\n>     |                MERGED                  |\n>     |                                        |\n>     ------------------------------------------\n>\n> The layout when I ran the command was:\n>\n>     ------------------------------------------\n>     |                                        |\n>     |                LOCAL                   |\n>     |                                        |\n>     ------------------------------------------\n>     |             |           |              |\n>     |   LOCAL     |   LOCAL   |   MERGED     |\n>     |             |           |              |\n>     ------------------------------------------\n>\n> I expected the layout to be the same as what was documented to be the default\n> for \"nvimdiff\".\n>\n> In my init.vim configuration file, I have these lines set:\n>\n>     set splitbelow\n>     set splitright\n>\n> These options globally change the behaviour of the \"split\" command so that\n> instead of \"split\" creating a new window above the current window, or to the\n> left when used with \"vertical\", it does the opposite. Docs:\n> https://neovim.io/doc/user/options.html#'splitbelow'\n>\n> I recommend using the \"leftabove\" (a.k.a \"aboveleft\") command together with\n> \"split\". Since these windows are positioned absolutely (according to\n> \"mergetool.nvimdiff.layout\"), it shouldn't depend on the user's configuration.\n> Docs: https://neovim.io/doc/user/windows.html#:leftabove\n>\n> The previous invocation (i.e. \"4wincmd w | wincmd J\") didn't run into this\n> issue, since its not affected by the \"splitbelow\" and \"splitright\" options.\n>\n> Hope this helps,\n>\n> Matthew\n>\n> [System Info]\n> git version:\n> git version 2.37.0\n> cpu: x86_64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> uname: Linux 5.18.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 02 Jul 2022\n> 21:03:06 +0000 x86_64\n> compiler info: gnuc: 12.1\n> libc info: glibc: 2.35\n> $SHELL (typically, interactive shell): /bin/bash\n>\n>\n> [Enabled Hooks]\n"},{"id":"458652","messageId":"YshkFWZfBMbuN/tI@zacax395.localdomain","threadId":"58120","inReplyTo":"xmqqo7y0zrp3.fsf@gitster.g","subject":"Re: Bug with splits in new nvimdiff layout","fromName":"Fernando Ramos","fromEmail":"greenfoo@u92.eu","sentAt":"2022-07-08T17:06:29Z","receivedAt":"2022-07-08T17:06:39Z","isPatch":false,"sender":{"key":"greenfoo@u92.eu","avatar":"https://avatars.githubusercontent.com/u/42691086?v=4"},"body":"On 22/07/07 11:46AM, Junio C Hamano wrote:\n> Matthew Klein <mklein994@gmail.com> writes:\n> \n> > Hi,\n> >\n> > I encountered a bug when using the new vimdiff layout format.\n> \n> Thanks for a report.\n> \n> Fernando (the author of the layout engine)?  Can you take a look?\n> \nNo problem! \n\nThe description from Matthew already includes a proposed solution (thanks!)\nwhich should work.\n\nLet me implement and test it this weekend and I'll get back to you.\n\n"}]}