1. guillermooo
  2. AAAPackageDev

Commits

guillermooo  committed 31ba02d

detect multiline comments and more key names

  • Participants
  • Parent commits 8c89d14
  • Branches default

Comments (0)

Files changed (2)

File Support/Sublime Key Map.JSON-tmLanguage

View file
  • Ignore whitespace
   "scopeName": "source.sublimekeymap",
   "fileTypes": ["sublime-keymap"],
   "patterns": [
+
+      { "include": "#multiLineComment" },
+      { "include": "#lineComment" },
+      
       { "begin": "(^\\[$)",
         "end": "(^\\]$)",
 
         "patterns": [
+          { "include": "#multiLineComment" },
+          { "include": "#lineComment" },
           { "include": "#keys" },
           { "include": "#mainKeys" },
           { "include": "#supportKeys" },
           { "include": "#string" },
-          { "include": "#lineComment" },
           { "include": "#numericPrimitives" }
         ],
         "contentName": "meta.keybinding.collection.sublimekeymap"
                 { "match": "f(?:[2-9]\\d+|\\d{3,})",
                   "name": "invalid.illegal.key.sublimekeymap"
                 },
-                { "match": "up|down|right|left|insert|home|end|pageup|pagedown|backspace|delete|tab|enter|pause|escape|space|keypad[0-9]|keypad_(?:period|divide|multiply|minus|plus|enter)|clear|sysreq|break|context_menu|browser_(?:back|forward|refresh|stop|search|favorites|home)|f(20|1[0-9]|[1-9])",
+                { "match": "\\b(?:up|down|right|left|insert|home|end|pageup|pagedown|backspace|delete|tab|enter|pause|escape|space|keypad[0-9]|keypad_(?:period|divide|multiply|minus|plus|enter)|clear|sysreq|break|context_menu|browser_(?:back|forward|refresh|stop|search|favorites|home)|forward_slash|backquote|plus|equals|minus|f(20|1[0-9]|[1-9]))\\b",
                   "name": "entity.other.attribute-name.key.named.sublimekeymap"
                 },
                 { "match": "[A-Za-z0-9,;.:_=+-]{2,}",
         "match": "//.*?$",
         "name": "comment.single.line.sublimekeymap"
       },
+      "multiLineComment": {
+        "begin": "/\\*",
+        "end": "\\*/",
+        "name": "comment.single.line.sublimekeymap"
+      },
       "numericPrimitives": {
         "patterns": [
           {  "name": "constant.numeric.boolean.sublimekeymap",

File Support/Sublime Key Map.tmLanguage

View file
  • Ignore whitespace
 	<key>patterns</key>
 	<array>
 		<dict>
+			<key>include</key>
+			<string>#multiLineComment</string>
+		</dict>
+		<dict>
+			<key>include</key>
+			<string>#lineComment</string>
+		</dict>
+		<dict>
 			<key>begin</key>
 			<string>(^\[$)</string>
 			<key>contentName</key>
 			<array>
 				<dict>
 					<key>include</key>
+					<string>#multiLineComment</string>
+				</dict>
+				<dict>
+					<key>include</key>
+					<string>#lineComment</string>
+				</dict>
+				<dict>
+					<key>include</key>
 					<string>#keys</string>
 				</dict>
 				<dict>
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>#lineComment</string>
-				</dict>
-				<dict>
-					<key>include</key>
 					<string>#numericPrimitives</string>
 				</dict>
 			</array>
 						</dict>
 						<dict>
 							<key>match</key>
-							<string>up|down|right|left|insert|home|end|pageup|pagedown|backspace|delete|tab|enter|pause|escape|space|keypad[0-9]|keypad_(?:period|divide|multiply|minus|plus|enter)|clear|sysreq|break|context_menu|browser_(?:back|forward|refresh|stop|search|favorites|home)|f(20|1[0-9]|[1-9])</string>
+							<string>\b(?:up|down|right|left|insert|home|end|pageup|pagedown|backspace|delete|tab|enter|pause|escape|space|keypad[0-9]|keypad_(?:period|divide|multiply|minus|plus|enter)|clear|sysreq|break|context_menu|browser_(?:back|forward|refresh|stop|search|favorites|home)|forward_slash|backquote|plus|equals|minus|f(20|1[0-9]|[1-9]))\b</string>
 							<key>name</key>
 							<string>entity.other.attribute-name.key.named.sublimekeymap</string>
 						</dict>
 			<key>match</key>
 			<string>"(command|args|context|key)":</string>
 		</dict>
+		<key>multiLineComment</key>
+		<dict>
+			<key>begin</key>
+			<string>/\*</string>
+			<key>end</key>
+			<string>\*/</string>
+			<key>name</key>
+			<string>comment.single.line.sublimekeymap</string>
+		</dict>
 		<key>numericPrimitives</key>
 		<dict>
 			<key>patterns</key>