Skip to content

Commit

Permalink
Fix for OPTIONS consisting of a plain dash
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Hall authored and keith-hall committed Jan 3, 2025
1 parent caba54e commit b7b05a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assets/syntaxes/02_Extra/Manpage.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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}}'
Expand Down
6 changes: 6 additions & 0 deletions assets/syntaxes/02_Extra/syntax_test_man.man
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include
Expand Down

0 comments on commit b7b05a3

Please sign in to comment.