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

REMOTE and LOCAL buffers fail to load #24

Open
idbrii opened this issue Feb 28, 2022 · 2 comments
Open

REMOTE and LOCAL buffers fail to load #24

idbrii opened this issue Feb 28, 2022 · 2 comments

Comments

@idbrii
Copy link

idbrii commented Feb 28, 2022

Trying to merge loader.lua and show L or R in a diff and I get errors in those buffers.

:edit loader.lua
:MergetoolStart
:MergetoolToggleLayout LmR

LOCAL:

fatal: Not a valid object name :2:loader.lua

REMOTE:

fatal: Not a valid object name :3:loader.lua

Looks like the issue is that mergetool is assuming merging is started at the root of the repository, but when starting mergetool while editing, it is not.

Probably s:mergedfile_name needs to be relative to the .git.

Tested on 0275a85

@idbrii
Copy link
Author

idbrii commented Feb 28, 2022

There was one other issue: git requires forward slashes -- even on Windows.

Here are the steps required to get it to work:

:edit loader.lua
" note: cwd is the folder containing loader.lua
:cd ../../..
" go up to repo root
:set shellslash
:MergetoolStart
:MergetoolToggleLayout LmR

idbrii added a commit to idbrii/vim-mergetool that referenced this issue Feb 28, 2022
Fix samoshkin#24

Instead of trying to handle correct files ourselves, track the absolute
path of the merged file and pass it to fugitive to load into our
buffers.
idbrii added a commit to idbrii/vim-mergetool that referenced this issue Feb 28, 2022
Fix samoshkin#24

Instead of trying to handle correct files ourselves, track the absolute
path of the merged file and pass it to fugitive to load into our
buffers.
@idbrii
Copy link
Author

idbrii commented Feb 28, 2022

I fixed this in my fork by using fugitive to load the other files: idbrii@2a8c1c5

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