on master help sign in
Fix Manpage C highlighting regression
commit575888d81b3ecdb49dc31406d12053ab135f648e authorKeith Hall <kingkeith+github@gmail.com> dateThu 15 Oct 2020, 06:39 (6 years ago) parent3539d3e
3 files changed+36−3
assets/syntaxes/02_Extra/Manpage.sublime-syntax+13−2 assets/syntaxes/02_Extra/syntax_test_man.man+22 tests/syntax-tests/highlighted/Manpage/select-2.man+1−1
assets/syntaxes/02_Extra/Manpage.sublime-syntax+13−2
@@ -89,8 +89,9 @@ contexts:
8989 scope: entity.name.command-line-option.man
9090 - match: '(\[)(=)'
9191 captures:
92+ 1: punctuation.section.brackets.begin.man
9293 2: keyword.operator.man
93− push: expect-parameter
94+ push: [command-line-option-or-pipe, expect-parameter]
9495 - match: '\['
9596 push:
9697 - meta_scope: entity.name.command-line-option.man
@@ -112,13 +113,23 @@ contexts:
112113 expect-parameter:
113114 - match: '[A-Za-z0-9-]+'
114115 scope: variable.parameter.man
116+ - match: (?=\s+\|)
117+ pop: true
115118 - match: \|
116119 scope: keyword.operator.logical.man
120+ - match: '\['
121+ scope: punctuation.section.brackets.begin.man
122+ push:
123+ - match: '\]'
124+ scope: punctuation.section.brackets.end.man
125+ pop: true
126+ - include: expect-parameter
117127 - match: '$|(?=[],]|{{command_line_option}})'
118128 pop: true
119129
120130 synopsis:
121− #- include: scope:source.c
131+ - match: '^(?=\s+(?:#include|/\*))'
132+ push: scope:source.c
122133 - match: \[
123134 scope: punctuation.section.brackets.begin.man
124135 push: command-line-option-or-pipe
assets/syntaxes/02_Extra/syntax_test_man.man+22
@@ -21,6 +21,22 @@ SYNOPSIS
2121# ^ punctuation.section.brackets.begin
2222# ^^^^^^^^^^^^^^^^ entity.name.command-line-option
2323# ^ punctuation.section.brackets.end
24+ [-u | --set-upstream] [-o <string> | --push-option=<string>]
25+# ^ punctuation.section.brackets.begin
26+# ^^ entity.name.command-line-option
27+# ^ keyword.operator.logical
28+# ^^^^^^^^^^^^^^ entity.name.command-line-option
29+# ^ punctuation.section.brackets.end
30+# ^^^^^^^^^^^^^ entity.name.command-line-option
31+ [--force-with-lease[=<refname>[:<expect>]]]
32+# ^ punctuation.section.brackets.begin
33+# ^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
34+# ^ punctuation.section.brackets.begin
35+# ^ keyword.operator
36+# ^^^^^^^ variable.parameter
37+# ^ punctuation.section.brackets.begin
38+# ^^^^^^ variable.parameter
39+# ^^^ punctuation.section.brackets.end
2440
2541 example --system [options]
2642# ^^^^^^^^ entity.name
@@ -28,6 +44,12 @@ SYNOPSIS
2844 COMMON OPTIONS
2945 [--quiet] [--debug] [--help|-h] [--version] [--conf FILE]
3046
47+ /* According to POSIX.1-2001, POSIX.1-2008 */
48+# ^^ source comment.block punctuation.definition.comment
49+ #include <sys/select.h>
50+# ^^^^^^^^ source meta.preprocessor.include keyword.control.import.include
51+
52+
3153DESCRIPTION
3254 example does something useful in relation to the command line options
3355 and configuration information in /etc/example.conf.
tests/syntax-tests/highlighted/Manpage/select-2.man+1−1
@@ -1,4 +1,4 @@
1−SELECT(2) Linux Programmer's Manual SELECT(2)
1+SELECT(2) Linux Programmer's Manual SELECT(2)
22
33NAME
44 select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O multiplexing