feat(commands): add :Greview for unified diff review with qflist/loclist #202
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/diffs.nvim!202
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/greview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
diffs.nvim provides
:Gdifffor single-file diffs andgdiff_section()for staged/unstaged sections, but has no way to view a full unified diff against an arbitrary git ref (e.g.origin/main) with structured file and hunk navigation.Solution
Add
M.greview(base, opts)tocommands.lua, which creates a unified diff buffer nameddiffs://review:{base}, parsesdiff --gitand@@positions, and populates the qflist (files with+N/-Mstats) and loclist (hunks with filename, hunk number, and@@header). All list entries point into the diff buffer socnext/lnextnavigate naturally within it.Also adds:
M.review_file_at_line(bufnr, lnum)utility for finding the filename at any line in a review bufferread_buffer()reviewlabel case for:erefresh:Greviewcommand with git ref tab completion