1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 03:12:25 +01:00

Highlight C code in all man pages sections

This commit is contained in:
Keith Hall
2020-10-17 18:45:23 +03:00
committed by David Peter
parent 5b2da2b08d
commit 41e857ea16
4 changed files with 37 additions and 29 deletions

View File

@@ -83,6 +83,7 @@ contexts:
- match: ''
pop: true
- include: function-call
- include: c-code
expect-command-line-option:
- match: '[A-Za-z0-9-]+'
@@ -127,9 +128,12 @@ contexts:
- match: '$|(?=[],]|{{command_line_option}})'
pop: true
synopsis:
c-code:
- match: '^(?=\s+(?:#include|/\*))'
push: scope:source.c
synopsis:
- include: c-code
- match: \[
scope: punctuation.section.brackets.begin.man
push: command-line-option-or-pipe

View File

@@ -123,3 +123,7 @@ OPTIONS
# ^^^ variable.parameter
# ^^ - variable
output NUM (default 3) lines of copied context
EXAMPLE
#include <stdio.h>
# ^^^^^^^^ source meta.preprocessor.include keyword.control.import.include