Skip to content

feat(conflict): merge base pane - #585

Open
Ruudjhuu wants to merge 3 commits into
esmuellert:mainfrom
Ruudjhuu:feat/merge-base-pane
Open

Ruudjhuu wants to merge 3 commits into
esmuellert:mainfrom
Ruudjhuu:feat/merge-base-pane

Conversation

@Ruudjhuu

@Ruudjhuu Ruudjhuu commented Nov 12, 2026 •

Copy link
Copy Markdown

Merge Base Pane

Added optional pane for the base of a merge conflict in the merge view. This supports the 4 way merge view workflow personaly favoured by me in messy merges (still use DiffView for this).

The pane can be shown or hidden by default by setting:

      diff = {
        conflict_show_base = true/false,
      },

The pane can be toggled in the view by <leader> cm

fixes #383

Showcase

conflict_result_position = "bottom"

image

conflict_result_position = "center"

image

Changes

  • confict/view/base.lua: shows, hides and toggles the base pane.
  • alignment: now can align base pane and adds fillers when needed to the base pane
  • Base is a read only revission buffer like "thiers" and "ours" panes
  • added keymap to toggle base pane
  • added base pane functionality explenation to :h codediff-merge-base

AI

Used AI to make me femilliar with the code base and its's design. Also to point out factors I might have forgotten (like the possibility of different views (conflict_result_position = "center")).

Possible aditions

  • conflict gutter: Need to have a design opinion regarding what color it need to be. Currently the colors indicate: conflict, accepted, rejected which are not applicable in a bases pane.

compute_merge_fillers_and_conflicts takes an include_base flag that adds
Base to the filler alignment, padding the inputs where Base is taller.
render_merge_view accepts an optional base buffer and renders Base's side
of each conflict plus its fillers. compute_and_render_conflict now takes
its optional settings as a table so the base buffer can be passed through.
Show the merge base (:1) as an optional fourth pane in the conflict view:
between Incoming and Current in the bottom layout, above Result in the
center layout. It is a read-only stage-:1 virtual buffer aligned with both
inputs. diff.conflict_show_base enables it by default and the
conflict.toggle_base key (<leader>cm) toggles it per session.
@Ruudjhuu Ruudjhuu changed the title Feat: merge base pane feat(conflict): merge base pane Nov 12, 2026
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

Successfully merging this pull request may close these issues.

Add 4-way merge layout for BASE / OURS / THEIRS / RESULT

1 participant