Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can edit in Pager #1243

Merged
merged 1 commit into from
Nov 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ pager_request(struct view *view, enum request request, struct line *line)
enum open_flags flags = view_is_displayed(view) ? OPEN_SPLIT : OPEN_DEFAULT;
int split = 0;

if (request == REQ_EDIT)
return diff_common_edit(view, request, line);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like a good change, thanks. This has bothered me occasionally in the past, although I hardly use the pager view (perhaps because of that?).

One thing that's weird in git log -p | tig is that if my cursor is inside a commit message,
:edit will work - searches upwards for the last file in above commit.
I think we should stop the search at a commit boundary, e.g. the commit: line. I guess this is not a blocker.

Can we also make it work for the log view (e.g. tig log -p)?

One more thing: could you put the PR description in the commit message instead? The commit message will make it into the changelog (via git shortlog)


if (request != REQ_ENTER)
return request;

Expand Down