Add treesitter highlighting support in cat mode #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolve treesitter highlighting metadata to syntax_id needed by nvim_get_hl() in group2ansi() which converts highlighting colours to ANSI escape sequences. Fallback to parsing traditional highlighting if treesitter metadata is not available.
This expected to provide functionality requested in #63.
This also resolves the issue with no syntax highlighting available at all when treesitter highlighting is active as traditional and treesitter modes are mutually exclusive; that is no traditional highlighting data will be available if treesitter is active for a given buffer.
Note that a workaround had to be introduced for the treesitter highlighting mode which removes background colour definition for the "Normal" highlight group.
The reason is that treesitter themes seem to define the window background in in the Normal highlight group profile, which was causing spotty background issues with nvimpager rendering a different background for the parts of the text we didn't have a highlighting group for.
Testing done: