Skip to content

conflict support 3 - add merge-editor conflict actions, stateful result rendering and reopen-safe persistence#4

Merged
polyphilz merged 2 commits into
mainfrom
polyphilz/3-pane-3
Apr 27, 2026
Merged

conflict support 3 - add merge-editor conflict actions, stateful result rendering and reopen-safe persistence#4
polyphilz merged 2 commits into
mainfrom
polyphilz/3-pane-3

Conversation

@polyphilz
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d7fdc0f56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lua/glance/merge/init.lua
Comment on lines +344 to +346
local previous_model = state.model
local merge_model = sync_from_result_buffer(diffview, file, previous_model)
if not merge_model then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Debounce merge-state sync instead of rebuilding on each keystroke

The TextChanged/TextChangedI autocmd now calls sync_from_result_buffer() for every edit, and that path immediately rebuilds the merge model via model.build(), which shells out to git merge-file each time. On non-trivial conflicted files this turns normal typing into repeated external-process work and can make the merge buffer laggy or briefly unresponsive; this should be throttled or deferred so state recomputation is not done per keystroke.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in polyphilz/3-pane-7

Comment thread lua/glance/merge/init.lua
Comment on lines +101 to +105
local start = conflict.result_range.start
local count = conflict.result_range.count
if count == 0 then
if line == start then
return index
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve target conflict when multiple zero-length conflicts align

When the cursor is in the result pane, conflict selection is recomputed from line number and this branch returns the first conflict whose count == 0 and start matches the cursor line. Adjacent zero-length conflicts can share the same start (no display lines added between them), so an action key can silently apply to the wrong conflict after navigation because the active index is overwritten by this first-match lookup.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in polyphilz/3-pane-7

@polyphilz polyphilz force-pushed the polyphilz/3-pane-2 branch from 6d047b4 to c0b5aaf Compare April 26, 2026 19:10
@polyphilz polyphilz force-pushed the polyphilz/3-pane-3 branch from 0d7fdc0 to 94e92f1 Compare April 26, 2026 19:33
@polyphilz polyphilz changed the base branch from polyphilz/3-pane-2 to main April 26, 2026 19:33
@polyphilz polyphilz changed the title add merge-editor conflict actions, stateful result rendering and reopen-safe persistence conflict support 3 - add merge-editor conflict actions, stateful result rendering and reopen-safe persistence Apr 27, 2026
@polyphilz polyphilz merged commit 588fe80 into main Apr 27, 2026
3 checks passed
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.

1 participant