Permalink
Browse files

Fixes #45 - Single-asterisk block comments are automatically closed. …

…An asterisk at the start of one of these lines will be aligned nicely
  • Loading branch information...
1 parent 77f6e88 commit d7252615a25a6b26d74a37584a3dae7b9bab9b7a @spadgos committed Jun 5, 2012
Showing with 21 additions and 9 deletions.
  1. +21 −9 Default.sublime-keymap
View
30 Default.sublime-keymap
@@ -33,15 +33,15 @@
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\*\\s*).*$/$1/}"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*\\s*\\S", "match_all": true }
]
},
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\*\\s*).*$/$1/}"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
{ "key": "setting.trim_automatic_white_space", "operator": "equal", "operand": false },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*", "match_all": true }
@@ -50,7 +50,7 @@
{ "keys": ["enter"], "command": "jsdocs_trim_auto_whitespace", "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
{ "key": "setting.trim_automatic_white_space", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*\\s*$", "match_all": true }
@@ -60,9 +60,21 @@
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
{ "key": "setting.jsdocs_extend_double_slash", "operator": "equal", "operand": true, "match_all": true},
- { "key": "selector", "operator" : "equal", "operand" : "comment.line.double-slash", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.line.double-slash", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
- { "key": "preceding_text", "operator" : "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
+ ]
+ },
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n */"}, "context":
+ [
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true},
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\*$", "match_all": true}
+ ]
+ },
+ { "keys": ["*"], "command": "insert_snippet", "args": {"contents": " *"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "comment.block", "match_all": true},
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true}
]
},
{ "keys": ["enter"], "command": "jsdocs_deindent", "context":
@@ -88,7 +100,7 @@
{ "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\*\\s*).*$/$1/}"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*", "match_all": true }
]
@@ -97,16 +109,16 @@
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
{ "key": "setting.jsdocs_extend_double_slash", "operator": "equal", "operand": true, "match_all": true},
- { "key": "selector", "operator" : "equal", "operand" : "comment.line.double-slash", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.line.double-slash", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
- { "key": "preceding_text", "operator" : "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
]
},
{ "keys": ["@"], "command": "run_macro_file", "args": {"file": "Packages/DocBlockr/jsdocs-auto-complete.sublime-macro"}, "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:\\*|\\/\\*{2})\\s*$", "match_all": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true}
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true}
]
},
{ "keys": ["tab"], "command": "jsdocs_indent", "context":

0 comments on commit d725261

Please sign in to comment.