problem
<leader>q fills the quickfix list with pending hunks across buffers, but accept/reject is still buffer-local and cursor-based. :cnext/:cprev gets you there; <leader>a/<leader>x doesn't complete a reliable cross-file review loop.
goal
@LOTaher i was thinking about #11. it would be really nice to be able to open quickfix, cycle hunks (including across files, ideally), accept or reject each one and the list stays in sync and advances automatically.
this happens sort of automatically in cursor, which has my favorite "singleton buffer diff" implementation. it's so nice and seamless, i can have an LLM make edits to several files, and just click through and be sent to the next hunk, regardless of what buffer i am in.
the limitation there though is that you still need to hit "review next file." i think there was some AB test that let some users press tab and instantly be sent to the next file to review by pressing tab, but for some reason i don't recall having that feature anymore and also, even then it was really only when the completion engine detected similar patterns across the files edited in the prompt you made.
anyways, i would love to get an LLM to make a semi-larger edit that spans more than one file, and then being able to use quickfix as my review pipeline. i can just cycle hunks across the files edited and accept/reject.
design
quickfix items should store hunk identity, not just the location:
something like:
{
bufnr = bufnr,
lnum = hunk.old_start,
col = 1,
text = preview,
user_data = { bufnr = bufnr, hunk_idx = hunk_idx },
}
sort by filename, then line.
then we can accept/reject by identity. add accept_hunk(bufnr, hunk_idx) / reject_hunk(bufnr, hunk_idx). we can reuse existing apply/clear logic; don't think we need to rely on hunk_at_cursor() for the qf flow.
when acting on the current quickfix entry:
- accept/reject via
user_data
- remove entry from qf list (or rebuild)
:cnext, or close qf when empty
keep existing <leader>a/<leader>x for normal in-buffer use.
optional acceptance
- map
a/x in the quickfix window
- document
<leader>q workflow in README
out of scope
this would work great in multiple files, like i said, but let's focus on just getting this minimally finished.
- multi-file hunks from a single prompt
- changing hunk rendering
refs
PR #11
@LOTaher wdyt?
problem
<leader>qfills the quickfix list with pending hunks across buffers, but accept/reject is still buffer-local and cursor-based.:cnext/:cprevgets you there;<leader>a/<leader>xdoesn't complete a reliable cross-file review loop.goal
@LOTaher i was thinking about #11. it would be really nice to be able to open quickfix, cycle hunks (including across files, ideally), accept or reject each one and the list stays in sync and advances automatically.
this happens sort of automatically in cursor, which has my favorite "singleton buffer diff" implementation. it's so nice and seamless, i can have an LLM make edits to several files, and just click through and be sent to the next hunk, regardless of what buffer i am in.
the limitation there though is that you still need to hit "review next file." i think there was some AB test that let some users press tab and instantly be sent to the next file to review by pressing tab, but for some reason i don't recall having that feature anymore and also, even then it was really only when the completion engine detected similar patterns across the files edited in the prompt you made.
anyways, i would love to get an LLM to make a semi-larger edit that spans more than one file, and then being able to use quickfix as my review pipeline. i can just cycle hunks across the files edited and accept/reject.
design
quickfix items should store hunk identity, not just the location:
something like:
{ bufnr = bufnr, lnum = hunk.old_start, col = 1, text = preview, user_data = { bufnr = bufnr, hunk_idx = hunk_idx }, }sort by filename, then line.
then we can accept/reject by identity. add
accept_hunk(bufnr, hunk_idx)/reject_hunk(bufnr, hunk_idx). we can reuse existing apply/clear logic; don't think we need to rely onhunk_at_cursor()for the qf flow.when acting on the current quickfix entry:
user_data:cnext, or close qf when emptykeep existing
<leader>a/<leader>xfor normal in-buffer use.optional acceptance
a/xin the quickfix window<leader>qworkflow in READMEout of scope
this would work great in multiple files, like i said, but let's focus on just getting this minimally finished.
refs
PR #11
@LOTaher wdyt?