Skip to main content

Module mergetool_vimdiff

Module mergetool_vimdiff 

Source
Expand description

Vimdiff merge tool layout generation compatible with Git’s mergetools/vimdiff driver.

This mirrors the shell logic in git/mergetools/vimdiff so grit mergetool and tests can share one implementation. Layout strings use only ASCII (LOCAL, BASE, REMOTE, MERGED, separators +, /, ,, and parentheses).

Structs§

VimdiffGenCmd
Result of vimdiff_gen_cmd: the -c "..." vim argument body and the save target pane.

Functions§

vimdiff_cmd_without_base
When no base version exists, Git rewrites buffer indices in the vim command (2bquit, etc.).
vimdiff_executable_for_tool
Executable name for a vimdiff-family merge tool (vim, gvim, nvim).
vimdiff_final_cmd_script
Inner script passed to vim -f -c '<script>' (without the outer -c wrapper).
vimdiff_gen_cmd
Computes FINAL_CMD and FINAL_TARGET from a layout string, matching gen_cmd in Git’s vimdiff driver.
vimdiff_merge_argv_no_base
Builds argv when the common ancestor is missing: LOCAL REMOTE MERGED only, after vimdiff_cmd_without_base.
vimdiff_merge_argv_with_base
Builds argv for vim -f -c '...' LOCAL BASE REMOTE MERGED (base present), matching Git’s merge_cmd eval.
vimdiff_resolve_layout
Resolves the layout string for a merge tool name, matching merge_cmd in Git’s vimdiff script.