diff --git a/syntaxes/cmd-help.sublime-syntax b/syntaxes/cmd-help.sublime-syntax index 72fc10b..bf13821 100644 --- a/syntaxes/cmd-help.sublime-syntax +++ b/syntaxes/cmd-help.sublime-syntax @@ -26,9 +26,14 @@ variables: relaxed_argument_name: '[:alpha:][[:alnum:]_-]*\b' ### scopes (last scope is matched first) + section_heading_scope: &SECTION_HEADING_SCOPE + markup.heading.cmd-help entity.name.section.cmd-help + inline_usage_scope: &INLINE_USAGE_SCOPE + markup.heading.inline-usage.cmd-help entity.name.section.inline-usage.cmd-help option_argument_scope: &OPTION_ARGUMENT_SCOPE variable.other.option-argument.cmd-help variable.parameter.option-argument.cmd-help + contexts: main: - match: '' @@ -52,7 +57,7 @@ contexts: pre-heading: - match: '(?i:usage):(?=.+\n)' - scope: markup.heading.inline-usage.cmd-help + scope: *INLINE_USAGE_SCOPE # only consider lines <= 40 chars long - match: '^(?=.{1,40}\n)' set: heading @@ -60,9 +65,9 @@ contexts: heading: - match: '{{leading_word}}( {{any_word}})*:?\n' - scope: markup.heading.cmd-help + scope: *SECTION_HEADING_SCOPE # - match: '{{any_word}}( {{any_word}})*:\n' - # scope: markup.heading.cmd-help + # scope: *SECTION_HEADING_SCOPE - include: else-pop def-option: diff --git a/tests/theme/OneHalfDark.txt b/tests/theme/OneHalfDark.txt index 49c07c9..2c5d899 100644 --- a/tests/theme/OneHalfDark.txt +++ b/tests/theme/OneHalfDark.txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/OneHalfLight.txt b/tests/theme/OneHalfLight.txt index d44c673..4373869 100644 --- a/tests/theme/OneHalfLight.txt +++ b/tests/theme/OneHalfLight.txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/Solarized (dark).txt b/tests/theme/Solarized (dark).txt index 316502e..a91a168 100644 --- a/tests/theme/Solarized (dark).txt +++ b/tests/theme/Solarized (dark).txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/Solarized (light).txt b/tests/theme/Solarized (light).txt index 6f0c614..84fdb2e 100644 --- a/tests/theme/Solarized (light).txt +++ b/tests/theme/Solarized (light).txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/TwoDark.txt b/tests/theme/TwoDark.txt index dbb3a78..dc15ff4 100644 --- a/tests/theme/TwoDark.txt +++ b/tests/theme/TwoDark.txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/ansi.txt b/tests/theme/ansi.txt index cc5b2da..2676f82 100644 --- a/tests/theme/ansi.txt +++ b/tests/theme/ansi.txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE: bat [OPTIONS] [FILE]... bat -OPTIONS: +OPTIONS: -A, --show-all Show non-printable characters (space, tab, newline, ..). -p, --plain Show plain style (alias for '--style=plain'). -l, --language Set the language for syntax highlighting. @@ -34,10 +34,10 @@ OPTIONS: -h, --help Print this help message. -V, --version Show version information. -ARGS: +ARGS: ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS: cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/base16-256.txt b/tests/theme/base16-256.txt index 6ed6304..7e0c899 100644 --- a/tests/theme/base16-256.txt +++ b/tests/theme/base16-256.txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details. diff --git a/tests/theme/base16.txt b/tests/theme/base16.txt index 6ed6304..7e0c899 100644 --- a/tests/theme/base16.txt +++ b/tests/theme/base16.txt @@ -1,11 +1,11 @@ bat 0.18.2 A cat(1) clone with syntax highlighting and Git integration. -USAGE: +USAGE:  bat [OPTIONS] [FILE]...  bat  -OPTIONS: +OPTIONS:  -A, --show-all Show non-printable characters (space, tab, newline, ..).  -p, --plain Show plain style (alias for '--style=plain').  -l, --language  Set the language for syntax highlighting. @@ -34,10 +34,10 @@  -h, --help Print this help message.  -V, --version Show version information. -ARGS: +ARGS:  ... File(s) to print / concatenate. Use '-' for standard input. -SUBCOMMANDS: +SUBCOMMANDS:  cache Modify the syntax-definition and theme cache Note: `bat -h` prints a short and concise overview while `bat --help` gives all details.