Skip to content
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

Using g:MergetoolSetLayoutCallback for equal sized windows doesn't work on initial MergetoolStart #18

Closed
idbrii opened this issue Apr 18, 2020 · 1 comment

Comments

@idbrii
Copy link

idbrii commented Apr 18, 2020

I want equal sized windows whenever mergetool lays out the windows.

function s:on_mergetool_set_layout(split)
    wincmd =
endfunction
let g:MergetoolSetLayoutCallback = function('s:on_mergetool_set_layout')

This works for MergetoolToggleLayout (switching between lmr and lm), but not the initial layout from MergetoolStart.

Using gvim started like this (see #17) :

gvim --nofork -c "simalt ~x" -c "let g:mergetool_args_order = 'MBLR'" -c "Merge" "%MERGED%" "%BASE%" "%LOCAL%" "%REMOTE%"
@idbrii
Copy link
Author

idbrii commented Apr 18, 2020

Turns out simalt ~x (maximize) doesn't tell vim how wide it is fast enough or something. This can be reproduced without vim-mergetool:

gvim --nofork +"simalt ~x" +vsplit +vsplit +"wincmd ="

The solution is to explicitly set columns to it's maximum before using simalt

gvim --nofork +"set columns=9999" +"simalt ~x" +vsplit +vsplit +"wincmd ="

And the correct command for launching vim-mergetool:

gvim --nofork +"set columns=9999" +"simalt ~x" +"let g:mergetool_args_order = 'MBLR'" +"Merge" "%MERGED%" "%BASE%" "%LOCAL%" "%REMOTE%"

@idbrii idbrii closed this as completed Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant