Skip to content

Commit

Permalink
Scope + signs as option
Browse files Browse the repository at this point in the history
As discussed in #8
  • Loading branch information
victor-gp committed Nov 6, 2022
1 parent be3d7ce commit 25d02fa
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion syntaxes/cmd-help.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ contexts:
scope: keyword.control.end-of-options.cmd-help
set: then-pop
- match: \+(?=[\s<[:alpha:]])
scope: keyword.control.plus-option.cmd-help
scope: *OPTION_DEF_SCOPES
set: plus-option-post
- match: -:(?={{option_break}})
scope: *OPTION_DEF_SCOPES
Expand Down
4 changes: 2 additions & 2 deletions tests/highlighted/emacs-26.3.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/highlighted/fzf-0.33.0.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/highlighted/vim-8.1.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions tests/syntax/syntax_test_emacs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ Action options:
FILE visit FILE
#^^^ variable.parameter.other-value.cmd-help
+LINE go to line LINE in next FILE
# <- keyword.control.plus-option.cmd-help
# <- - entity.name.function.option.cmd-help
# <- entity.name.function.option.cmd-help
#^^^^ variable.parameter.option-argument.cmd-help
#todo #8: re-scope + as option
+LINE:COLUMN go to line LINE, column COLUMN, in next FILE
#^^^^^^^^^^^ variable.parameter.option-argument.cmd-help
--directory, -L DIR prepend DIR to load-path (with :DIR, append DIR)
Expand Down
6 changes: 4 additions & 2 deletions tests/syntax/syntax_test_fzf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ usage: fzf [options]
-e, --exact Enable Exact-match
-i Case-insensitive match (default: smart-case match)
+i Case-sensitive match
# ^^ - entity.name.function.option.cmd-help
# ^ entity.name.function.option.cmd-help
# ^ - entity.name.function.option.cmd-help
#todo #8: scope +options
--scheme=SCHEME Scoring scheme [default|path|history]
--literal Do not normalize latin script letters before matching
Expand All @@ -19,7 +20,8 @@ usage: fzf [options]
field index expressions
-d, --delimiter=STR Field delimiter regex (default: AWK-style)
+s, --no-sort Do not sort the result
# ^^ - entity.name.function.option.cmd-help
# ^ entity.name.function.option.cmd-help
# ^ - entity.name.function.option.cmd-help
# ^^ - entity.name.function.option.cmd-help
# ^^^^^^^^^ - entity.name.function.option.cmd-help
--tac Reverse the order of the input
Expand Down
6 changes: 2 additions & 4 deletions tests/syntax/syntax_test_vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ Arguments:
-o[N] Open N windows (default: one for each file)
-O[N] Like -o but split vertically
+ Start at end of file
# ^ keyword.control.plus-option.cmd-help
# ^ - entity.name.function.option.cmd-help
#todo #8: re-scope + as option
# ^ entity.name.function.option.cmd-help
+<lnum> Start at line <lnum>
# ^ keyword.control.plus-option.cmd-help
# ^ entity.name.function.option.cmd-help
# ^^^^^^ variable.parameter.option-argument.cmd-help
--cmd <command> Execute <command> before loading any vimrc file
-c <command> Execute <command> after loading the first file
Expand Down

0 comments on commit 25d02fa

Please sign in to comment.