1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +00:00

Fixed manpage regex regression and add syntax test

This commit is contained in:
Guy Barzilai
2026-02-18 23:59:38 +02:00
parent 3ebfbb7ac5
commit 5bd08845a3
3 changed files with 800 additions and 1 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ scope: source.man
variables:
section_heading: '^(?!#)\S.*$'
command_line_option: '(--?[A-Za-z0-9][_A-Za-z0-9-]*)'
ansi_escape_sequence: '\e\[[\?=]?(?:\d+;?)*[A-Za-z]'
contexts:
prototype:
@@ -69,7 +70,7 @@ contexts:
escape: '(?={{section_heading}})'
function-call:
- match: '(?:\s+)(?:\e\[[\?=]?(?:\d+;?)+[A-Za-z])?([A-Za-z0-9_\-^\e]+\.)?([A-Za-z0-9_\-]+)(?:\e\[[\?=]?(?:\d+;?)+[A-Za-z])?(\()([^)]*)(\))'
- match: '(?<!\e\[)(?:\b|\s)(?:{{ansi_escape_sequence}})?([A-Za-z0-9_\-]+\.)?([A-Za-z0-9_\-]+)(?:{{ansi_escape_sequence}})?(\()([^)]*)(\))'
captures:
1: entity.name.function.man
2: entity.name.function.man