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

Autoscroll in pager #1223

Closed
wants to merge 1 commit into from
Closed

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Jul 21, 2022

A second attempt (after #1139) to add two features:

  • autoscroll in pager,
  • regex matching lines colorization in pager.

In this attempt I've did what has been recommended to me previously:

  • autoscroll is off by default so that tig resembles less (set pager-autoscroll = off),,
  • the regex used by the line colorization can be also customized via an option color-pager-regex.

I think that running make in pager is a good use case and it could be better supported.

@psprint
Copy link
Contributor Author

psprint commented Aug 13, 2022

@koutcher ping. I've worked on the patch and took all suggestions into account. I wonder what chances have this PR to merge?

@psprint
Copy link
Contributor Author

psprint commented Sep 1, 2022

@koutcher ping :)

@psprint
Copy link
Contributor Author

psprint commented Oct 1, 2022

@koutcher @krobelus merge?

@psprint
Copy link
Contributor Author

psprint commented Oct 6, 2022

@koutcher @krobelus ping 👋

@@ -652,11 +653,19 @@ update_view(struct view *view)
return false;
}

if ((view->pos.offset + view->height + 1) == view->lines)
Copy link
Contributor

Choose a reason for hiding this comment

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

autoscroll seems like an interesting feature. I don't use the pager view but I can imagine autoscroll being useful.
I think this commit should be submitted in a separate PR, without the highlighting changes.

There seems to be an off-by-one error. When I type :!git log it only scrolls until the last-but-one line; the last line is not visible.

Instead of an option, we could also implement less's F command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@krobelus: I've updated the PR to cover only autoscroll feature and fixed the off by 1 error. I agree that autoscroll is useful, I'm using it all the time.

src/diff.c Outdated Show resolved Hide resolved
src/diff.c Outdated Show resolved Hide resolved
@psprint psprint force-pushed the Autoscroll-In-Pager branch from a92e5cb to ff9243c Compare December 27, 2022 13:36
@psprint psprint force-pushed the Autoscroll-In-Pager branch from ff9243c to cdd8baa Compare December 27, 2022 13:47
koutcher pushed a commit that referenced this pull request Dec 29, 2022
Autoscroll the pager view if a new option `pager-autoscroll` is set to `on`.

[tk: tweaked the code and added doc]
@koutcher
Copy link
Collaborator

Thanks. It needed a bit of rework to have things done at the proper place.

@koutcher koutcher closed this Dec 29, 2022
@psprint
Copy link
Contributor Author

psprint commented Dec 29, 2022

Thanks for merging :)

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.

3 participants