From b7b05a35532986d544a7a17fe3c2f1d390f903a8 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Mon, 30 Dec 2024 21:07:49 +0200 Subject: [PATCH] Fix for OPTIONS consisting of a plain dash --- assets/syntaxes/02_Extra/Manpage.sublime-syntax | 3 +++ assets/syntaxes/02_Extra/syntax_test_man.man | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/assets/syntaxes/02_Extra/Manpage.sublime-syntax b/assets/syntaxes/02_Extra/Manpage.sublime-syntax index 2475da8a..0779ce04 100644 --- a/assets/syntaxes/02_Extra/Manpage.sublime-syntax +++ b/assets/syntaxes/02_Extra/Manpage.sublime-syntax @@ -85,6 +85,9 @@ contexts: options: # command-line options like --option=value, --some-flag, or -x + - match: '^[ ]{7}(-)(?=\s)' + captures: + 1: entity.name.command-line-option.man - match: '^[ ]{7}(?=-|\+)' push: expect-command-line-option - match: '(?:[^a-zA-Z0-9_-]|^|\s){{command_line_option}}' diff --git a/assets/syntaxes/02_Extra/syntax_test_man.man b/assets/syntaxes/02_Extra/syntax_test_man.man index 01ce1c55..5dfee5be 100644 --- a/assets/syntaxes/02_Extra/syntax_test_man.man +++ b/assets/syntaxes/02_Extra/syntax_test_man.man @@ -131,6 +131,12 @@ OPTIONS # ^^ - variable output NUM (default 3) lines of copied context + - This is not really a switch, but indicates that standard input +# ^ entity.name.command-line-option.man +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - entity - variable + is coming from a file or a pipe and not interactively from the + command line. + EXAMPLE #include # ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include