Skip to content

Commit

Permalink
Merge remote-tracking branch 'sublimehq/master' into sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Hall committed Jul 14, 2024
2 parents a2205e9 + 4a51942 commit 827b729
Show file tree
Hide file tree
Showing 46 changed files with 4,447 additions and 3,790 deletions.
8 changes: 7 additions & 1 deletion ActionScript/ActionScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ contexts:
scope: keyword.control.actionscript.2
- match: \b(Boolean|Number|String|Void)\b
scope: storage.type.actionscript.2
- match: \b(null|undefined|true|false)\b
- match: \bfalse\b
scope: constant.language.boolean.false.actionscript.2
- match: \btrue\b
scope: constant.language.boolean.true.actionscript.2
- match: \bnull\b
scope: constant.language.null.actionscript.2
- match: \bundefined\b
scope: constant.language.actionscript.2
- match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b'
scope: constant.numeric.actionscript.2
Expand Down
44 changes: 35 additions & 9 deletions Batch File/Batch File.sublime-syntax
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html
# https://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/4095133#4095133
name: Batch File
scope: source.dosbatch
version: 2
Expand Down Expand Up @@ -161,7 +162,7 @@ contexts:
comment-body:
- meta_scope: comment.line.colon.dosbatch
- include: line-continuations
- match: \n
- match: $\n?
pop: 1

ignored-tail-inner:
Expand Down Expand Up @@ -836,14 +837,27 @@ contexts:
- include: cmd-arg-help
- include: unquoted-eol-pop
- match: (?=\S)
set: cmd-rem-comment-body
set:
- cmd-rem-comment-body
- cmd-rem-comment-begin

cmd-rem-comment-begin:
# In REM comments only the first continuation directly following
# the first token is taken into account.
- meta_include_prototype: false
- match: (\^)\n
captures:
1: punctuation.separator.continuation.line.dosbatch
set: line-continuation-body
- match: (?={{metachar}})
pop: 1

cmd-rem-comment-body:
- meta_include_prototype: false
# meta_content_scope is used since rem should not be
# highlighted as a comment, but a command
- meta_content_scope: comment.line.rem.dosbatch
- match: \n
- match: $\n?
scope: comment.line.rem.dosbatch
pop: 1

Expand Down Expand Up @@ -1550,7 +1564,7 @@ contexts:
scope: punctuation.separator.semicolon.dosbatch

invalid-operators:
- match: '{{redir_or_eoc_char}}'
- match: '[|&<>]+'
scope: invalid.illegal.operator.dosbatch

###[ CONSTANTS ]##############################################################
Expand Down Expand Up @@ -1967,8 +1981,8 @@ contexts:
###[ PROTOTYPES ]#############################################################

bol-pop:
# Note: empty lines are ignored
- match: ^(?!$)
- meta_include_prototype: false
- match: ^
pop: 1

else-pop:
Expand All @@ -1981,9 +1995,21 @@ contexts:
pop: 1

line-continuations:
- match: \^\n
scope: punctuation.separator.continuation.line.dosbatch
push: bol-pop
- match: (\^)\n
captures:
1: punctuation.separator.continuation.line.dosbatch
push: line-continuation-body

line-continuation-body:
- meta_include_prototype: false
# The first linefeed diretly following a continuation is treated literal.
# Note: Must consume \n to work.
- match: ^\n
set: bol-pop
# The first caret at a continued line is escaped by the continuation caret
# and thus printed literal.
- match: ^\^?
pop: 1

eoc-pop:
# Note: An end of command appears in unquoted regions only!
Expand Down
28 changes: 26 additions & 2 deletions Batch File/Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"command": "insert_snippet",
"args": {"contents": "%${0:$SELECTION}%"},
"context": [
{ "key": "setting.auto_match_enabled"},
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "operand": false, "match_all": true },
{ "key": "selector", "operand": "source.dosbatch" }
]
Expand All @@ -23,4 +23,28 @@
{ "key": "following_text", "operator": "regex_contains", "operand": "^%", "match_all": true }
]
},
]
// Auto-pair exclamation mark
// Example: text -> !text!
{
"keys": ["!"],
"command": "insert_snippet",
"args": {"contents": "!${0:$SELECTION}!"},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "operand": false, "match_all": true },
{ "key": "selector", "operand": "source.dosbatch" }
]
},
{
"keys": ["backspace"],
"command": "run_macro_file",
"args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "source.dosbatch" },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "!$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^!", "match_all": true }
]
},
]
Loading

0 comments on commit 827b729

Please sign in to comment.