diff options
author | Cheng-Han, Wu | 2016-06-01 14:37:28 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-06-01 14:37:28 +0800 |
commit | fb70833bc52aedffa3ed0764a31b706dd1fb3250 (patch) | |
tree | 5d88e7b20afea400a8c11eb0dc07734df3381917 /public/vendor/codemirror/keymap | |
parent | 16d5e3ea8020c839dd6e2dd192e8ccba71f39eed (diff) |
Update CodeMirror to version 5.15.3
Diffstat (limited to 'public/vendor/codemirror/keymap')
-rw-r--r-- | public/vendor/codemirror/keymap/sublime.js | 22 | ||||
-rw-r--r-- | public/vendor/codemirror/keymap/vim.js | 15 |
2 files changed, 5 insertions, 32 deletions
diff --git a/public/vendor/codemirror/keymap/sublime.js b/public/vendor/codemirror/keymap/sublime.js index 3cf67413..c1749e71 100644 --- a/public/vendor/codemirror/keymap/sublime.js +++ b/public/vendor/codemirror/keymap/sublime.js @@ -124,6 +124,7 @@ } cm.setSelections(newSelection); }); + cm.execCommand("indentAuto"); } cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); }; @@ -419,27 +420,6 @@ map[cK + ctrl + "Backspace"] = "delLineLeft"; - cmds[map["Backspace"] = "smartBackspace"] = function(cm) { - if (cm.somethingSelected()) return CodeMirror.Pass; - - var cursor = cm.getCursor(); - var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor); - var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); - var indentUnit = cm.getOption("indentUnit"); - - if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) { - var prevIndent = new Pos(cursor.line, - CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit)); - - // If no smart delete is happening (due to tab sizing) just do a regular delete - if (prevIndent.ch == cursor.ch) return CodeMirror.Pass; - - return cm.replaceRange("", prevIndent, cursor, "+delete"); - } else { - return CodeMirror.Pass; - } - }; - cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) { cm.operation(function() { var ranges = cm.listSelections(); diff --git a/public/vendor/codemirror/keymap/vim.js b/public/vendor/codemirror/keymap/vim.js index b2bee5a1..4278ee97 100644 --- a/public/vendor/codemirror/keymap/vim.js +++ b/public/vendor/codemirror/keymap/vim.js @@ -3782,17 +3782,10 @@ } } function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '<span style="font-family: monospace">' + prefix + '</span>'; - } - raw += '<input type="text"/> ' + - '<span style="color: #888">'; - if (desc) { - raw += '<span style="color: #888">'; - raw += desc; - raw += '</span>'; - } + var raw = '<span style="font-family: monospace; white-space: pre">' + + (prefix || "") + '<input type="text"></span>'; + if (desc) + raw += ' <span style="color: #888">' + desc + '</span>'; return raw; } var searchPromptDesc = '(Javascript regexp)'; |