kopia lustrzana https://github.com/c9/core
update ace
rodzic
9df0df8bc5
commit
f11a38c2ac
|
@ -81,10 +81,10 @@ var snippetCompleter = {
|
|||
};
|
||||
|
||||
var completers = [snippetCompleter, textCompleter, keyWordCompleter];
|
||||
// Allows default completers to be removed or replaced with a explict set of completers
|
||||
// A null argument here will result in an empty completer array, not a null attribute
|
||||
// Modifies list of default completers
|
||||
exports.setCompleters = function(val) {
|
||||
completers = val || [];
|
||||
completers.length = 0;
|
||||
if (val) completers.push.apply(completers, val);
|
||||
};
|
||||
exports.addCompleter = function(completer) {
|
||||
completers.push(completer);
|
||||
|
|
|
@ -588,6 +588,7 @@ exports.handler.addCommands({
|
|||
exec: function(editor) {
|
||||
exports.killRing.add(editor.getCopyText());
|
||||
editor.commands.byName.cut.exec(editor);
|
||||
editor.setEmacsMark(null);
|
||||
},
|
||||
readOnly: true,
|
||||
multiSelectAction: "forEach"
|
||||
|
|
|
@ -482,6 +482,7 @@ var TextInput = function(parentNode, host) {
|
|||
if (host.renderer.$keepTextAreaAtCursor)
|
||||
host.renderer.$keepTextAreaAtCursor = null;
|
||||
|
||||
clearTimeout(closeTimeout);
|
||||
// on windows context menu is opened after mouseup
|
||||
if (useragent.isWin && !useragent.isOldIE)
|
||||
event.capture(host.container, move, onContextMenuClose);
|
||||
|
@ -507,6 +508,11 @@ var TextInput = function(parentNode, host) {
|
|||
host.textInput.onContextMenu(e);
|
||||
onContextMenuClose();
|
||||
};
|
||||
event.addListener(text, "mouseup", onContextMenu);
|
||||
event.addListener(text, "mousedown", function(e) {
|
||||
e.preventDefault();
|
||||
onContextMenuClose();
|
||||
});
|
||||
event.addListener(host.renderer.scroller, "contextmenu", onContextMenu);
|
||||
event.addListener(text, "contextmenu", onContextMenu);
|
||||
};
|
||||
|
|
|
@ -185,7 +185,7 @@ exports.addMouseWheelListener = function(el, callback) {
|
|||
}
|
||||
};
|
||||
|
||||
exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) {
|
||||
exports.addMultiMouseDownListener = function(elements, timeouts, eventHandler, callbackName) {
|
||||
var clicks = 0;
|
||||
var startX, startY, timer;
|
||||
var eventNames = {
|
||||
|
@ -194,7 +194,7 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac
|
|||
4: "quadclick"
|
||||
};
|
||||
|
||||
exports.addListener(el, "mousedown", function(e) {
|
||||
function onMousedown(e) {
|
||||
if (exports.getButton(e) !== 0) {
|
||||
clicks = 0;
|
||||
} else if (e.detail > 1) {
|
||||
|
@ -226,18 +226,22 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac
|
|||
clicks = 0;
|
||||
else if (clicks > 1)
|
||||
return eventHandler[callbackName](eventNames[clicks], e);
|
||||
});
|
||||
|
||||
if (useragent.isOldIE) {
|
||||
exports.addListener(el, "dblclick", function(e) {
|
||||
clicks = 2;
|
||||
if (timer)
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600);
|
||||
eventHandler[callbackName]("mousedown", e);
|
||||
eventHandler[callbackName](eventNames[clicks], e);
|
||||
});
|
||||
}
|
||||
function onDblclick(e) {
|
||||
clicks = 2;
|
||||
if (timer)
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600);
|
||||
eventHandler[callbackName]("mousedown", e);
|
||||
eventHandler[callbackName](eventNames[clicks], e);
|
||||
}
|
||||
if (!Array.isArray(elements))
|
||||
elements = [elements];
|
||||
elements.forEach(function(el) {
|
||||
exports.addListener(el, "mousedown", onMousedown);
|
||||
if (useragent.isOldIE)
|
||||
exports.addListener(el, "dblclick", onDblclick);
|
||||
});
|
||||
};
|
||||
|
||||
var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window)
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["punctuation.section.comment"," // let's talk about it"]
|
||||
["comment_block",2,"start"],
|
||||
["comment"," // let's talk about it"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
|
@ -53,12 +53,11 @@
|
|||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["punctuation.section.comment"," // also not a comment"]
|
||||
["comment_block",3,"start"],
|
||||
["comment"," // also not a comment"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag.any.jade"," div"],
|
||||
["entity.other.attribute-name.class.jade",".attemptAtBlock"]
|
||||
["comment_block",3,"start"],
|
||||
["comment"," div.attemptAtBlock"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "]
|
||||
|
|
|
@ -1367,9 +1367,7 @@ PHP.Parser.prototype.parseEscapeSequences = function( str, quote ) {
|
|||
return chr(octdec(str));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return str;
|
||||
);
|
||||
};
|
||||
|
||||
/* This is an automatically GENERATED file, which should not be manually edited.
|
||||
|
|
|
@ -72,11 +72,12 @@ function DefaultHandlers(mouseHandler) {
|
|||
var selectionRange = editor.getSelectionRange();
|
||||
var selectionEmpty = selectionRange.isEmpty();
|
||||
editor.$blockScrolling++;
|
||||
if (selectionEmpty)
|
||||
if (selectionEmpty || button == 1)
|
||||
editor.selection.moveToPosition(pos);
|
||||
editor.$blockScrolling--;
|
||||
// 2: contextmenu, 1: linux paste
|
||||
editor.textInput.onContextMenu(ev.domEvent);
|
||||
if (button == 2)
|
||||
editor.textInput.onContextMenu(ev.domEvent);
|
||||
return; // stopping event here breaks contextmenu on ff mac
|
||||
}
|
||||
|
||||
|
|
|
@ -60,15 +60,12 @@ var MouseHandler = function(editor) {
|
|||
var mouseTarget = editor.renderer.getMouseEventTarget();
|
||||
event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"));
|
||||
event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove"));
|
||||
event.addMultiMouseDownListener(mouseTarget, [400, 300, 250], this, "onMouseEvent");
|
||||
if (editor.renderer.scrollBarV) {
|
||||
event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [400, 300, 250], this, "onMouseEvent");
|
||||
event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [400, 300, 250], this, "onMouseEvent");
|
||||
if (useragent.isIE) {
|
||||
event.addListener(editor.renderer.scrollBarV.element, "mousedown", focusEditor);
|
||||
event.addListener(editor.renderer.scrollBarH.element, "mousedown", focusEditor);
|
||||
}
|
||||
}
|
||||
event.addMultiMouseDownListener([
|
||||
mouseTarget,
|
||||
editor.renderer.scrollBarV && editor.renderer.scrollBarV.element,
|
||||
editor.renderer.scrollBarH && editor.renderer.scrollBarH.element,
|
||||
editor.textInput && editor.textInput.getElement()
|
||||
].filter(Boolean), [400, 300, 250], this, "onMouseEvent");
|
||||
event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel"));
|
||||
event.addTouchMoveListener(editor.container, this.onTouchMove.bind(this, "touchmove"));
|
||||
|
||||
|
@ -79,11 +76,11 @@ var MouseHandler = function(editor) {
|
|||
event.addListener(gutterEl, "mousemove", this.onMouseEvent.bind(this, "guttermousemove"));
|
||||
|
||||
event.addListener(mouseTarget, "mousedown", focusEditor);
|
||||
|
||||
event.addListener(gutterEl, "mousedown", function(e) {
|
||||
editor.focus();
|
||||
return event.preventDefault(e);
|
||||
});
|
||||
event.addListener(gutterEl, "mousedown", focusEditor);
|
||||
if (useragent.isIE && editor.renderer.scrollBarV) {
|
||||
event.addListener(editor.renderer.scrollBarV.element, "mousedown", focusEditor);
|
||||
event.addListener(editor.renderer.scrollBarH.element, "mousedown", focusEditor);
|
||||
}
|
||||
|
||||
editor.on("mousemove", function(e){
|
||||
if (_self.state || _self.$dragDelay || !_self.$dragEnabled)
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
"c9.ide.imgeditor": "#612e75ef4f",
|
||||
"c9.ide.immediate": "#a962119bec",
|
||||
"c9.ide.installer": "#0fde9f0067",
|
||||
"c9.ide.language.python": "#undefined",
|
||||
"c9.ide.mount": "#b9a5a2d45c",
|
||||
"c9.ide.navigate": "#38ae100ea1",
|
||||
"c9.ide.newresource": "#981a408a7b",
|
||||
|
|
Ładowanie…
Reference in New Issue