mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
update ace to cd271f1a8bd33712f90dc91d0105bc6674e8c6a4
This commit is contained in:
6
vendor/ace/commands/default_commands.js
vendored
6
vendor/ace/commands/default_commands.js
vendored
@@ -254,15 +254,15 @@ exports.commands = [{
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "togglerecording",
|
||||
bindKey: bindKey("Ctrl-Shift-E", "Ctrl-Shift-E"),
|
||||
bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"),
|
||||
exec: function(editor) { editor.commands.toggleRecording(); },
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "replaymacro",
|
||||
bindKey: bindKey("Ctrl-E", "Ctrl-Fuck-You"),
|
||||
bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"),
|
||||
exec: function(editor) { editor.commands.replay(editor); },
|
||||
readOnly: true
|
||||
},
|
||||
},
|
||||
|
||||
// commands disabled in readOnly mode
|
||||
{
|
||||
|
||||
2
vendor/ace/css/editor.css
vendored
2
vendor/ace/css/editor.css
vendored
@@ -1,4 +1,4 @@
|
||||
/* @import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono); */
|
||||
/*@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);*/
|
||||
|
||||
|
||||
.ace_editor {
|
||||
|
||||
8
vendor/ace/keyboard/keybinding.js
vendored
8
vendor/ace/keyboard/keybinding.js
vendored
@@ -39,7 +39,6 @@
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
var useragent = require("../lib/useragent");
|
||||
var keyUtil = require("../lib/keys");
|
||||
var event = require("../lib/event");
|
||||
require("../commands/default_commands");
|
||||
@@ -76,8 +75,9 @@ var KeyBinding = function(editor) {
|
||||
};
|
||||
|
||||
this.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) {
|
||||
var toExecute;
|
||||
for (var i = this.$handlers.length; i--;) {
|
||||
var toExecute = this.$handlers[i].handleKeyboard(
|
||||
toExecute = this.$handlers[i].handleKeyboard(
|
||||
this.$data, hashId, keyString, keyCode, e
|
||||
);
|
||||
if (toExecute && toExecute.command)
|
||||
@@ -97,13 +97,13 @@ var KeyBinding = function(editor) {
|
||||
if (success && e)
|
||||
event.stopEvent(e);
|
||||
|
||||
return success
|
||||
return success;
|
||||
};
|
||||
|
||||
this.handleKeyboard = function(data, hashId, keyString) {
|
||||
return {
|
||||
command: this.$editor.commands.findKeyCommand(hashId, keyString)
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
this.onCommandKey = function(e, hashId, keyCode) {
|
||||
|
||||
16
vendor/ace/keyboard/textinput.js
vendored
16
vendor/ace/keyboard/textinput.js
vendored
@@ -47,7 +47,7 @@ var TextInput = function(parentNode, host) {
|
||||
|
||||
var text = dom.createElement("textarea");
|
||||
if (useragent.isTouchPad)
|
||||
text.setAttribute("x-palm-disable-auto-cap", true);
|
||||
text.setAttribute("x-palm-disable-auto-cap", true);
|
||||
|
||||
text.style.left = "-10000px";
|
||||
parentNode.appendChild(text);
|
||||
@@ -201,7 +201,7 @@ var TextInput = function(parentNode, host) {
|
||||
clipboardData.setData("Text", copyText);
|
||||
host.onCut();
|
||||
}
|
||||
event.preventDefault(e)
|
||||
event.preventDefault(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -213,10 +213,10 @@ var TextInput = function(parentNode, host) {
|
||||
event.addListener(text, "compositionstart", onCompositionStart);
|
||||
if (useragent.isGecko) {
|
||||
event.addListener(text, "text", onCompositionUpdate);
|
||||
};
|
||||
}
|
||||
if (useragent.isWebKit) {
|
||||
event.addListener(text, "keyup", onCompositionUpdate);
|
||||
};
|
||||
}
|
||||
event.addListener(text, "compositionend", onCompositionEnd);
|
||||
|
||||
event.addListener(text, "blur", function() {
|
||||
@@ -240,7 +240,7 @@ var TextInput = function(parentNode, host) {
|
||||
|
||||
function isFocused() {
|
||||
return document.activeElement === text;
|
||||
};
|
||||
}
|
||||
this.isFocused = isFocused;
|
||||
|
||||
this.getElement = function() {
|
||||
@@ -254,12 +254,12 @@ var TextInput = function(parentNode, host) {
|
||||
|
||||
text.style.cssText =
|
||||
'position:fixed; z-index:1000;' +
|
||||
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;'
|
||||
'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;';
|
||||
|
||||
}
|
||||
if (isEmpty)
|
||||
text.value='';
|
||||
}
|
||||
};
|
||||
|
||||
this.onContextMenuClose = function(){
|
||||
setTimeout(function () {
|
||||
@@ -269,7 +269,7 @@ var TextInput = function(parentNode, host) {
|
||||
}
|
||||
sendText();
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports.TextInput = TextInput;
|
||||
|
||||
6
vendor/ace/lib/event.js
vendored
6
vendor/ace/lib/event.js
vendored
@@ -180,7 +180,7 @@ exports.addMouseWheelListener = function(el, callback) {
|
||||
// some versions of Safari (e.g. 5.0.5) report insanely high
|
||||
// scroll values. These browsers require a higher factor
|
||||
if (Math.abs(e.wheelDeltaY) > max)
|
||||
max = Math.abs(e.wheelDeltaY)
|
||||
max = Math.abs(e.wheelDeltaY);
|
||||
|
||||
if (max > 5000)
|
||||
var factor = 400;
|
||||
@@ -323,7 +323,7 @@ exports.addCommandKeyListener = function(el, callback) {
|
||||
|
||||
if (window.postMessage) {
|
||||
var postMessageId = 1;
|
||||
this.nextTick = function(callback, win) {
|
||||
exports.nextTick = function(callback, win) {
|
||||
win = win || window;
|
||||
var messageName = "zero-timeout-message-" + postMessageId;
|
||||
exports.addListener(win, "message", function listener(e) {
|
||||
@@ -337,7 +337,7 @@ if (window.postMessage) {
|
||||
};
|
||||
}
|
||||
else {
|
||||
this.nextTick = function(callback, win) {
|
||||
exports.nextTick = function(callback, win) {
|
||||
win = win || window;
|
||||
window.setTimeout(callback, 0);
|
||||
};
|
||||
|
||||
10
vendor/ace/mode/coffee_highlight_rules.js
vendored
10
vendor/ace/mode/coffee_highlight_rules.js
vendored
@@ -86,7 +86,7 @@ define(function(require, exports, module) {
|
||||
regex : "(?:(?:\\.|::)\\s*)" + identifier
|
||||
}, {
|
||||
token : "variable",
|
||||
regex : "@" + identifier
|
||||
regex : "@(?:" + identifier + ")?"
|
||||
}, {
|
||||
token: function(value) {
|
||||
if (keywords.hasOwnProperty(value))
|
||||
@@ -150,15 +150,15 @@ define(function(require, exports, module) {
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
regex : "\\?|\\:|\\,|\\."
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|\\!)"
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[({[]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\]})]"
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "\\S+"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
@@ -179,12 +179,14 @@ define(function(require, exports, module) {
|
||||
qstring : [{
|
||||
token : "string",
|
||||
regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qqstring : [{
|
||||
token : "string",
|
||||
regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
|
||||
7
vendor/ace/mode/coffee_tokenizer_test.js
vendored
7
vendor/ace/mode/coffee_tokenizer_test.js
vendored
@@ -53,6 +53,13 @@ module.exports = {
|
||||
var tokens = this.tokenizer.getLineTokens("for", "start").tokens;
|
||||
assert.equal(tokens.length, 1);
|
||||
assert.equal(tokens[0].type, "keyword");
|
||||
},
|
||||
|
||||
"test tokenize string with interpolation": function() {
|
||||
var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens;
|
||||
console.log(tokens);
|
||||
assert.equal(tokens.length, 12);
|
||||
//assert.equal(tokens[0].type, "keyword");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
3
vendor/ace/mode/javascript.js
vendored
3
vendor/ace/mode/javascript.js
vendored
@@ -57,7 +57,6 @@ oop.inherits(Mode, TextMode);
|
||||
|
||||
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
||||
var outdent = true;
|
||||
var outentedRows = [];
|
||||
var re = /^(\s*)\/\//;
|
||||
|
||||
for (var i=startRow; i<= endRow; i++) {
|
||||
@@ -96,7 +95,7 @@ oop.inherits(Mode, TextMode);
|
||||
}
|
||||
|
||||
if (state == "start" || state == "regex_allowed") {
|
||||
var match = line.match(/^.*[\{\(\[\:]\s*$/);
|
||||
var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
|
||||
12
vendor/ace/mode/javascript_test.js
vendored
12
vendor/ace/mode/javascript_test.js
vendored
@@ -63,14 +63,14 @@ module.exports = {
|
||||
"test: toggle comment lines should prepend '//' to each line" : function() {
|
||||
var session = new EditSession([" abc", "cde", "fg"]);
|
||||
|
||||
var comment = this.mode.toggleCommentLines("start", session, 0, 1);
|
||||
this.mode.toggleCommentLines("start", session, 0, 1);
|
||||
assert.equal(["// abc", "//cde", "fg"].join("\n"), session.toString());
|
||||
},
|
||||
|
||||
"test: toggle comment on commented lines should remove leading '//' chars" : function() {
|
||||
var session = new EditSession(["// abc", "//cde", "fg"]);
|
||||
|
||||
var comment = this.mode.toggleCommentLines("start", session, 0, 1);
|
||||
this.mode.toggleCommentLines("start", session, 0, 1);
|
||||
assert.equal([" abc", "cde", "fg"].join("\n"), session.toString());
|
||||
},
|
||||
|
||||
@@ -85,14 +85,14 @@ module.exports = {
|
||||
"test: toggle comment on multiple lines with one commented line prepend '//' to each line" : function() {
|
||||
var session = new EditSession(["// abc", "//cde", "fg"]);
|
||||
|
||||
var comment = this.mode.toggleCommentLines("start", session, 0, 2);
|
||||
this.mode.toggleCommentLines("start", session, 0, 2);
|
||||
assert.equal(["//// abc", "////cde", "//fg"].join("\n"), session.toString());
|
||||
},
|
||||
|
||||
"test: toggle comment on a comment line with leading white space": function() {
|
||||
var session = new EditSession(["//cde", " //fg"]);
|
||||
|
||||
var comment = this.mode.toggleCommentLines("start", session, 0, 1);
|
||||
this.mode.toggleCommentLines("start", session, 0, 1);
|
||||
assert.equal(["cde", " fg"].join("\n"), session.toString());
|
||||
},
|
||||
|
||||
@@ -104,6 +104,10 @@ module.exports = {
|
||||
assert.equal(" ", this.mode.getNextLineIndent("start", "case 'juhu':", " "));
|
||||
},
|
||||
|
||||
"test: no auto indent in object literal" : function() {
|
||||
assert.equal("", this.mode.getNextLineIndent("start", "{ 'juhu':", " "));
|
||||
},
|
||||
|
||||
"test: no auto indent after opening brace in multi line comment" : function() {
|
||||
assert.equal("", this.mode.getNextLineIndent("start", "/*if () {", " "));
|
||||
assert.equal(" ", this.mode.getNextLineIndent("comment", " abcd", " "));
|
||||
|
||||
2
vendor/ace/virtual_renderer.js
vendored
2
vendor/ace/virtual_renderer.js
vendored
@@ -61,7 +61,7 @@ var VirtualRenderer = function(container, theme) {
|
||||
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
||||
// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
|
||||
// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
|
||||
|
||||
|
||||
// Chrome has some strange rendering issues if this is not done async
|
||||
setTimeout(function() {
|
||||
dom.addCssClass(container, "ace_editor");
|
||||
|
||||
Reference in New Issue
Block a user