diff --git a/demo.html b/demo.html index 93869ed..4810099 100644 --- a/demo.html +++ b/demo.html @@ -1,75 +1,69 @@ - - -
- - - -true if the operation succeded.
+ * @since 10.0
+ */
+ cut: function() {
+ if (!this._clientDiv) { return false; }
+ return this._doCut();
+ },
/**
* Destroys the text view.
* @@ -15082,7 +15111,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$ this._destroyView(); - var e = {type: "Destroy"}; //$NON-NLS-0$ + var e = {type: "Destroy"}; //$NON-NLS-1$ this.onDestroy(e); this._parent = null; @@ -15301,8 +15330,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$ */ getClientArea: function() { if (!this._clientDiv) { return {x: 0, y: 0, width: 0, height: 0}; } - var scroll = this._getScroll(); - return {x: scroll.x, y: scroll.y, width: this._getClientWidth(), height: this._getClientHeight()}; + var _scroll = this._getScroll(); + return {x: _scroll.x, y: _scroll.y, width: this._getClientWidth(), height: this._getClientHeight()}; }, /** * Returns the horizontal pixel. @@ -15479,8 +15508,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$ options = this._defaultOptions(); } else if (arguments.length === 1) { var arg = arguments[0]; - if (typeof arg === "string") { //$NON-NLS-0$ - return clone(this["_" + arg]); //$NON-NLS-0$ + if (typeof arg === "string") { //$NON-NLS-1$ + return clone(this["_" + arg]); //$NON-NLS-1$ } options = arg; } else { @@ -15493,7 +15522,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$ } for (var option in options) { if (options.hasOwnProperty(option)) { - options[option] = clone(this["_" + option]); //$NON-NLS-0$ + options[option] = clone(this["_" + option]); //$NON-NLS-1$ } } return options; @@ -15580,11 +15609,11 @@ define("orion/editor/textView", [ //$NON-NLS-0$ }, getSelectionText: function(delimiter) { var text = []; - var self = this; + var that = this; var selections = this._getSelections(); selections.forEach(function(selection) { if (!selection.isEmpty()) { - text.push(self._getBaseText(selection.start, selection.end)); + text.push(that._getBaseText(selection.start, selection.end)); } }); return text.join(delimiter !== undefined ? delimiter : this._model.getLineDelimiter()); @@ -15665,7 +15694,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$ var action = this._actions[actionID]; if (action) { if (action.actionDescription && action.actionDescription.id) { - mMetrics.logEvent("editor", "action", action.actionDescription.id); //$NON-NLS-1$ //$NON-NLS-0$ + mMetrics.logEvent("editor", "action", action.actionDescription.id); //$NON-NLS-1$ //$NON-NLS-2$ } if (!defaultAction && action.handler) { if (action.handler(actionOptions)) { @@ -15673,7 +15702,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$ } } if (action.defaultHandler) { - return typeof action.defaultHandler(actionOptions) === "boolean"; //$NON-NLS-0$ + return typeof action.defaultHandler(actionOptions) === "boolean"; //$NON-NLS-1$ } } return false; @@ -16074,6 +16103,18 @@ define("orion/editor/textView", [ //$NON-NLS-0$ onBlur: function(blurEvent) { return this.dispatchEvent(blurEvent); }, + /** + * Replaces the selection with the text on the clipboard or, if there is no selection, inserts the text at the current caret offset. + *
+ * If the single mode is on and the clipboard text contains more than one line, all lines will be concatenated. + *
+ * @returns {Boolean}true if the operation succeded.
+ * @since 10.0
+ */
+ paste: function() {
+ if (!this._clientDiv) { return false; }
+ return this._doPaste();
+ },
/**
* Redraws the entire view, including rulers.
*
@@ -16135,7 +16176,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
if (!ruler && this._imeOffset !== -1) {
imeLineIndex = this._model.getLineAtOffset(this._imeOffset);
}
- if (!ruler || ruler.getOverview() === "page") { //$NON-NLS-0$
+ if (!ruler || ruler.getOverview() === "page") { //$NON-NLS-1$
var child = div.firstChild;
while (child) {
var lineIndex = child.lineIndex;
@@ -16154,7 +16195,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
}
}
- this.dispatchEvent({type: "Redraw", startLine: startLine, endLine: endLine, ruler: ruler}); //$NON-NLS-0$
+ this.dispatchEvent({type: "Redraw", startLine: startLine, endLine: endLine, ruler: ruler}); //$NON-NLS-1$
this._queueUpdate();
},
/**
@@ -16339,15 +16380,15 @@ define("orion/editor/textView", [ //$NON-NLS-0$
setModel: function(model) {
if (model === this._model) { return; }
model = model || new mTextModel.TextModel();
- this._model.removeEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-0$
- this._model.removeEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-0$
+ this._model.removeEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
+ this._model.removeEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
var oldLineCount = this._model.getLineCount();
var oldCharCount = this._model.getCharCount();
var newLineCount = model.getLineCount();
var newCharCount = model.getCharCount();
var newText = model.getText();
var e = {
- type: "ModelChanging", //$NON-NLS-0$
+ type: "ModelChanging", //$NON-NLS-1$
text: newText,
start: 0,
removedCharCount: oldCharCount,
@@ -16358,7 +16399,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
this.onModelChanging(e);
this._model = model;
e = {
- type: "ModelChanged", //$NON-NLS-0$
+ type: "ModelChanged", //$NON-NLS-1$
start: 0,
removedCharCount: oldCharCount,
addedCharCount: newCharCount,
@@ -16366,8 +16407,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$
addedLineCount: newLineCount
};
this.onModelChanged(e);
- this._model.addEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-0$
- this._model.addEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-0$
+ this._model.addEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
+ this._model.addEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
this._reset();
this._update();
},
@@ -16382,17 +16423,17 @@ define("orion/editor/textView", [ //$NON-NLS-0$
var defaultOptions = this._defaultOptions();
for (var option in options) {
if (options.hasOwnProperty(option)) {
- var newValue = options[option], oldValue = this["_" + option]; //$NON-NLS-0$
+ var newValue = options[option], oldValue = this["_" + option]; //$NON-NLS-1$
if (compare(oldValue, newValue)) { continue; }
var update = defaultOptions[option] ? defaultOptions[option].update : null;
if (update) {
update.call(this, newValue);
continue;
}
- this["_" + option] = clone(newValue); //$NON-NLS-0$
+ this["_" + option] = clone(newValue); //$NON-NLS-1$
}
}
- this.onOptions({type: "Options", options: options}); //$NON-NLS-0$
+ this.onOptions({type: "Options", options: options}); //$NON-NLS-1$
},
/**
* @class This object describes the selection show options.
@@ -16502,7 +16543,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
* @see orion.editor.TextView#getText
*/
setText: function (text, start, end, show, callback) {
- var isSingle = typeof text === "string"; //$NON-NLS-0$
+ var isSingle = typeof text === "string"; //$NON-NLS-1$
var reset = start === undefined && end === undefined && isSingle;
var edit;
if (isSingle) {
@@ -16618,7 +16659,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
if (topNode === temp) {
return;
}
- if (temp.className && temp.className.indexOf("textViewFind") !== -1) { //$NON-NLS-0$
+ if (temp.className && temp.className.indexOf("textViewFind") !== -1) { //$NON-NLS-1$
return;
}
temp = temp.parentNode;
@@ -16631,10 +16672,10 @@ define("orion/editor/textView", [ //$NON-NLS-0$
* during mouse down event using usual API. The workaround is to give
* focus back to the client div.
*/
- var self = this;
- var window = this._getWindow();
- window.setTimeout(function() {
- self._clientDiv.focus();
+ var that = this;
+ var win = this._getWindow();
+ win.setTimeout(function() {
+ that._clientDiv.focus();
}, 0);
}
},
@@ -16670,22 +16711,22 @@ define("orion/editor/textView", [ //$NON-NLS-0$
if (util.isIE < 9) {
if (!this._getSelections()[0].isEmpty()) {
var rootDiv = this._rootDiv;
- var child = util.createElement(rootDiv.ownerDocument, "div"); //$NON-NLS-0$
+ var child = util.createElement(rootDiv.ownerDocument, "div"); //$NON-NLS-1$
rootDiv.appendChild(child);
rootDiv.removeChild(child);
}
}
if (this._cursorDiv) {
- this._cursorDiv.style.display = "none"; //$NON-NLS-0$
+ this._cursorDiv.style.display = "none"; //$NON-NLS-1$
}
if (this._domSelection) {
this._domSelection.forEach(function(domSelection) { domSelection.update(); });
/* Clear browser selection if selection is within clientDiv */
var temp;
- var window = this._getWindow();
- var document = this._parent.ownerDocument;
- if (window.getSelection) {
- var sel = window.getSelection();
+ var win = this._getWindow();
+ var doc = this._parent.ownerDocument;
+ if (win.getSelection) {
+ var sel = win.getSelection();
temp = sel.anchorNode;
while (temp) {
if (temp === this._clientDiv) {
@@ -16694,12 +16735,12 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
temp = temp.parentNode;
}
- } else if (document.selection) {
+ } else if (doc.selection) {
this._ignoreSelect = false;
- temp = document.selection.createRange().parentElement();
+ temp = doc.selection.createRange().parentElement();
while (temp) {
if (temp === this._clientDiv) {
- document.selection.empty();
+ doc.selection.empty();
break;
}
temp = temp.parentNode;
@@ -16708,14 +16749,14 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
}
if (!this._ignoreFocus) {
- this.onBlur({type: "Blur"}); //$NON-NLS-0$
+ this.onBlur({type: "Blur"}); //$NON-NLS-1$
}
},
_handleCompositionStart: function (e) {
if (this._ignoreEvent(e)) { return; }
if (this._imeTimeout) {
- var window = this._getWindow();
- window.clearTimeout(this._imeTimeout);
+ var win = this._getWindow();
+ win.clearTimeout(this._imeTimeout);
this._imeTimeout = null;
}
if (this._imeText) {
@@ -16735,8 +16776,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$
_handleCompositionEnd: function (e) {
if (this._ignoreEvent(e)) { return; }
this._imeText = e.data;
- var window = this._getWindow();
- this._imeTimeout = window.setTimeout(function() {
+ var win = this._getWindow();
+ this._imeTimeout = win.setTimeout(function() {
this._commitIME(this._imeText);
this._imeText = this._imeTimeout = null;
}.bind(this), 0);
@@ -16749,9 +16790,9 @@ define("orion/editor/textView", [ //$NON-NLS-0$
// See bug 366312 and 376508.
this._updateDOMSelection();
}
- var preventDefault = false;
- if (this.isListening("ContextMenu")) { //$NON-NLS-0$
- var evt = this._createMouseEvent("ContextMenu", e); //$NON-NLS-0$
+ var preventDefault = true;
+ if (this.isListening("ContextMenu")) { //$NON-NLS-1$
+ var evt = this._createMouseEvent("ContextMenu", e); //$NON-NLS-1$
evt.screenX = e.screenX;
evt.screenY = e.screenY;
this.onContextMenu(evt);
@@ -16804,17 +16845,17 @@ define("orion/editor/textView", [ //$NON-NLS-0$
_handleDragStart: function (e) {
if (this._ignoreEvent(e)) { return; }
if (util.isFirefox < 13) {
- var self = this;
- var window = this._getWindow();
- window.setTimeout(function() {
- self._clientDiv.contentEditable = true;
- self._clientDiv.draggable = false;
- self._ignoreBlur = false;
+ var that = this;
+ var win = this._getWindow();
+ win.setTimeout(function() {
+ that._clientDiv.contentEditable = true;
+ that._clientDiv.draggable = false;
+ that._ignoreBlur = false;
}, 0);
}
- if (this.isListening("DragStart") && this._dragOffset !== -1) { //$NON-NLS-0$
+ if (this.isListening("DragStart") && this._dragOffset !== -1) { //$NON-NLS-1$
this._isMouseDown = false;
- this.onDragStart(this._createMouseEvent("DragStart", e)); //$NON-NLS-0$
+ this.onDragStart(this._createMouseEvent("DragStart", e)); //$NON-NLS-1$
this._dragOffset = -1;
} else {
if (e.preventDefault) { e.preventDefault(); }
@@ -16823,16 +16864,16 @@ define("orion/editor/textView", [ //$NON-NLS-0$
},
_handleDrag: function (e) {
if (this._ignoreEvent(e)) { return; }
- if (this.isListening("Drag")) { //$NON-NLS-0$
- this.onDrag(this._createMouseEvent("Drag", e)); //$NON-NLS-0$
+ if (this.isListening("Drag")) { //$NON-NLS-1$
+ this.onDrag(this._createMouseEvent("Drag", e)); //$NON-NLS-1$
}
},
_handleDragEnd: function (e) {
if (this._ignoreEvent(e)) { return; }
this._dropTarget = false;
this._dragOffset = -1;
- if (this.isListening("DragEnd")) { //$NON-NLS-0$
- this.onDragEnd(this._createMouseEvent("DragEnd", e)); //$NON-NLS-0$
+ if (this.isListening("DragEnd")) { //$NON-NLS-1$
+ this.onDragEnd(this._createMouseEvent("DragEnd", e)); //$NON-NLS-1$
}
if (util.isFirefox < 13) {
this._fixCaret();
@@ -16841,7 +16882,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
* selection is dropped onto itself. The fix is to detected the case and
* call fixCaret() a second time.
*/
- if (e.dataTransfer.dropEffect === "none" && !e.dataTransfer.mozUserCancelled) { //$NON-NLS-0$
+ if (e.dataTransfer.dropEffect === "none" && !e.dataTransfer.mozUserCancelled) { //$NON-NLS-1$
this._fixCaret();
}
}
@@ -16850,9 +16891,9 @@ define("orion/editor/textView", [ //$NON-NLS-0$
if (this._ignoreEvent(e)) { return; }
var prevent = true;
this._dropTarget = true;
- if (this.isListening("DragEnter")) { //$NON-NLS-0$
+ if (this.isListening("DragEnter")) { //$NON-NLS-1$
prevent = false;
- this.onDragEnter(this._createMouseEvent("DragEnter", e)); //$NON-NLS-0$
+ this.onDragEnter(this._createMouseEvent("DragEnter", e)); //$NON-NLS-1$
}
/*
* Webkit will not send drop events if this event is not prevented, as spec in HTML5.
@@ -16867,9 +16908,9 @@ define("orion/editor/textView", [ //$NON-NLS-0$
_handleDragOver: function (e) {
if (this._ignoreEvent(e)) { return; }
var prevent = true;
- if (this.isListening("DragOver")) { //$NON-NLS-0$
+ if (this.isListening("DragOver")) { //$NON-NLS-1$
prevent = false;
- this.onDragOver(this._createMouseEvent("DragOver", e)); //$NON-NLS-0$
+ this.onDragOver(this._createMouseEvent("DragOver", e)); //$NON-NLS-1$
}
/*
* Webkit will not send drop events if this event is not prevented, as spec in HTML5.
@@ -16877,7 +16918,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
* event will result is loss of functionality (insertion mark, etc).
*/
if (util.isWebkit || prevent) {
- if (prevent) { e.dataTransfer.dropEffect = "none"; } //$NON-NLS-0$
+ if (prevent) { e.dataTransfer.dropEffect = "none"; } //$NON-NLS-1$
if (e.preventDefault) { e.preventDefault(); }
return false;
}
@@ -16885,15 +16926,15 @@ define("orion/editor/textView", [ //$NON-NLS-0$
_handleDragLeave: function (e) {
if (this._ignoreEvent(e)) { return; }
this._dropTarget = false;
- if (this.isListening("DragLeave")) { //$NON-NLS-0$
- this.onDragLeave(this._createMouseEvent("DragLeave", e)); //$NON-NLS-0$
+ if (this.isListening("DragLeave")) { //$NON-NLS-1$
+ this.onDragLeave(this._createMouseEvent("DragLeave", e)); //$NON-NLS-1$
}
},
_handleDrop: function (e) {
if (this._ignoreEvent(e)) { return; }
this._dropTarget = false;
- if (this.isListening("Drop")) { //$NON-NLS-0$
- this.onDrop(this._createMouseEvent("Drop", e)); //$NON-NLS-0$
+ if (this.isListening("Drop")) { //$NON-NLS-1$
+ this.onDrop(this._createMouseEvent("Drop", e)); //$NON-NLS-1$
}
/*
* This event must be prevented otherwise the user agent will modify
@@ -16914,21 +16955,21 @@ define("orion/editor/textView", [ //$NON-NLS-0$
this._updateDOMSelection();
}
if (this._cursorDiv) {
- this._cursorDiv.style.display = "block"; //$NON-NLS-0$
+ this._cursorDiv.style.display = "block"; //$NON-NLS-1$
}
if (this._domSelection) {
this._domSelection.forEach(function(domSelection) { domSelection.update(); });
}
if (!this._ignoreFocus) {
- this.onFocus({type: "Focus"}); //$NON-NLS-0$
+ this.onFocus({type: "Focus"}); //$NON-NLS-1$
}
},
_handleKeyDown: function (e) {
this._cancelCheckSelection();
if (this._ignoreEvent(e)) { return; }
- if (this.isListening("KeyDown")) { //$NON-NLS-0$
- var keyEvent = this._createKeyEvent("KeyDown", e); //$NON-NLS-0$
- this.onKeyDown(keyEvent); //$NON-NLS-0$
+ if (this.isListening("KeyDown")) { //$NON-NLS-1$
+ var keyEvent = this._createKeyEvent("KeyDown", e); //$NON-NLS-1$
+ this.onKeyDown(keyEvent); //$NON-NLS-1$
if (keyEvent.defaultPrevented) {
/*
* Feature in Firefox. Keypress events still happen even if the keydown event
@@ -17056,9 +17097,9 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
}
}
- if (this.isListening("KeyPress")) { //$NON-NLS-0$
- var keyEvent = this._createKeyEvent("KeyPress", e); //$NON-NLS-0$
- this.onKeyPress(keyEvent); //$NON-NLS-0$
+ if (this.isListening("KeyPress")) { //$NON-NLS-1$
+ var keyEvent = this._createKeyEvent("KeyPress", e); //$NON-NLS-1$
+ this.onKeyPress(keyEvent); //$NON-NLS-1$
if (keyEvent.defaultPrevented) {
e.preventDefault();
return;
@@ -17104,9 +17145,9 @@ define("orion/editor/textView", [ //$NON-NLS-0$
},
_handleKeyUp: function (e) {
if (this._ignoreEvent(e)) { return; }
- if (this.isListening("KeyUp")) { //$NON-NLS-0$
- var keyEvent = this._createKeyEvent("KeyUp", e); //$NON-NLS-0$
- this.onKeyUp(keyEvent); //$NON-NLS-0$
+ if (this.isListening("KeyUp")) { //$NON-NLS-1$
+ var keyEvent = this._createKeyEvent("KeyUp", e); //$NON-NLS-1$
+ this.onKeyUp(keyEvent); //$NON-NLS-1$
if (keyEvent.defaultPrevented) {
e.preventDefault();
return;
@@ -17126,18 +17167,18 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
},
_handleMouse: function (e) {
- var window = this._getWindow();
+ var win = this._getWindow();
var result = true;
- var target = window;
+ var target = win;
if (util.isIE || (util.isFirefox && !this._overlayDiv)) { target = this._clientDiv; }
if (this._overlayDiv) {
if (this._hasFocus) {
this._ignoreFocus = true;
}
- var self = this;
- window.setTimeout(function () {
- self.focus();
- self._ignoreFocus = false;
+ var that = this;
+ win.setTimeout(function () {
+ that.focus();
+ that._ignoreFocus = false;
}, 0);
}
var extend = e.shiftKey;
@@ -17145,7 +17186,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
var add = util.isMac ? e.metaKey : e.ctrlKey;
this._blockSelection = this._doubleClickSelection = null;
if (this._clickCount === 1) {
- var drag = (!util.isOpera || util.isOpera >= 12.16) && this._hasFocus && this.isListening("DragStart"); //$NON-NLS-0$
+ var drag = (!util.isOpera || util.isOpera >= 12.16) && this._hasFocus && this.isListening("DragStart"); //$NON-NLS-1$
result = this._setSelectionTo(e.clientX, e.clientY, true, extend, add, drag);
if (result) { this._setGrab(target); }
} else {
@@ -17176,7 +17217,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
if (this._ignoreEvent(e)) { return; }
if (this._linksVisible) {
var target = e.target || e.srcElement;
- if (target.tagName !== "A") { //$NON-NLS-0$
+ if (target.tagName !== "A") { //$NON-NLS-1$
this._setLinksVisible(false);
} else {
return;
@@ -17211,8 +17252,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$
this._clickCount = 1;
}
}
- if (this.isListening("MouseDown")) { //$NON-NLS-0$
- var mouseEvent = this._createMouseEvent("MouseDown", e); //$NON-NLS-0$
+ if (this.isListening("MouseDown")) { //$NON-NLS-1$
+ var mouseEvent = this._createMouseEvent("MouseDown", e); //$NON-NLS-1$
this.onMouseDown(mouseEvent);
if (mouseEvent.defaultPrevented) {
e.preventDefault();
@@ -17237,23 +17278,23 @@ define("orion/editor/textView", [ //$NON-NLS-0$
_handleMouseOver: function (e) {
if (this._ignoreEvent(e)) { return; }
if (this._animation) { return; }
- if (this.isListening("MouseOver")) { //$NON-NLS-0$
- this.onMouseOver(this._createMouseEvent("MouseOver", e)); //$NON-NLS-0$
+ if (this.isListening("MouseOver")) { //$NON-NLS-1$
+ this.onMouseOver(this._createMouseEvent("MouseOver", e)); //$NON-NLS-1$
}
},
_handleMouseOut: function (e) {
if (this._ignoreEvent(e)) { return; }
if (this._animation) { return; }
- if (this.isListening("MouseOut")) { //$NON-NLS-0$
- this.onMouseOut(this._createMouseEvent("MouseOut", e)); //$NON-NLS-0$
+ if (this.isListening("MouseOut")) { //$NON-NLS-1$
+ this.onMouseOut(this._createMouseEvent("MouseOut", e)); //$NON-NLS-1$
}
},
_handleMouseMove: function (e) {
if (this._animation) { return; }
var inClient = this._isClientDiv(e);
- if (this.isListening("MouseMove")) { //$NON-NLS-0$
+ if (this.isListening("MouseMove")) { //$NON-NLS-1$
if (inClient || this._isMouseDown){
- var mouseEvent = this._createMouseEvent("MouseMove", e); //$NON-NLS-0$
+ var mouseEvent = this._createMouseEvent("MouseMove", e); //$NON-NLS-1$
this.onMouseMove(mouseEvent);
if (mouseEvent.defaultPrevented) {
e.preventDefault();
@@ -17319,13 +17360,13 @@ define("orion/editor/textView", [ //$NON-NLS-0$
var rightEdge = viewRect.left + viewPad.left + width;
var bottomEdge = viewRect.top + viewPad.top + height;
if (y < topEdge) {
- this._doAutoScroll("up", x, y - topEdge); //$NON-NLS-0$
+ this._doAutoScroll("up", x, y - topEdge); //$NON-NLS-1$
} else if (y > bottomEdge) {
- this._doAutoScroll("down", x, y - bottomEdge); //$NON-NLS-0$
+ this._doAutoScroll("down", x, y - bottomEdge); //$NON-NLS-1$
} else if (x < leftEdge && !this._wrapMode) {
- this._doAutoScroll("left", x - leftEdge, y); //$NON-NLS-0$
+ this._doAutoScroll("left", x - leftEdge, y); //$NON-NLS-1$
} else if (x > rightEdge && !this._wrapMode) {
- this._doAutoScroll("right", x - rightEdge, y); //$NON-NLS-0$
+ this._doAutoScroll("right", x - rightEdge, y); //$NON-NLS-1$
} else {
this._endAutoScroll();
this._setSelectionTo(x, y, false, true);
@@ -17352,7 +17393,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
};
},
_createMouseEvent: function(type, e) {
- var pt = this.convert({x: e.clientX, y: e.clientY}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-0$
+ var pt = this.convert({x: e.clientX, y: e.clientY}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$
return {
type: type,
event: e,
@@ -17365,7 +17406,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
};
},
_createTouchEvent: function(type, e) {
- var pt = e.touches.length ? this.convert({x: e.touches[0].clientX, y: e.touches[0].clientY}, "page", "document") : {}; //$NON-NLS-1$ //$NON-NLS-0$
+ var pt = e.touches.length ? this.convert({x: e.touches[0].clientX, y: e.touches[0].clientY}, "page", "document") : {}; //$NON-NLS-1$ //$NON-NLS-2$
return {
type: type,
event: e,
@@ -17379,9 +17420,9 @@ define("orion/editor/textView", [ //$NON-NLS-0$
},
_handleMouseUp: function (e) {
var left = e.which ? e.button === 0 : e.button === 1;
- if (this.isListening("MouseUp")) { //$NON-NLS-0$
+ if (this.isListening("MouseUp")) { //$NON-NLS-1$
if (this._isClientDiv(e) || (left && this._isMouseDown)) {
- var mouseEvent = this._createMouseEvent("MouseUp", e); //$NON-NLS-0$
+ var mouseEvent = this._createMouseEvent("MouseUp", e); //$NON-NLS-1$
this.onMouseUp(mouseEvent);
if (mouseEvent.defaultPrevented) {
e.preventDefault();
@@ -17431,7 +17472,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
* Note that on Chrome and IE, the caret stops blicking if mouse up is
* prevented.
*/
- if (left && util.isFirefox) {
+ if (left && this._isMouseDown && util.isFirefox) {
this._updateDOMSelection();
e.preventDefault();
}
@@ -17445,7 +17486,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
pixelY = (-e.wheelDelta / 40) * lineHeight;
} else if (util.isFirefox) {
var limit = 256;
- if (e.type === "wheel") { //$NON-NLS-0$
+ if (e.type === "wheel") { //$NON-NLS-1$
if (e.deltaMode) { // page or line
pixelX = Math.max(-limit, Math.min(limit, e.deltaX)) * lineHeight;
pixelY = Math.max(-limit, Math.min(limit, e.deltaY)) * lineHeight;
@@ -17542,12 +17583,12 @@ define("orion/editor/textView", [ //$NON-NLS-0$
/*
* Bug in IE,
*/
- var self = this;
+ var that = this;
this._ignoreFocus = true;
- var window = this._getWindow();
- window.setTimeout(function() {
- self._updateDOMSelection();
- self._ignoreFocus = false;
+ var win = this._getWindow();
+ win.setTimeout(function() {
+ that._updateDOMSelection();
+ that._ignoreFocus = false;
}, 0);
}
if (e.preventDefault) { e.preventDefault(); }
@@ -17592,7 +17633,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
} else {
this._update();
}
- this.dispatchEvent({type: "Resize"}); //$NON-NLS-0$
+ this.dispatchEvent({type: "Resize"}); //$NON-NLS-1$
}
},
_handleRulerEvent: function (e) {
@@ -17606,7 +17647,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
element = element.parentNode;
}
var ruler = element ? element._ruler : null;
- if (lineIndex === undefined && ruler && ruler.getOverview() === "document") { //$NON-NLS-0$
+ if (lineIndex === undefined && ruler && ruler.getOverview() === "document") { //$NON-NLS-1$
var clientHeight = this._getClientHeight ();
var lineCount = this._model.getLineCount ();
var viewPad = this._getViewPadding();
@@ -17629,19 +17670,19 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
if (ruler) {
switch (e.type) {
- case "click": //$NON-NLS-0$
+ case "click": //$NON-NLS-1$
if (ruler.onClick) { ruler.onClick(lineIndex, e); }
break;
- case "dblclick": //$NON-NLS-0$
+ case "dblclick": //$NON-NLS-1$
if (ruler.onDblClick) { ruler.onDblClick(lineIndex, e); }
break;
- case "mousemove": //$NON-NLS-0$
+ case "mousemove": //$NON-NLS-1$
if (ruler.onMouseMove) { ruler.onMouseMove(lineIndex, e); }
break;
- case "mouseover": //$NON-NLS-0$
+ case "mouseover": //$NON-NLS-1$
if (ruler.onMouseOver) { ruler.onMouseOver(lineIndex, e); }
break;
- case "mouseout": //$NON-NLS-0$
+ case "mouseout": //$NON-NLS-1$
if (ruler.onMouseOut) {
var tmp = e.relatedTarget;
while (tmp && tmp !== this._rootDiv) {
@@ -17658,18 +17699,18 @@ define("orion/editor/textView", [ //$NON-NLS-0$
},
_handleScroll: function () {
this._lastScrollTime = new Date().getTime();
- var scroll = this._getScroll(false);
+ var _scroll = this._getScroll(false);
var oldX = this._hScroll;
var oldY = this._vScroll;
- if (oldX !== scroll.x || oldY !== scroll.y) {
- this._hScroll = scroll.x;
- this._vScroll = scroll.y;
+ if (oldX !== _scroll.x || oldY !== _scroll.y) {
+ this._hScroll = _scroll.x;
+ this._vScroll = _scroll.y;
this._commitIME();
- this._update(oldY === scroll.y);
+ this._update(oldY === _scroll.y);
var e = {
- type: "Scroll", //$NON-NLS-0$
+ type: "Scroll", //$NON-NLS-1$
oldValue: {x: oldX, y: oldY},
- newValue: scroll
+ newValue: _scroll
};
this.onScroll(e);
}
@@ -17689,7 +17730,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
_getModelOffset: function(node, offset) {
if (!node) { return; }
var lineNode;
- if (node.tagName === "DIV") { //$NON-NLS-0$
+ if (node.tagName === "DIV") { //$NON-NLS-1$
lineNode = node;
} else {
lineNode = node.parentNode.parentNode;
@@ -17703,8 +17744,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$
if (!(util.isIOS || util.isAndroid || this._checkSelectionChange)) {
return false;
}
- var window = this._getWindow();
- var selection = window.getSelection();
+ var win = this._getWindow();
+ var selection = win.getSelection();
var start = this._getModelOffset(selection.anchorNode, selection.anchorOffset);
var end = this._getModelOffset(selection.focusNode, selection.focusOffset);
var sel = this._getSelections()[0];
@@ -17745,16 +17786,16 @@ define("orion/editor/textView", [ //$NON-NLS-0$
},
_cancelPollSelectionChange: function() {
if (this._selPollTimer) {
- var window = this._getWindow();
- window.clearTimeout(this._selPollTimer);
+ var win = this._getWindow();
+ win.clearTimeout(this._selPollTimer);
this._selPollTimer = null;
}
},
_pollSelectionChange: function(retryPoll) {
var that = this;
- var window = this._getWindow();
+ var win = this._getWindow();
this._cancelPollSelectionChange();
- this._selPollTimer = window.setTimeout(function() {
+ this._selPollTimer = win.setTimeout(function() {
that._selPollTimer = null;
if (!that._clientDiv) { return; }
var changed = that._updateSelectionFromDOM();
@@ -17845,8 +17886,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$
e.preventDefault();
},
_handleTouchStart: function (e) {
- if (this.isListening("TouchStart")) { //$NON-NLS-0$
- var touchEvent = this._createTouchEvent("TouchStart", e); //$NON-NLS-0$
+ if (this.isListening("TouchStart")) { //$NON-NLS-1$
+ var touchEvent = this._createTouchEvent("TouchStart", e); //$NON-NLS-1$
this.onTouchStart(touchEvent);
if (touchEvent.defaultPrevented) {
e.preventDefault();
@@ -17857,11 +17898,11 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
}
this._commitIME();
- var window = this._getWindow();
+ var win = this._getWindow();
if (this._touchScrollTimer) {
- this._vScrollDiv.style.display = "none"; //$NON-NLS-0$
- this._hScrollDiv.style.display = "none"; //$NON-NLS-0$
- window.clearInterval(this._touchScrollTimer);
+ this._vScrollDiv.style.display = "none"; //$NON-NLS-1$
+ this._hScrollDiv.style.display = "none"; //$NON-NLS-1$
+ win.clearInterval(this._touchScrollTimer);
this._touchScrollTimer = null;
}
var touches = e.touches;
@@ -17875,20 +17916,20 @@ define("orion/editor/textView", [ //$NON-NLS-0$
* Bug in Android 4. The clientX/Y coordinates of the touch events
* include the page scrolling offsets.
*/
- if (y < (touch.pageY - window.pageYOffset) || x < (touch.pageX - window.pageXOffset) ) {
- x = touch.pageX - window.pageXOffset;
- y = touch.pageY - window.pageYOffset;
+ if (y < (touch.pageY - win.pageYOffset) || x < (touch.pageX - win.pageXOffset) ) {
+ x = touch.pageX - win.pageXOffset;
+ y = touch.pageY - win.pageYOffset;
}
}
- var pt = this.convert({x: x, y: y}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-0$
+ var pt = this.convert({x: x, y: y}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$
this._lastTouchOffset = this.getOffsetAtLocation(pt.x, pt.y);
this._touchStartTime = e.timeStamp;
this._touching = true;
}
},
_handleTouchMove: function (e) {
- if (this.isListening("TouchMove")) { //$NON-NLS-0$
- var touchEvent = this._createTouchEvent("TouchMove", e); //$NON-NLS-0$
+ if (this.isListening("TouchMove")) { //$NON-NLS-1$
+ var touchEvent = this._createTouchEvent("TouchMove", e); //$NON-NLS-1$
this.onTouchMove(touchEvent);
if (touchEvent.defaultPrevented) {
e.preventDefault();
@@ -17905,36 +17946,36 @@ define("orion/editor/textView", [ //$NON-NLS-0$
this._touchCurrentY = touch.clientY;
var interval = 10;
if (!this._touchScrollTimer && (e.timeStamp - this._touchStartTime) < (interval*20)) {
- this._vScrollDiv.style.display = "block"; //$NON-NLS-0$
+ this._vScrollDiv.style.display = "block"; //$NON-NLS-1$
if (!this._wrapMode) {
- this._hScrollDiv.style.display = "block"; //$NON-NLS-0$
+ this._hScrollDiv.style.display = "block"; //$NON-NLS-1$
}
- var self = this;
- var window = this._getWindow();
- this._touchScrollTimer = window.setInterval(function() {
+ var that = this;
+ var win = this._getWindow();
+ this._touchScrollTimer = win.setInterval(function() {
var deltaX = 0, deltaY = 0;
- if (self._touching) {
- deltaX = self._touchStartX - self._touchCurrentX;
- deltaY = self._touchStartY - self._touchCurrentY;
- self._touchSpeedX = deltaX / interval;
- self._touchSpeedY = deltaY / interval;
- self._touchStartX = self._touchCurrentX;
- self._touchStartY = self._touchCurrentY;
+ if (that._touching) {
+ deltaX = that._touchStartX - that._touchCurrentX;
+ deltaY = that._touchStartY - that._touchCurrentY;
+ that._touchSpeedX = deltaX / interval;
+ that._touchSpeedY = deltaY / interval;
+ that._touchStartX = that._touchCurrentX;
+ that._touchStartY = that._touchCurrentY;
} else {
- if (Math.abs(self._touchSpeedX) < 0.1 && Math.abs(self._touchSpeedY) < 0.1) {
- self._vScrollDiv.style.display = "none"; //$NON-NLS-0$
- self._hScrollDiv.style.display = "none"; //$NON-NLS-0$
- window.clearInterval(self._touchScrollTimer);
- self._touchScrollTimer = null;
+ if (Math.abs(that._touchSpeedX) < 0.1 && Math.abs(that._touchSpeedY) < 0.1) {
+ that._vScrollDiv.style.display = "none"; //$NON-NLS-1$
+ that._hScrollDiv.style.display = "none"; //$NON-NLS-1$
+ win.clearInterval(that._touchScrollTimer);
+ that._touchScrollTimer = null;
return;
} else {
- deltaX = self._touchSpeedX * interval;
- deltaY = self._touchSpeedY * interval;
- self._touchSpeedX *= 0.95;
- self._touchSpeedY *= 0.95;
+ deltaX = that._touchSpeedX * interval;
+ deltaY = that._touchSpeedY * interval;
+ that._touchSpeedX *= 0.95;
+ that._touchSpeedY *= 0.95;
}
}
- self._scrollView(deltaX, deltaY);
+ that._scrollView(deltaX, deltaY);
}, interval);
}
if (this._touchScrollTimer) {
@@ -17943,8 +17984,8 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
},
_handleTouchEnd: function (e) {
- if (this.isListening("TouchEnd")) { //$NON-NLS-0$
- var touchEvent = this._createTouchEvent("TouchEnd", e); //$NON-NLS-0$
+ if (this.isListening("TouchEnd")) { //$NON-NLS-1$
+ var touchEvent = this._createTouchEvent("TouchEnd", e); //$NON-NLS-1$
this.onTouchEnd(touchEvent);
if (touchEvent.defaultPrevented) {
e.preventDefault();
@@ -17966,7 +18007,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
var keyModes = this._keyModes;
for (i = keyModes.length - 1 ; i >= 0; i--) {
mode = keyModes[i];
- if (typeof mode.match === "function") { //$NON-NLS-0$
+ if (typeof mode.match === "function") { //$NON-NLS-1$
var actionID = mode.match(e);
if (actionID !== undefined) {
return this.invokeAction(actionID);
@@ -17986,7 +18027,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
var lineStart = model.getLineStart(lineIndex);
if (args.count < 0 && caret === lineStart) {
if (lineIndex > 0) {
- if (args.unit === "character") { //$NON-NLS-0$
+ if (args.unit === "character") { //$NON-NLS-1$
args.count++;
}
lineIndex--;
@@ -17996,7 +18037,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
} else if (args.count > 0 && caret === model.getLineEnd(lineIndex)) {
if (lineIndex + 1 < model.getLineCount()) {
- if (args.unit === "character") { //$NON-NLS-0$
+ if (args.unit === "character") { //$NON-NLS-1$
args.count--;
}
lineIndex++;
@@ -18006,7 +18047,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
}
} else {
var removeTab = false;
- if (args.expandTab && args.unit === "character" && (caret - lineStart) % this._tabSize === 0) { //$NON-NLS-0$
+ if (args.expandTab && args.unit === "character" && (caret - lineStart) % this._tabSize === 0) { //$NON-NLS-1$
var lineText = model.getText(lineStart, caret);
removeTab = !/[^ ]/.test(lineText); // Only spaces between line start and caret.
}
@@ -18024,7 +18065,7 @@ define("orion/editor/textView", [ //$NON-NLS-0$
return selection;
},
_doBackspace: function (args) {
- var self = this;
+ var that = this;
var selections = this._getSelections();
selections.forEach(function(selection) {
if (selection.isEmpty()) {
@@ -18032,24 +18073,24 @@ define("orion/editor/textView", [ //$NON-NLS-0$
args.count = 1;
}
args.count *= -1;
- args.expandTab = self._expandTab;
- self._doMove(args, selection);
+ args.expandTab = that._expandTab;
+ that._doMove(args, selection);
}
});
this._modifyContent({text: "", selection: selections}, true);
return true;
},
_doCase: function (args) {
- var self = this;
+ var that = this;
var selections = this._getSelections();
var changes = [];
selections.forEach(function(selection) {
- self._doMove(args, selection);
- var text = self.getText(selection.start, selection.end);
+ that._doMove(args, selection);
+ var text = that.getText(selection.start, selection.end);
switch (args.type) {
- case "lower": text = text.toLowerCase(); break; //$NON-NLS-0$
- case "capitalize": text = text.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); break; //$NON-NLS-0$
- case "reverse": //$NON-NLS-0$
+ case "lower": text = text.toLowerCase(); break; //$NON-NLS-1$
+ case "capitalize": text = text.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); break; //$NON-NLS-1$
+ case "reverse": //$NON-NLS-1$
var newText = "";
for (var i=0; itrue to skip printing the closing bracket, false to print it
+ */
+ handleClosingBracket: function(closingChar) {
var editor = this.editor;
var textView = editor.getTextView();
if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$
var model = editor.getModel();
var selections = editor.getSelections();
if (selections.length === 1 && selections[0].start === selections[0].end) {
+ // If the next character is the same bracket close, skip it
var nextChar = selections[0].start === model.getCharCount() ? "" : model.getText(selections[0].start, selections[0].start + 1); //$NON-NLS-0$
if (nextChar === closingChar) {
selections[0].start = selections[0].end = selections[0].start + 1;
editor.setSelections(selections);
return true;
}
+ // If the close bracket is on a new line, reduce the indentation
+ var lineNum = model.getLineAtOffset(selections[0].start);
+ var line = model.getLine(lineNum, true);
+ if (line.match(/^\s*$/)){
+ if(textView.getOptions("tabMode")){ //$NON-NLS-1$
+ var tabSize = textView.getOptions("tabSize"); //$NON-NLS-1$
+ var spaceTab = new Array(tabSize + 1).join(" "); //$NON-NLS-1$
+ var lineStart = model.getLineStart(lineNum);
+ var lineEnd = model.getLineEnd(lineNum);
+ if (lineStart !== lineEnd) {
+ if (line.indexOf("\t") === 0) { //$NON-NLS-1$
+ line = line.substring(1);
+ model.setText(line, lineStart, lineEnd);
+ editor.setSelection(selections[0].start-1, selections[0].end-1);
+ return false;
+ } else if (line.indexOf(spaceTab) === 0) {
+ line = line.substring(tabSize);
+ model.setText(line, lineStart, lineEnd);
+ editor.setSelection(selections[0].start-tabSize, selections[0].end-tabSize);
+ return false;
+ }
+ }
+ }
+ }
}
return false;
},
@@ -26965,7 +27062,6 @@ define("orion/editor/actions", [ //$NON-NLS-0$
return exports;
});
-
/*******************************************************************************
* @license
* Copyright (c) 2010, 2012 IBM Corporation and others.
@@ -28358,7 +28454,6 @@ define("orion/editor/textDND", ['orion/util'], function(util) { //$NON-NLS-1$ //
return {TextDND: TextDND};
});
-
/*******************************************************************************
* @license
* Copyright (c) 2013 IBM Corporation and others.
@@ -28968,7 +29063,6 @@ define("orion/editor/factories", [ //$NON-NLS-0$
return exports;
});
-
/*******************************************************************************
* @license
* Copyright (c) 2011, 2013 IBM Corporation and others.
@@ -30677,6 +30771,41 @@ define("orion/editor/contentAssist", [ //$NON-NLS-0$
this._computedProposals = null;
this._computeProposals(this._initialCaretOffset).then(function(proposals) {
+
+
+ //add a new property to the proposal called 'proposal_belongsTo'
+ //make 'proposal_belongsTo' equal to its scripting language name
+ //i.e proposal 'RegExp' will have 'ecma5' as 'proposal_belongsTo'
+ var proposal_noemphasis_title = "";
+ var proposals_with_emphasis = proposals[0].filter(function(obj) {
+ if (obj.style === "noemphasis_title"){
+ proposal_noemphasis_title = obj.description;
+ }else{
+ obj.proposal_belongsTo = proposal_noemphasis_title;
+ }
+
+ return obj.style !== "noemphasis_title";
+ });
+
+ proposals[0] = proposals_with_emphasis;
+
+ //conbine and sort all proposals
+ proposals[0] = proposals[0].sort(function(a,b) {
+
+ if(!a.hasOwnProperty("name")){
+ return 1;
+ }else if(!b.hasOwnProperty("name")){
+ return -1;
+ }else if (a.name.toLowerCase() < b.name.toLowerCase()){
+ return -1;
+ }else if (a.name.toLowerCase() > b.name.toLowerCase()){
+ return 1;
+ }else{
+ return 0;
+ }
+
+ });
+
if (this.isActive()) {
var flatProposalArray = this._flatten(proposals);
//check if flattened proposals form a valid array with at least one entry
@@ -30783,7 +30912,7 @@ define("orion/editor/contentAssist", [ //$NON-NLS-0$
var foundProposal = false;
if (proposals && proposals.length > 0){
for (var i=0; inull
+ */
+ _createTagsNode: function(tags) {
+ var tagsNode = null;
+ if (tags && tags.constructor === Array && tags.length > 0){
+ tagsNode = document.createElement("span"); //$NON-NLS-1$
+ for (var i=0; if.x+
-g&&(a=Math.max(z-f.x-g,A));n=0;p b&&k.end-a<=-b){k=y;continue}D=f.getText(k.start,Math.min(c,k.end+b+1));if(!this._stylerAdapter.verifyBlock(f,D,k,b)){k=y;continue}}r=k.getBlocks();var q=r.length,w=m(r,h,!0),x=m(r,d,!1,w-1,q);p=!1;if(w&&r.length&&r[w-1].end===a){D=f.getText(r[w-1].start,Math.min(c,a+1));var E=this.computeBlocks(f,D,k,r[w-1].start,null,null,null);E.length&&E[0].end!==r[w-1].end&&(w--,p=!0)}w b&&(d--,b++),this._view.setSelection(b,d))}}},_onSelection:function(b){var a=Array.isArray(b.oldValue)?b.oldValue:[b.oldValue];b=Array.isArray(b.newValue)?b.newValue:[b.newValue];var d=this._view,e=d.getModel(),f;if(this._highlightCaretLine){var c=function(a){var b={};return a.some(function(a){if(a.isEmpty())b[e.getLineAtOffset(a.start).toString()]=!0;
-else return!0;return!1})?{}:b},a=c(a),c=c(b),h=function(a,b){for(var c in a)b[c]||(f=c>>0,d.redrawLines(f,f+1))};h(a,c);h(c,a)}if(this._annotationModel){var a=this._bracketAnnotations,k,m;if(1===b.length&&b[0].isEmpty()&&0<(m=b[0].getCaret()))m-=1,e.getBaseModel&&(m=e.mapOffset(m),e=e.getBaseModel()),b=this._findBlock(this._rootBlock,m),b=this._findMatchingBracket(e,b,m),-1!==b&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,b,b+1),l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,
-m,m+1)]);this._bracketAnnotations=k;this._annotationModel.replaceAnnotations(a,k)}},_spliceStyles:function(b,a,d,e){for(var f=b.regex,c=f.lastIndex=0,h=f.exec(d);h;){for(h=e+h.index;ch-k)break;m.push(d.getText(g,e.start));s=e._model.getLineCount()-1;if(e._lineIndex+s>h-k)return m.push(e._model.getLine(0,f)),m.join("");m.push(e._model.getText());
-g=e.end;k+=s-e._lineCount}b=d.getLineEnd(h-k,f);gh-b)break;var a=g._model.getCharCount();if(g.start+a>h-b){d=h-(g.start+b);k+=g._model.getLineAtOffset(d);b+=d;break}k+=g._model.getLineCount()-1-g._lineCount;b+=a-(g.end-g.start)}return f.getLineAtOffset(h-b)+k},getLineCount:function(){for(var h=this._projections,f=this._model.getLineCount(),
-d=0;da&&(C+=b)):w===q&&0
a&&(C+=b)):C=Math.max(h,k.contentStart);B=x
a&&(E-=b),p>a&&(p-=b),E<=a&&(a