Skip to content

Color ordering fix#216

Open
jmenashe wants to merge 1 commit intogarabik:develfrom
jmenashe:color_ordering_fix
Open

Color ordering fix#216
jmenashe wants to merge 1 commit intogarabik:develfrom
jmenashe:color_ordering_fix

Conversation

@jmenashe
Copy link

@jmenashe jmenashe commented Jun 6, 2022

Modified pattern coloring process to apply coloring in an order consistent with configured color lists and regex groups.

Fixes #215.

…stent with configured color lists and regex groups.
@CoelacanthusHex
Copy link

It cause an error:

Traceback (most recent call last):
  File "/usr/bin/grcat", line 238, in <module>
    add2list(clist, m, pattern['colours'])
  File "/usr/bin/grcat", line 105, in add2list
    clist.append((m.start(group+1), m.end(group+1), patterncolour[group]))
IndexError: list index out of range

when I use for journalctl
It also lead wrong color for gpg

@PBudmark
Copy link

As I stated in recent comment to issue #215, this is actually no error, but could get some clarifications in documentation.

The first color in color list refers th the whole matched string, and following colors refer to the individual groups

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