-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to swap diffthis panes #585
Comments
Yes, One of the current goals is to add support for command modifiers to the Gitsigns command so we can do something like For now we can add an option to
Where setting something like In addition, we should also respect the |
@lewis6991 Thank you! I pulled down the latest and it works 🎉 ! Took me some trial error to realize I needed to set I did try variations like these: require('gitsigns').setup {
sign_priority = 20,
diff_opts = {
splitright = true,
botright = true,
} Works great now! Thanks! |
Hmm, this shouldn't do anything. The only option pulled out of The change the makes it so |
When running an action via the :Gitsigns command, the internal plumbing can now pass the entire command context/options directly to a specialised action command (per action) that knows how to translate command parameters to the specific action parameters. Example #1: `:belowright Gitsigns diffthis` now translates to `diffthis(nil, {split='belowright'}`. Example #2: `:6,10Gitsigns stage_hunk` now translates to `stage_hunk({6,10})`. Note this change reverts the behaviour of the previous commit that respects 'splitright' Fixes #585
Ok, I worked on this a little and decided to revert the behaviour introduced in #586. Now
Additionally if using via the E.g. |
When running an action via the :Gitsigns command, the internal plumbing can now pass the entire command context/options directly to a specialised action command (per action) that knows how to translate command parameters to the specific action parameters. Example #1: `:belowright Gitsigns diffthis` now translates to `diffthis(nil, {split='belowright'}`. Example #2: `:6,10Gitsigns stage_hunk` now translates to `stage_hunk({6,10})`. Note this change reverts the behaviour of the previous commit that respects 'splitright' Fixes #585
When running an action via the :Gitsigns command, the internal plumbing can now pass the entire command context/options directly to a specialised action command (per action) that knows how to translate command parameters to the specific action parameters. Example #1: `:belowright Gitsigns diffthis` now translates to `diffthis(nil, {split='belowright'}`. Example #2: `:6,10Gitsigns stage_hunk` now translates to `stage_hunk({6,10})`. Note this change reverts the behaviour of the previous commit that respects 'splitright' Fixes #585
Perfect! Thanks!! |
@lewis6991 Did some quick testing of all the options: Works perfectly 🎉 local gs = require("gitsigns")
gs.diffthis('~', {split = "botright"} Results in bug require('gitsigns').setup {
diff_opts = {
split = "botright"
}
} -- same bug
:botright Gitsigns diffthis |
This isn't supported, |
Also there was a typo in the code which I have fixed with 618be8e |
@lewis6991 Understood! I'll test |
Ah, I committed to the wrong branch. Should be on main now. |
Aaaaalmost there lol. Thank you, hopefully this is helpful 😄 . That removes the bug, though the swap doesn't happen for these 2 use cases: With either of these the split happens in the original layout. |
Thanks for the feedback. I found another issue and raised #588.
|
@lewis6991 This now works 🎉 this doesn't |
What version of neovim are you running? |
0.7. Do I still need that `vim.opt.splitright = true` Setting?
…On Mon, Jun 20, 2022 at 10:46 AM Lewis Russell ***@***.***> wrote:
What version of neovim are you running?
—
Reply to this email directly, view it on GitHub
<#585 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAET6PRNZD2TAQ33J5RCNADVQCN47ANCNFSM5ZIEF6EQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ok, you might need 0.8dev for that specific form to work. You no longer need to set |
Ok. Sounds good. I'll test that out later when 0.8 is stable. I'll use one of the options that works for now. Thank you! |
LOVING gitsigns. Seriously great work!
Is your feature request related to a problem? Please describe.
I use the
diffthis
view frequently. I always have to swap the panes because I expect the left pane to be the current buffer and the right pane to contain the base to compare against.Describe the solution you'd like
I'd love if we could pass in a config value for swapping the pane order.
Describe alternatives you've considered
I really thought this would work, but it doesn't swap the panes. I'm guessing it gets called too soon and I need to delay.
Keep up the great work!
The text was updated successfully, but these errors were encountered: