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

Highlight matching regex pattern in pager, via option color-pager-regex #1249

Closed
wants to merge 1 commit into from

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Dec 27, 2022

A third attempt after #1223 to commit flexible pager view output highlighter.

Any line matching the regex given by option color_pager_regex will be drawn in a new color ↔ color-match. The option is empty by default, as requested. The color is magenta by default.

Example:
2022-12-27-150236_1888x926_scrot

Typically useful to make compiler warnings easy visible.

…gex`

Any line matching the regex will be drawn in a new color ↔ `color-match`.

Useful to make compiler warnings easy visible.
@psprint
Copy link
Contributor Author

psprint commented Jan 4, 2023

Hi,
Could be the PR be merged? It's an useful feature, I'm just used it to highlight a preamble of introducionary lines in a Tig run as the item chooser (like fzf), which is nice as the UI is the same as Tig.

@koutcher
Copy link
Collaborator

koutcher commented Jan 5, 2023

Once again you reinvent the wheel, Tig already has a coloring engine that can be extended to support regular expressions... Look for the updated syntax in the commit message or in tigrc.5.adoc.

@koutcher koutcher closed this in d803c7b Jan 5, 2023
@psprint
Copy link
Contributor Author

psprint commented Jan 7, 2023

The new support is great, I was able to colorize output of my new tigsuites feature plugin:

It allows to create project and subproject file lists that can be opened from tig:
2023-01-07-163841_1889x1045_scrot

However, it seems that the color always spans whole line. Would it be hard to colorize different parts of lines in different color?

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