Last active
November 8, 2018 01:34
-
-
Save koizuss/4521934 to your computer and use it in GitHub Desktop.
Mac上でDocblockr Pluginとgoogle日本語入力を使っていてコメント内でENTERを押したら入力内容が消える問題を回避(とりあえず)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| [ | |
| // open a docblock with enter | |
| { "keys": ["enter"], "command": "jsdocs", | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "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 } | |
| ] | |
| }, | |
| // open a docblock with keypad enter | |
| { "keys": ["keypad_enter"], "command": "jsdocs", | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "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 } | |
| ] | |
| }, | |
| // open a docblock with tab | |
| { "keys": ["tab"], "command": "jsdocs", | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "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 } | |
| ] | |
| }, | |
| /** | |
| * Google日本語入力を使っている場合のENTERで入力内容が消える問題に対応 | |
| * ↓をコメントアウトすることでとりあえず入力できるようになる | |
| * (Docコメント内で改行しても整形されなくなる) | |
| */ | |
| // // extend a docblock by adding an asterisk at the start | |
| // { "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": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, | |
| // { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*\\s*\\S", "match_all": true } | |
| // ] | |
| // }, | |
| // // extend a docblock by adding an asterisk at the start | |
| // { "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": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, | |
| // { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*", "match_all": true } | |
| // ] | |
| // }, | |
| // // extend a docblock with keypad enter by adding an asterisk at the start | |
| // { "keys": ["keypad_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": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, | |
| // { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*", "match_all": true } | |
| // ] | |
| // }, | |
| // trim the automatically added whitespace | |
| { "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": "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 }, | |
| { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true } | |
| ] | |
| }, | |
| // trim the automatically added whitespace | |
| { "keys": ["keypad_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": "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 }, | |
| { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true } | |
| ] | |
| }, | |
| // extend line comments (// and #) | |
| { "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": "setting.jsdocs_extend_double_slash", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selector", "operator": "equal", "operand": "comment.line", "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 } | |
| ] | |
| }, | |
| // extend line comments (// #) with keypad enter | |
| { "keys": ["keypad_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": "setting.jsdocs_extend_double_slash", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selector", "operator": "equal", "operand": "comment.line", "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 } | |
| ] | |
| }, | |
| // close a block comment (/* */) | |
| { "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 } | |
| ] | |
| }, | |
| // close a block comment (/* */) | |
| { "keys": ["keypad_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": ["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}, | |
| { "key": "following_text", "operator": "regex_contains", "operand": "^\\*\\/\\s*$", "match_all": true} | |
| ] | |
| }, | |
| { "keys": ["keypad_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}, | |
| { "key": "following_text", "operator": "regex_contains", "operand": "^\\*\\/$", "match_all": true} | |
| ] | |
| }, | |
| // De-indent at the end of a comment block | |
| { "keys": ["enter"], "command": "jsdocs_deindent", | |
| "context": [ | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s+\\*/", "match_all": true } | |
| ] | |
| }, | |
| // de-indent at the end of a comment block with keypad-enter | |
| { "keys": ["keypad_enter"], "command": "jsdocs_deindent", | |
| "context": [ | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s+\\*/", "match_all": true } | |
| ] | |
| }, | |
| // Open an inline docblock (/** */) | |
| { "keys": ["shift+enter"], "command": "jsdocs", "args": {"inline": true}, | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\*{2}$", "match_all": true } | |
| ] | |
| }, | |
| // Open an inline docblock | |
| { "keys": ["shift+keypad_enter"], "command": "jsdocs", "args": {"inline": true}, | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\*{2}$", "match_all": true } | |
| ] | |
| }, | |
| // show the autocomplete | |
| { "keys": ["@"], "command": "run_macro_file", "args": {"file": "Packages/DocBlockr/jsdocs-auto-complete.sublime-macro"}, | |
| "context": [ | |
| { "key": "setting.auto_complete", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:\\/\\*|###)?\\*\\s*$", "match_all": true }, | |
| { "key": "selector", "operator": "equal", "operand": "comment.block", "match_all": true } | |
| ] | |
| }, | |
| // show the autocomplete in a coffee doc block | |
| { "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*#\\s*$", "match_all": true }, | |
| { "key": "selector", "operator": "equal", "operand": "comment.line.number-sign.coffee", "match_all": true } | |
| ] | |
| }, | |
| // indent to align with the previous line | |
| { "keys": ["tab"], "command": "jsdocs_indent", | |
| "context": [ | |
| { "key": "setting.jsdocs_deep_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
| { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*\\s*$", "match_all": true }, | |
| { "key": "selector", "operator": "equal", "operand": "comment.block", "match_all": true } | |
| ] | |
| }, | |
| // decorate a double-slash comment | |
| { "keys": ["ctrl+enter"], "command": "jsdocs_decorate", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "comment.line.double-slash"} | |
| ] | |
| }, | |
| // decorate a double-slash comment | |
| { "keys": ["ctrl+keypad_enter"], "command": "jsdocs_decorate", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "comment.line.double-slash"} | |
| ] | |
| }, | |
| // join lines inside a comment block, stripping the leading asterisk | |
| { "keys": ["ctrl+j"], "command": "jsdocs_join", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "comment.block" } | |
| ] | |
| }, | |
| // join lines in a line comment, stripping the leading // or # | |
| { "keys": ["ctrl+j"], "command": "jsdocs_join", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "comment.line" } | |
| ] | |
| }, | |
| // reparse a comment block's placeholders | |
| { "keys": ["ctrl+alt+tab"], "command": "jsdocs_reparse", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "comment.block" } | |
| ] | |
| }, | |
| { "keys": ["alt+q"], "command": "jsdocs_wrap_lines", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "comment.block", "match_all": true } | |
| ] | |
| }, | |
| // add line after, in a DocBlock | |
| { "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "Packages/DocBlockr/Add DocBlockr Line.sublime-macro"}, | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "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 } | |
| ] | |
| }, | |
| // add line before, in a DocBlock | |
| { "keys": ["ctrl+shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/DocBlockr/Add DocBlockr Line Before.sublime-macro"}, | |
| "context": [ | |
| { "key": "setting.auto_indent", "operator": "equal", "operand": true, "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 } | |
| ] | |
| } | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment