feat(diff): open editor at cursor line#2952
Open
paaloeye wants to merge 3 commits into
Open
Conversation
- extend OpenExternalEditor event to carry an optional line number - use the selection cursor index into the flat line list to find the exact line, using the same index space as selected_lines() - add editor_goto_style() to map editor name to the correct goto-line argument style (hx: file:line, code: --goto file:line, vi/vim/nvim/emacs/nano/etc: +line file) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Code 2.1.143 (Claude Code) Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
- remove is_immutable guard from can_edit_file() so the edit_file keybinding works in Log -> Files -> Diff and other read-only views - move the edit_item command info outside the !is_immutable block - line number is passed via the existing goto logic; no extra change needed - only mutating operations (stage, unstage, reset hunk) remain gated on is_immutable 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Code 2.1.143 (Claude Code) Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
- add diff_component_opens_editor_at_cursor_line verifying that OpenExternalEditor carries the new_lineno of the line the cursor is on, not the hunk start - add changelog entry for the editor goto-line feature 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Code 2.1.143 (Claude Code) Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
ae90607 to
9026941
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(diff): open editor at cursor line
exact line, using the same index space as selected_lines()
goto-line argument style (hx: file:line, code: --goto file:line,
vi/vim/nvim/emacs/nano/etc: +line file)
I followed the checklist:
make checkwithout errors