conflict support 3 - add merge-editor conflict actions, stateful result rendering and reopen-safe persistence#4
Conversation
There was a problem hiding this comment.
💡 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".
| local previous_model = state.model | ||
| local merge_model = sync_from_result_buffer(diffview, file, previous_model) | ||
| if not merge_model then |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Resolved in polyphilz/3-pane-7
| local start = conflict.result_range.start | ||
| local count = conflict.result_range.count | ||
| if count == 0 then | ||
| if line == start then | ||
| return index |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Resolved in polyphilz/3-pane-7
6d047b4 to
c0b5aaf
Compare
…en-safe persistence
0d7fdc0 to
94e92f1
Compare
No description provided.