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

Update %(text) when navigating diff contents #1082

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

krobelus
Copy link
Contributor

Previously we'd only update %(text) in the header of the diff view. Also
update %(text) when inside the diff contents. This allows to determine if
the current line is added, deleted or context, which allows to give precise
location information when talking to the GitLab API for example.

src/diff.c Outdated
}
pager_select(view, line);
Copy link
Collaborator

Choose a reason for hiding this comment

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

And why not 2 levels up ?

                        string_ncopy(view->ref, view->ops->id, strlen(view->ops->id));
                }
        }
        pager_select(view, line);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks more in line with the documentation (The text of the currently selected line.) and I don't see any drawback to do it for all lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that seems more logical. No reason to leave out the stat-lines.

f1302c0 added %(text) only in the pager view, and now we add it to the diff and stage views. There are still some other views that don't have it, but that's not a bad thing IMO.
For example, in the main view this seems mostly redundant because the user can compose the line with other substitutions already.

Previously we'd only update %(text) in the header of the diff view.  Also
update %(text) when inside the diff contents. This allows to determine if
the current line is added, deleted or context, which allows to give precise
location information when talking to the GitLab API for example.
@krobelus krobelus force-pushed the update-text-inside-diff branch from 6db4cfa to 3ae811f Compare February 11, 2021 21:19
@koutcher koutcher merged commit 2c29904 into jonas:master Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants