From ad05b3a6c227fd4b664b4e03273ee0686dc697f7 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Tue, 1 May 2012 12:08:20 +0200 Subject: [PATCH] package --- .../kitchen-sink/kitchen-sink-uncompressed.js | 1870 ++++++++++------- .../kitchen-sink/mode-c_cpp-uncompressed.js | 6 +- .../kitchen-sink/mode-coffee-uncompressed.js | 6 +- .../mode-coldfusion-uncompressed.js | 12 +- .../kitchen-sink/mode-csharp-uncompressed.js | 6 +- .../kitchen-sink/mode-css-uncompressed.js | 3 +- .../kitchen-sink/mode-groovy-uncompressed.js | 6 +- .../kitchen-sink/mode-haxe-uncompressed.js | 6 +- .../kitchen-sink/mode-html-uncompressed.js | 17 +- .../kitchen-sink/mode-java-uncompressed.js | 6 +- .../mode-javascript-uncompressed.js | 6 +- .../kitchen-sink/mode-json-uncompressed.js | 9 +- .../kitchen-sink/mode-less-uncompressed.js | 3 +- .../kitchen-sink/mode-lua-uncompressed.js | 16 +- .../mode-markdown-uncompressed.js | 23 +- .../kitchen-sink/mode-perl-uncompressed.js | 3 +- .../kitchen-sink/mode-php-uncompressed.js | 6 +- .../mode-powershell-uncompressed.js | 6 +- .../kitchen-sink/mode-python-uncompressed.js | 3 +- .../kitchen-sink/mode-scad-uncompressed.js | 6 +- .../kitchen-sink/mode-scala-uncompressed.js | 6 +- .../kitchen-sink/mode-scss-uncompressed.js | 3 +- .../kitchen-sink/mode-svg-uncompressed.js | 14 +- .../kitchen-sink/mode-xml-uncompressed.js | 9 +- .../kitchen-sink/mode-xquery-uncompressed.js | 2 +- build/demo/kitchen-sink/styles.css | 2 + .../theme-monokai-uncompressed.js | 9 +- .../theme-solarized_dark-uncompressed.js | 7 +- .../theme-tomorrow_night_blue-uncompressed.js | 9 +- build/demo/kitchen-sink/worker-coffee.js | 190 +- build/demo/kitchen-sink/worker-css.js | 184 +- build/demo/kitchen-sink/worker-javascript.js | 198 +- build/demo/kitchen-sink/worker-json.js | 186 +- build/kitchen-sink.html | 17 +- build/src/ace-noconflict.js | 2 +- build/src/ace-uncompressed-noconflict.js | 1844 +++++++++------- build/src/ace-uncompressed.js | 1844 +++++++++------- build/src/ace.js | 2 +- .../src/mode-c_cpp-uncompressed-noconflict.js | 6 +- build/src/mode-c_cpp-uncompressed.js | 6 +- .../mode-coffee-uncompressed-noconflict.js | 6 +- build/src/mode-coffee-uncompressed.js | 6 +- ...mode-coldfusion-uncompressed-noconflict.js | 12 +- build/src/mode-coldfusion-uncompressed.js | 12 +- .../mode-csharp-uncompressed-noconflict.js | 6 +- build/src/mode-csharp-uncompressed.js | 6 +- build/src/mode-css-uncompressed-noconflict.js | 3 +- build/src/mode-css-uncompressed.js | 3 +- .../mode-groovy-uncompressed-noconflict.js | 6 +- build/src/mode-groovy-uncompressed.js | 6 +- .../src/mode-haxe-uncompressed-noconflict.js | 6 +- build/src/mode-haxe-uncompressed.js | 6 +- .../src/mode-html-uncompressed-noconflict.js | 17 +- build/src/mode-html-uncompressed.js | 17 +- .../src/mode-java-uncompressed-noconflict.js | 6 +- build/src/mode-java-uncompressed.js | 6 +- ...mode-javascript-uncompressed-noconflict.js | 6 +- build/src/mode-javascript-uncompressed.js | 6 +- .../src/mode-json-uncompressed-noconflict.js | 9 +- build/src/mode-json-uncompressed.js | 9 +- .../src/mode-less-uncompressed-noconflict.js | 3 +- build/src/mode-less-uncompressed.js | 3 +- build/src/mode-lua-uncompressed-noconflict.js | 16 +- build/src/mode-lua-uncompressed.js | 16 +- .../mode-markdown-uncompressed-noconflict.js | 23 +- build/src/mode-markdown-uncompressed.js | 23 +- .../src/mode-perl-uncompressed-noconflict.js | 3 +- build/src/mode-perl-uncompressed.js | 3 +- build/src/mode-php-uncompressed-noconflict.js | 6 +- build/src/mode-php-uncompressed.js | 6 +- ...mode-powershell-uncompressed-noconflict.js | 6 +- build/src/mode-powershell-uncompressed.js | 6 +- .../mode-python-uncompressed-noconflict.js | 3 +- build/src/mode-python-uncompressed.js | 3 +- .../src/mode-scad-uncompressed-noconflict.js | 6 +- build/src/mode-scad-uncompressed.js | 6 +- .../src/mode-scala-uncompressed-noconflict.js | 6 +- build/src/mode-scala-uncompressed.js | 6 +- .../src/mode-scss-uncompressed-noconflict.js | 3 +- build/src/mode-scss-uncompressed.js | 3 +- build/src/mode-svg-uncompressed-noconflict.js | 14 +- build/src/mode-svg-uncompressed.js | 14 +- build/src/mode-xml-uncompressed-noconflict.js | 9 +- build/src/mode-xml-uncompressed.js | 9 +- .../mode-xquery-uncompressed-noconflict.js | 2 +- build/src/mode-xquery-uncompressed.js | 2 +- build/src/theme-monokai-noconflict.js | 2 +- .../theme-monokai-uncompressed-noconflict.js | 9 +- build/src/theme-monokai-uncompressed.js | 9 +- build/src/theme-monokai.js | 2 +- build/src/theme-solarized_dark-noconflict.js | 2 +- ...-solarized_dark-uncompressed-noconflict.js | 7 +- .../src/theme-solarized_dark-uncompressed.js | 7 +- build/src/theme-solarized_dark.js | 2 +- .../theme-tomorrow_night_blue-noconflict.js | 2 +- ...rrow_night_blue-uncompressed-noconflict.js | 9 +- .../theme-tomorrow_night_blue-uncompressed.js | 9 +- build/src/theme-tomorrow_night_blue.js | 2 +- build/src/worker-coffee.js | 190 +- build/src/worker-css.js | 184 +- build/src/worker-javascript.js | 198 +- build/src/worker-json.js | 186 +- build/textarea/images/logo_half.png | Bin 0 -> 19990 bytes build/textarea/src/ace-bookmarklet.js | 1844 +++++++++------- build/textarea/src/mode-c_cpp.js | 6 +- build/textarea/src/mode-coffee.js | 6 +- build/textarea/src/mode-coldfusion.js | 12 +- build/textarea/src/mode-csharp.js | 6 +- build/textarea/src/mode-css.js | 3 +- build/textarea/src/mode-groovy.js | 6 +- build/textarea/src/mode-haxe.js | 6 +- build/textarea/src/mode-html.js | 17 +- build/textarea/src/mode-java.js | 6 +- build/textarea/src/mode-javascript.js | 6 +- build/textarea/src/mode-json.js | 9 +- build/textarea/src/mode-less.js | 3 +- build/textarea/src/mode-lua.js | 16 +- build/textarea/src/mode-markdown.js | 23 +- build/textarea/src/mode-perl.js | 3 +- build/textarea/src/mode-php.js | 6 +- build/textarea/src/mode-powershell.js | 6 +- build/textarea/src/mode-python.js | 3 +- build/textarea/src/mode-scad.js | 6 +- build/textarea/src/mode-scala.js | 6 +- build/textarea/src/mode-scss.js | 3 +- build/textarea/src/mode-svg.js | 14 +- build/textarea/src/mode-xml.js | 9 +- build/textarea/src/mode-xquery.js | 2 +- build/textarea/src/theme-monokai.js | 9 +- build/textarea/src/theme-solarized_dark.js | 7 +- .../textarea/src/theme-tomorrow_night_blue.js | 9 +- build/textarea/style.css | 2 + 132 files changed, 5657 insertions(+), 4130 deletions(-) create mode 100644 build/textarea/images/logo_half.png diff --git a/build/demo/kitchen-sink/kitchen-sink-uncompressed.js b/build/demo/kitchen-sink/kitchen-sink-uncompressed.js index 976b4736..63e2497a 100644 --- a/build/demo/kitchen-sink/kitchen-sink-uncompressed.js +++ b/build/demo/kitchen-sink/kitchen-sink-uncompressed.js @@ -507,7 +507,7 @@ split.on("focus", function(editor) { }); env.split = split; window.env = env; -window.ace = env.editor; +window.editor = window.ace = env.editor; var docEl = document.getElementById("doc"); var modeEl = document.getElementById("mode"); @@ -521,7 +521,6 @@ var showGutterEl = document.getElementById("show_gutter"); var showPrintMarginEl = document.getElementById("show_print_margin"); var highlightSelectedWordE = document.getElementById("highlight_selected_word"); var showHScrollEl = document.getElementById("show_hscroll"); -var animateScrollEl = document.getElementById("animate_scroll"); var softTabEl = document.getElementById("soft_tab"); var behavioursEl = document.getElementById("enable_behaviours"); @@ -578,7 +577,6 @@ function updateUIEditorOptions() { saveOption(showPrintMarginEl, editor.renderer.getShowPrintMargin()); saveOption(highlightSelectedWordE, editor.getHighlightSelectedWord()); saveOption(showHScrollEl, editor.renderer.getHScrollBarAlwaysVisible()); - saveOption(animateScrollEl, editor.getAnimatedScroll()); saveOption(softTabEl, session.getUseSoftTabs()); saveOption(behavioursEl, editor.getBehavioursEnabled()); } @@ -601,10 +599,28 @@ function saveOption(el, val) { } } +event.addListener(themeEl, "mouseover", function(e){ + this.desiredValue = e.target.value; + if (!this.$timer) + this.$timer = setTimeout(this.updateTheme); +}) + +event.addListener(themeEl, "mouseout", function(e){ + this.desiredValue = null; + if (!this.$timer) + this.$timer = setTimeout(this.updateTheme, 20); +}) + +themeEl.updateTheme = function(){ + env.split.setTheme(themeEl.desiredValue || themeEl.selectedValue); + themeEl.$timer = null; +} + bindDropdown("theme", function(value) { if (!value) return; env.editor.setTheme(value); + themeEl.selectedValue = value; }); bindDropdown("keybinding", function(value) { @@ -674,10 +690,6 @@ bindCheckbox("show_hscroll", function(checked) { env.editor.renderer.setHScrollBarAlwaysVisible(checked); }); -bindCheckbox("animate_scroll", function(checked) { - env.editor.setAnimatedScroll(checked); -}); - bindCheckbox("soft_tab", function(checked) { env.editor.getSession().setUseSoftTabs(checked); }); @@ -686,6 +698,9 @@ bindCheckbox("enable_behaviours", function(checked) { env.editor.setBehavioursEnabled(checked); }); +bindCheckbox("fade_fold_widgets", function(checked) { + env.editor.setFadeFoldWidgets(checked); +}); var secondSession = null; bindDropdown("split", function(value) { @@ -847,7 +862,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -2015,7 +2031,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -2142,7 +2159,8 @@ function deHyphenate(str) { return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); }); } -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2744,7 +2762,8 @@ exports.keyCodeToString = function(keyCode) { return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); } -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -3305,8 +3324,8 @@ exports.cssText = ".ace-tm .ace_editor {\ }\ \ .ace-tm .ace_line .ace_invalid {\ - background-color: rgb(153, 0, 0);\ - color: white;\ + background-color: rgba(255, 0, 0, 0.1);\ + color: red;\ }\ \ .ace-tm .ace_line .ace_support.ace_function {\ @@ -3393,6 +3412,9 @@ exports.cssText = ".ace-tm .ace_editor {\ .ace-tm .ace_marker-layer .ace_active_line {\ background: rgba(0, 0, 0, 0.07);\ }\ +.ace-tm .ace_gutter_active_line{\ + background-color : #dcdcdc;\ +}\ \ .ace-tm .ace_marker-layer .ace_selected_word {\ background: rgb(250, 250, 255);\ @@ -3505,10 +3527,7 @@ var EditSession = function(text, mode) { } this.selection = new Selection(this); - if (mode) - this.setMode(mode); - else - this.setMode(new TextMode()); + this.setMode(mode); }; @@ -3569,21 +3588,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession@onChangeFold(e) - * + * EditSession@onChangeFold(e) + * * Emitted when a code fold changes its state. * - **/ + **/ this.onChangeFold = function(e) { var fold = e.data; this.$resetRowCache(fold.start.row); }; /** - * EditSession@onChange(e) - * - * Emitted when the document changes. - **/ + * EditSession@onChange(e) + * + * Emitted when the document changes. + **/ this.onChange = function(e) { var delta = e.data; this.$modified = true; @@ -3608,12 +3627,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setValue(text) - * - text (String): The new text to place + * EditSession.setValue(text) + * - text (String): The new text to place * * Sets the session text. - * - **/ + * + **/ this.setValue = function(text) { this.doc.setValue(text); this.selection.moveCursorTo(0, 0); @@ -3644,16 +3663,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getSelection() -> String - * - * Returns the string of the current selection. - **/ + * EditSession.getSelection() -> String + * + * Returns the string of the current selection. + **/ this.getSelection = function() { return this.selection; }; /** related to: BackgroundTokenizer.getState - * EditSession.getState(row) -> Array + * EditSession.getState(row) -> Array * - row (Number): The row to start at * * {:BackgroundTokenizer.getState} @@ -3664,7 +3683,7 @@ var EditSession = function(text, mode) { }; /** related to: BackgroundTokenizer.getTokens - * EditSession.getTokens(firstRow, lastRow) -> Array + * EditSession.getTokens(firstRow, lastRow) -> Array * - firstRow (Number): The row to start at * - lastRow (Number): The row to finish at * @@ -3676,12 +3695,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTokenAt(row, column) -> Array - * - row (Number): The row number to retrieve from + * EditSession.getTokenAt(row, column) -> Array + * - row (Number): The row number to retrieve from * - column (Number): The column number to retrieve from * - * Returns an array of tokens at the indicated row and column. - **/ + * Returns an array of tokens at the indicated row and column. + **/ this.getTokenAt = function(row, column) { var tokens = this.bgTokenizer.getTokens(row, row)[0].tokens; var token, c = 0; @@ -3704,11 +3723,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoManager(undoManager) - * - undoManager (UndoManager): The new undo manager - * + * EditSession.setUndoManager(undoManager) + * - undoManager (UndoManager): The new undo manager + * * Sets the undo manager. - **/ + **/ this.setUndoManager = function(undoManager) { this.$undoManager = undoManager; this.$resetRowCache(0); @@ -3722,10 +3741,10 @@ var EditSession = function(text, mode) { if (undoManager) { var self = this; /** internal, hide - * EditSession.$syncInformUndoManager() - * - * - **/ + * EditSession.$syncInformUndoManager() + * + * + **/ this.$syncInformUndoManager = function() { self.$informUndoManager.cancel(); @@ -3766,19 +3785,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUndoManager() -> UndoManager - * - * Returns the current undo manager. - **/ + * EditSession.getUndoManager() -> UndoManager + * + * Returns the current undo manager. + **/ this.getUndoManager = function() { return this.$undoManager || this.$defaultUndoManager; }, /** - * EditSession.getTabString() -> String - * - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - **/ + * EditSession.getTabString() -> String + * + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + **/ this.getTabString = function() { if (this.getUseSoftTabs()) { return lang.stringRepeat(" ", this.getTabSize()); @@ -3789,12 +3808,12 @@ var EditSession = function(text, mode) { this.$useSoftTabs = true; /** - * EditSession.setUseSoftTabs(useSoftTabs) - * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs - * + * EditSession.setUseSoftTabs(useSoftTabs) + * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs + * * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). * - **/ + **/ this.setUseSoftTabs = function(useSoftTabs) { if (this.$useSoftTabs === useSoftTabs) return; @@ -3802,22 +3821,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseSoftTabs() -> Boolean - * - * Returns `true` if soft tabs are being used, `false` otherwise. + * EditSession.getUseSoftTabs() -> Boolean + * + * Returns `true` if soft tabs are being used, `false` otherwise. * - **/ + **/ this.getUseSoftTabs = function() { return this.$useSoftTabs; }; this.$tabSize = 4; /** - * EditSession.setTabSize(tabSize) - * - tabSize (Number): The new tab size - * + * EditSession.setTabSize(tabSize) + * - tabSize (Number): The new tab size + * * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - **/ + **/ this.setTabSize = function(tabSize) { if (isNaN(tabSize) || this.$tabSize === tabSize) return; @@ -3827,32 +3846,32 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTabSize() -> Number - * - * Returns the current tab size. - **/ + * EditSession.getTabSize() -> Number + * + * Returns the current tab size. + **/ this.getTabSize = function() { return this.$tabSize; }; /** - * EditSession.isTabStop(position) -> Boolean - * - position (Object): The position to check - * + * EditSession.isTabStop(position) -> Boolean + * - position (Object): The position to check + * * Returns `true` if the character at the position is a soft tab. - **/ + **/ this.isTabStop = function(position) { return this.$useSoftTabs && (position.column % this.$tabSize == 0); }; this.$overwrite = false; /** - * EditSession.setOverwrite(overwrite) - * - overwrite (Boolean): Defines wheter or not to set overwrites - * + * EditSession.setOverwrite(overwrite) + * - overwrite (Boolean): Defines wheter or not to set overwrites + * * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * - **/ + **/ this.setOverwrite = function(overwrite) { if (this.$overwrite == overwrite) return; @@ -3861,39 +3880,39 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getOverwrite() -> Boolean - * - * Returns `true` if overwrites are enabled; `false` otherwise. - **/ + * EditSession.getOverwrite() -> Boolean + * + * Returns `true` if overwrites are enabled; `false` otherwise. + **/ this.getOverwrite = function() { return this.$overwrite; }; /** - * EditSession.toggleOverwrite() - * - * Sets the value of overwrite to the opposite of whatever it currently is. - **/ + * EditSession.toggleOverwrite() + * + * Sets the value of overwrite to the opposite of whatever it currently is. + **/ this.toggleOverwrite = function() { this.setOverwrite(!this.$overwrite); }; /** - * EditSession.getBreakpoints() -> Array - * - * Returns an array of numbers, indicating which rows have breakpoints. - **/ + * EditSession.getBreakpoints() -> Array + * + * Returns an array of numbers, indicating which rows have breakpoints. + **/ this.getBreakpoints = function() { return this.$breakpoints; }; /** - * EditSession.setBreakpoints(rows) - * - rows (Array): An array of row indicies - * + * EditSession.setBreakpoints(rows) + * - rows (Array): An array of row indicies + * * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * - **/ + **/ this.setBreakpoints = function(rows) { this.$breakpoints = []; for (var i=0; i Number - * - range (Range): Define the range of the marker + * EditSession.addMarker(range, clazz, type = "line", inFront) -> Number + * - range (Range): Define the range of the marker * - clazz (String): Set the CSS class for the marker * - type (Function | String): Identify the type of the marker * - inFront (Boolean): Set to `true` to establish a front marker * - * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. + * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. * - **/ + **/ this.addMarker = function(range, clazz, type, inFront) { var id = this.$markerId++; @@ -3967,12 +3986,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.removeMarker(markerId) - * - markerId (Number): A number representing a marker + * EditSession.removeMarker(markerId) + * - markerId (Number): A number representing a marker * * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. - * - **/ + * + **/ this.removeMarker = function(markerId) { var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId]; if (!marker) @@ -3986,12 +4005,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMarkers(inFront) -> Array - * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers + * EditSession.getMarkers(inFront) -> Array + * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers * * Returns an array containing the IDs of all the markers, either front or back. - * - **/ + * + **/ this.getMarkers = function(inFront) { return inFront ? this.$frontMarkers : this.$backMarkers; }; @@ -4006,11 +4025,11 @@ var EditSession = function(text, mode) { * } */ /** - * EditSession.setAnnotations(annotations) - * - annotations (Array): A list of annotations + * EditSession.setAnnotations(annotations) + * - annotations (Array): A list of annotations * - * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - **/ + * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. + **/ this.setAnnotations = function(annotations) { this.$annotations = {}; for (var i=0; i Object - * - * Returns the annotations for the `EditSession`. - **/ + * EditSession.getAnnotations() -> Object + * + * Returns the annotations for the `EditSession`. + **/ this.getAnnotations = function() { return this.$annotations || {}; }; /** - * EditSession.clearAnnotations() - * - * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. - **/ + * EditSession.clearAnnotations() + * + * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. + **/ this.clearAnnotations = function() { this.$annotations = {}; this._emit("changeAnnotation", {}); }; /** internal, hide - * EditSession.$detectNewLine(text) - * - text (String): A block of text - * + * EditSession.$detectNewLine(text) + * - text (String): A block of text + * * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. * - **/ + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r?\n)/m); if (match) { @@ -4060,13 +4079,13 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWordRange(row, column) -> Range - * - row (Number): The row to start at + * EditSession.getWordRange(row, column) -> Range + * - row (Number): The row to start at * - column (Number): The column to start at * - * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. * - **/ + **/ this.getWordRange = function(row, column) { var line = this.getLine(row); @@ -4099,12 +4118,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getAWordRange(row, column) -> Range - * - row (Number): The row number to start from + * EditSession.getAWordRange(row, column) -> Range + * - row (Number): The row number to start from * - column (Number): The column number to start from - * + * * Gets the range of a word, including its right whitespace. - **/ + **/ this.getAWordRange = function(row, column) { var wordRange = this.getWordRange(row, column); var line = this.getLine(wordRange.end.row); @@ -4116,20 +4135,20 @@ var EditSession = function(text, mode) { }; /** related to: Document.setNewLineMode - * EditSession.setNewLineMode(newLineMode) - * - newLineMode (String): {:Document.setNewLineMode.param} + * EditSession.setNewLineMode(newLineMode) + * - newLineMode (String): {:Document.setNewLineMode.param} * - * {:Document.setNewLineMode.desc} - **/ + * {:Document.setNewLineMode.desc} + **/ this.setNewLineMode = function(newLineMode) { this.doc.setNewLineMode(newLineMode); }; /** related to: Document.getNewLineMode - * EditSession.getNewLineMode() -> String - * - * Returns the current new line mode. - **/ + * EditSession.getNewLineMode() -> String + * + * Returns the current new line mode. + **/ this.getNewLineMode = function() { return this.doc.getNewLineMode(); }; @@ -4137,12 +4156,12 @@ var EditSession = function(text, mode) { this.$useWorker = true; /** - * EditSession.setUseWorker(useWorker) - * - useWorker (Boolean): Set to `true` to use a worker - * + * EditSession.setUseWorker(useWorker) + * - useWorker (Boolean): Set to `true` to use a worker + * * Identifies if you want to use a worker for the `EditSession`. * - **/ + **/ this.setUseWorker = function(useWorker) { if (this.$useWorker == useWorker) return; @@ -4155,19 +4174,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWorker() -> Boolean - * - * Returns `true` if workers are being used. - **/ + * EditSession.getUseWorker() -> Boolean + * + * Returns `true` if workers are being used. + **/ this.getUseWorker = function() { return this.$useWorker; }; /** - * EditSession@onReloadTokenizer(e) - * - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ + * EditSession@onReloadTokenizer(e) + * + * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + **/ this.onReloadTokenizer = function(e) { var rows = e.data; this.bgTokenizer.start(rows.first); @@ -4178,7 +4197,7 @@ var EditSession = function(text, mode) { this._loadMode = function(mode, callback) { if (this.$modes[mode]) return callback(this.$modes[mode]); - + var _self = this; var module; try { @@ -4186,16 +4205,17 @@ var EditSession = function(text, mode) { } catch (e) {}; if (module) return done(module); - + fetch(function() { require([mode], done); }); - + function done(module) { if (_self.$modes[mode]) return callback(_self.$modes[mode]); - + _self.$modes[mode] = new module.Mode(); + _self.$modes[mode].$id = mode; _self._emit("loadmode", { name: mode, mode: _self.$modes[mode] @@ -4206,40 +4226,48 @@ var EditSession = function(text, mode) { function fetch(callback) { if (!config.get("packaged")) return callback(); - + var base = mode.split("/").pop(); var filename = config.get("modePath") + "/mode-" + base + config.get("suffix"); net.loadScript(filename, callback); } }; + /** + * EditSession.setMode(mode) + * - mode (TextMode): Set a new text mode + * + * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. + * + **/ this.$mode = null; - this.$origMode = null; - /** - * EditSession.setMode(mode) - * - mode (TextMode): Set a new text mode - * - * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * - **/ + this.$modeId = null; this.setMode = function(mode) { - this.$origMode = mode; - // load on demand if (typeof mode === "string") { + if (this.$modeId == mode) + return; + + this.$modeId = mode; var _self = this; this._loadMode(mode, function(module) { - if (_self.$origMode !== mode) + if (_self.$modeId !== mode) return; - + _self.setMode(module); }); return; + } else if (mode == null) { + mode = "ace/mode/text" + this.$modeId = mode; + this.$modes[mode] = this.$modes[mode] || (new TextMode()); + this.setMode(this.$modes[mode]); + return; } - + if (this.$mode === mode) return; this.$mode = mode; - + this.$modeId = mode.$id; this.$stopWorker(); @@ -4306,21 +4334,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMode() -> TextMode - * - * Returns the current text mode. - **/ + * EditSession.getMode() -> TextMode + * + * Returns the current text mode. + **/ this.getMode = function() { return this.$mode; }; - + this.$scrollTop = 0; /** - * EditSession.setScrollTop(scrollTop) - * - scrollTop (Number): The new scroll top value + * EditSession.setScrollTop(scrollTop) + * - scrollTop (Number): The new scroll top value * - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - **/ + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. + **/ this.setScrollTop = function(scrollTop) { scrollTop = Math.round(Math.max(0, scrollTop)); if (this.$scrollTop === scrollTop) @@ -4331,20 +4359,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollTop() -> Number - * - * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - **/ + * EditSession.getScrollTop() -> Number + * + * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} + **/ this.getScrollTop = function() { return this.$scrollTop; }; - + this.$scrollLeft = 0; /** - * EditSession.setScrollLeft(scrollLeft) - * - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - **/ + * EditSession.setScrollLeft(scrollLeft) + * + * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + **/ this.setScrollLeft = function(scrollLeft) { scrollLeft = Math.round(Math.max(0, scrollLeft)); if (this.$scrollLeft === scrollLeft) @@ -4355,29 +4383,29 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollLeft() -> Number - * - * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - **/ + * EditSession.getScrollLeft() -> Number + * + * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} + **/ this.getScrollLeft = function() { return this.$scrollLeft; }; /** - * EditSession.getWidth() -> Number - * - * Returns the width of the document. - **/ + * EditSession.getWidth() -> Number + * + * Returns the width of the document. + **/ this.getWidth = function() { this.$computeWidth(); return this.width; }; /** - * EditSession.getScreenWidth() -> Number - * - * Returns the width of the screen. - **/ + * EditSession.getScreenWidth() -> Number + * + * Returns the width of the screen. + **/ this.getScreenWidth = function() { this.$computeWidth(); return this.screenWidth; @@ -4423,18 +4451,18 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLine - * EditSession.getLine(row) -> String - * - row (Number): The row to retrieve from - * + * EditSession.getLine(row) -> String + * - row (Number): The row to retrieve from + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.doc.getLine(row); }; /** related to: Document.getLines - * EditSession.getLines(firstRow, lastRow) -> Array + * EditSession.getLines(firstRow, lastRow) -> Array * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve * @@ -4446,7 +4474,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLength - * EditSession.getLength()-> Number + * EditSession.getLength()-> Number * * Returns the number of rows in the document. **/ @@ -4455,7 +4483,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getTextRange - * EditSession.getTextRange(range) -> Array + * EditSession.getTextRange(range) -> Array * - range (String): The range to work with * * {:Document.getTextRange.desc} @@ -4465,7 +4493,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insert - * EditSession.insert(position, text) -> Number + * EditSession.insert(position, text) -> Number * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. @@ -4479,7 +4507,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.remove - * EditSession.remove(range) -> Object + * EditSession.remove(range) -> Object * - range (Range): A specified Range to remove * + (Object): The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * @@ -4492,12 +4520,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.undoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.undoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): [If `true`, doesn't select the range of where the change occured]{: #dontSelect} * - * Reverts previous changes to your document. - **/ + * Reverts previous changes to your document. + **/ this.undoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -4525,12 +4553,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.redoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.redoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): {:dontSelect} * - * Re-implements a previously undone change to your document. - **/ + * Re-implements a previously undone change to your document. + **/ this.redoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -4554,20 +4582,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoSelect(enable) - * - enable (Boolean): If `true`, selects the range of the reinserted change + * EditSession.setUndoSelect(enable) + * - enable (Boolean): If `true`, selects the range of the reinserted change * - * ENables or disables highlighting of the range where an undo occured. - **/ + * ENables or disables highlighting of the range where an undo occured. + **/ this.setUndoSelect = function(enable) { this.$undoSelect = enable; }; /** internal, hide - * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range - * - * - **/ + * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range + * + * + **/ this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { function isInsert(delta) { var insert = @@ -4623,7 +4651,7 @@ var EditSession = function(text, mode) { }, /** related to: Document.replace - * EditSession.replace(range, text) -> Object + * EditSession.replace(range, text) -> Object * - range (Range): A specified Range to replace * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this:
@@ -4641,17 +4669,17 @@ var EditSession = function(text, mode) { }; /** - * EditSession.moveText(fromRange, toPosition) -> Range - * - fromRange (Range): The range of text you want moved within the document + * EditSession.moveText(fromRange, toPosition) -> Range + * - fromRange (Range): The range of text you want moved within the document * - toPosition (Object): The location (row and column) where you want to move the text to * + (Range): The new range where the text was moved to. * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: * * { row: newRowLocation, column: newColumnLocation } - * + * * * - **/ + **/ this.moveText = function(fromRange, toPosition) { var text = this.getTextRange(fromRange); this.remove(fromRange); @@ -4683,16 +4711,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.indentRows(startRow, endRow, indentString) - * - startRow (Number): Starting row + * EditSession.indentRows(startRow, endRow, indentString) + * - startRow (Number): Starting row * - endRow (Number): Ending row * - indentString (String): The indent token * - * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. + * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. * * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. * - **/ + **/ this.indentRows = function(startRow, endRow, indentString) { indentString = indentString.replace(/\t/g, this.getTabString()); for (var row=startRow; row<=endRow; row++) @@ -4731,15 +4759,15 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesUp(firstRow, lastRow) -> Number - * - firstRow (Number): The starting row to move up + * EditSession.moveLinesUp(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to move up * - lastRow (Number): The final row to move up - * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. * * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. * * - **/ + **/ this.moveLinesUp = function(firstRow, lastRow) { if (firstRow <= 0) return 0; @@ -4749,7 +4777,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesDown(firstRow, lastRow) -> Number + * EditSession.moveLinesDown(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to move down * - lastRow (Number): The final row to move down * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. @@ -4766,16 +4794,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.duplicateLines(firstRow, lastRow) -> Number + * EditSession.duplicateLines(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to duplicate * - lastRow (Number): The final row to duplicate - * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. * * Duplicates all the text between `firstRow` and `lastRow`. * * * - **/ + **/ this.duplicateLines = function(firstRow, lastRow) { var firstRow = this.$clipRowToDocument(firstRow); var lastRow = this.$clipRowToDocument(lastRow); @@ -4831,7 +4859,7 @@ var EditSession = function(text, mode) { range.start.column ); } - + var len = this.doc.getLength() - 1; if (range.end.row > len) { range.end.row = len; @@ -4854,11 +4882,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUseWrapMode(useWrapMode) - * - useWrapMode (Boolean): Enable (or disable) wrap mode + * EditSession.setUseWrapMode(useWrapMode) + * - useWrapMode (Boolean): Enable (or disable) wrap mode * - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - **/ + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. + **/ this.setUseWrapMode = function(useWrapMode) { if (useWrapMode != this.$useWrapMode) { this.$useWrapMode = useWrapMode; @@ -4880,10 +4908,10 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWrapMode() -> Boolean - * - * Returns `true` if wrap mode is being used; `false` otherwise. - **/ + * EditSession.getUseWrapMode() -> Boolean + * + * Returns `true` if wrap mode is being used; `false` otherwise. + **/ this.getUseWrapMode = function() { return this.$useWrapMode; }; @@ -4893,12 +4921,12 @@ var EditSession = function(text, mode) { // in that direction. Or set both parameters to the same number to pin // the limit to that value. /** - * EditSession.setWrapLimitRange(min, max) - * - min (Number): The minimum wrap value (the left side wrap) + * EditSession.setWrapLimitRange(min, max) + * - min (Number): The minimum wrap value (the left side wrap) * - max (Number): The maximum wrap value (the right side wrap) * - * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. - **/ + * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. + **/ this.setWrapLimitRange = function(min, max) { if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { this.$wrapLimitRange.min = min; @@ -4910,11 +4938,11 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.adjustWrapLimit(desiredLimit) -> Boolean - * - desiredLimit (Number): The new wrap limit + * EditSession.adjustWrapLimit(desiredLimit) -> Boolean + * - desiredLimit (Number): The new wrap limit * - * This should generally only be called by the renderer when a resize is detected. - **/ + * This should generally only be called by the renderer when a resize is detected. + **/ this.adjustWrapLimit = function(desiredLimit) { var wrapLimit = this.$constrainWrapLimit(desiredLimit); if (wrapLimit != this.$wrapLimit && wrapLimit > 0) { @@ -4949,22 +4977,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWrapLimit() -> Number - * - * Returns the value of wrap limit. - **/ + * EditSession.getWrapLimit() -> Number + * + * Returns the value of wrap limit. + **/ this.getWrapLimit = function() { return this.$wrapLimit; }; /** - * EditSession.getWrapLimitRange() -> Object - * - * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: + * EditSession.getWrapLimitRange() -> Object + * + * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: * * { min: wrapLimitRange_min, max: wrapLimitRange_max } * - **/ + **/ this.getWrapLimitRange = function() { // Avoid unexpected mutation by returning a copy return { @@ -5317,10 +5345,10 @@ var EditSession = function(text, mode) { } /** internal, hide - * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] - * - str (String): The string to calculate the screen width of + * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] + * - str (String): The string to calculate the screen width of * - maxScreenColumn (Number): - * - screenColumn (Number): + * - screenColumn (Number): * + ([Number]): Returns an `int[]` array with two elements:
* The first position indicates the number of columns for `str` on screen.
* The second value contains the position of the document column that this function read until. @@ -5328,7 +5356,7 @@ var EditSession = function(text, mode) { * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. * * - **/ + **/ this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { if (maxScreenColumn == 0) { return [0, 0]; @@ -5361,12 +5389,12 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowLength(row) -> Number - * - row (Number): The row number to check + * EditSession.getRowLength(row) -> Number + * - row (Number): The row number to check * * - * Returns the length of the indicated row. - **/ + * Returns the length of the indicated row. + **/ this.getRowLength = function(row) { if (!this.$useWrapMode || !this.$wrapData[row]) { return 1; @@ -5376,8 +5404,8 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowHeight(config, row) -> Number - * - config (Object): An object containing a parameter indicating the `lineHeight`. + * EditSession.getRowHeight(config, row) -> Number + * - config (Object): An object containing a parameter indicating the `lineHeight`. * - row (Number): The row number to check * * Returns the height of the indicated row. This is mostly relevant for situations where wrapping occurs, and a single line spans across multiple rows. @@ -5388,40 +5416,40 @@ var EditSession = function(text, mode) { } /** internal, hide, related to: EditSession.documentToScreenColumn - * EditSession.getScreenLastRowColumn(screenRow) -> Number - * - screenRow (Number): The screen row to check + * EditSession.getScreenLastRowColumn(screenRow) -> Number + * - screenRow (Number): The screen row to check * - * Returns the column position (on screen) for the last character in the provided row. - **/ + * Returns the column position (on screen) for the last character in the provided row. + **/ this.getScreenLastRowColumn = function(screenRow) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE) return this.documentToScreenColumn(pos.row, pos.column); }; /** internal, hide - * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number - * - docRow (Number): + * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number + * - docRow (Number): * - docColumn (Number): * - **/ + **/ this.getDocumentLastRowColumn = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.getScreenLastRowColumn(screenRow); }; /** internal, hide - * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number - * - **/ + * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number + * + **/ this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); }; /** internal, hide - * EditSession.getRowSplitData(row) -> undefined | String + * EditSession.getRowSplitData(row) -> undefined | String * - **/ + **/ this.getRowSplitData = function(row) { if (!this.$useWrapMode) { return undefined; @@ -5431,41 +5459,41 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScreenTabSize(screenColumn) -> Number + * EditSession.getScreenTabSize(screenColumn) -> Number * - screenColumn (Number): The screen column to check - * - * The distance to the next tab stop at the specified screen column. - **/ + * + * The distance to the next tab stop at the specified screen column. + **/ this.getScreenTabSize = function(screenColumn) { return this.$tabSize - screenColumn % this.$tabSize; }; /** internal, hide - * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentRow = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).row; }; /** internal, hide - * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentColumn = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).column; }; /** related to: EditSession.documentToScreenPosition - * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object - * - screenRow (Number): The screen row to check + * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object + * - screenRow (Number): The screen row to check * - screenColumn (Number): The screen column to check - * + (Object): The object returned has two properties: `row` and `column`. + * + (Object): The object returned has two properties: `row` and `column`. * * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * + * * **/ this.screenToDocumentPosition = function(screenRow, screenColumn) { @@ -5564,12 +5592,12 @@ var EditSession = function(text, mode) { }; /** related to: EditSession.screenToDocumentPosition - * EditSession.documentToScreenPosition(docRow, docColumn) -> Object - * - docRow (Number): The document row to check + * EditSession.documentToScreenPosition(docRow, docColumn) -> Object + * - docRow (Number): The document row to check * - docColumn (Number): The document column to check * + (Object): The object returned by this method has two properties: `row` and `column`. * - * Converts document coordinates to screen coordinates. {:conversionConsiderations} + * Converts document coordinates to screen coordinates. {:conversionConsiderations} * * * @@ -5678,28 +5706,28 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.documentToScreenColumn(row, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenColumn(row, docColumn) -> Number + * + * + **/ this.documentToScreenColumn = function(row, docColumn) { return this.documentToScreenPosition(row, docColumn).column; }; /** internal, hide - * EditSession.documentToScreenRow(docRow, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenRow(docRow, docColumn) -> Number + * + * + **/ this.documentToScreenRow = function(docRow, docColumn) { return this.documentToScreenPosition(docRow, docColumn).row; }; /** - * EditSession.getScreenLength() -> Number - * - * Returns the length of the screen. - **/ + * EditSession.getScreenLength() -> Number + * + * Returns the length of the screen. + **/ this.getScreenLength = function() { var screenRows = 0; var fold = null; @@ -5839,7 +5867,8 @@ exports.loadScript = function(path, callback) { s.onload = callback; }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -5916,7 +5945,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -5959,7 +5988,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -6048,10 +6078,10 @@ var Selection = function(session) { oop.implement(this, EventEmitter); /** - * Selection.isEmpty() -> Boolean - * - * Returns `true` if the selection is empty. - **/ + * Selection.isEmpty() -> Boolean + * + * Returns `true` if the selection is empty. + **/ this.isEmpty = function() { return (this.$isEmpty || ( this.selectionAnchor.row == this.selectionLead.row && @@ -6060,10 +6090,10 @@ var Selection = function(session) { }; /** - * Selection.isMultiLine() -> Boolean - * - * Returns `true` if the selection is a multi-line. - **/ + * Selection.isMultiLine() -> Boolean + * + * Returns `true` if the selection is a multi-line. + **/ this.isMultiLine = function() { if (this.isEmpty()) { return false; @@ -6073,7 +6103,7 @@ var Selection = function(session) { }; /** - * Selection.getCursor() -> Number + * Selection.getCursor() -> Number * * Gets the current position of the cursor. **/ @@ -6082,12 +6112,12 @@ var Selection = function(session) { }; /** - * Selection.setSelectionAnchor(row, column) - * - row (Number): The new row - * - column (Number): The new column + * Selection.setSelectionAnchor(row, column) + * - row (Number): The new row + * - column (Number): The new column * * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. - **/ + **/ this.setSelectionAnchor = function(row, column) { this.selectionAnchor.setPosition(row, column); @@ -6098,11 +6128,11 @@ var Selection = function(session) { }; /** related to: Anchor.getPosition - * Selection.getSelectionAnchor() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection anchor. + * Selection.getSelectionAnchor() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection anchor. * - **/ + **/ this.getSelectionAnchor = function() { if (this.$isEmpty) return this.getSelectionLead() @@ -6111,21 +6141,21 @@ var Selection = function(session) { }; /** - * Selection.getSelectionLead() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection lead. - **/ + * Selection.getSelectionLead() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection lead. + **/ this.getSelectionLead = function() { return this.selectionLead.getPosition(); }; /** - * Selection.shiftSelection(columns) - * - columns (Number): The number of columns to shift by - * + * Selection.shiftSelection(columns) + * - columns (Number): The number of columns to shift by + * * Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns. * - **/ + **/ this.shiftSelection = function(columns) { if (this.$isEmpty) { this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns); @@ -6148,10 +6178,10 @@ var Selection = function(session) { }; /** - * Selection.isBackwards() -> Boolean - * - * Returns `true` if the selection is going backwards in the document. - **/ + * Selection.isBackwards() -> Boolean + * + * Returns `true` if the selection is going backwards in the document. + **/ this.isBackwards = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -6159,10 +6189,10 @@ var Selection = function(session) { }; /** - * Selection.getRange() -> Range - * - * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} - **/ + * Selection.getRange() -> Range + * + * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} + **/ this.getRange = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -6179,10 +6209,10 @@ var Selection = function(session) { }; /** - * Selection.clearSelection() - * - * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} - **/ + * Selection.clearSelection() + * + * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} + **/ this.clearSelection = function() { if (!this.$isEmpty) { this.$isEmpty = true; @@ -6191,10 +6221,10 @@ var Selection = function(session) { }; /** - * Selection.selectAll() - * - * Selects all the text in the document. - **/ + * Selection.selectAll() + * + * Selects all the text in the document. + **/ this.selectAll = function() { var lastRow = this.doc.getLength() - 1; this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length); @@ -6202,13 +6232,13 @@ var Selection = function(session) { }; /** - * Selection.setSelectionRange(range, reverse) - * - range (Range): The range of text to select - * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not + * Selection.setSelectionRange(range, reverse) + * - range (Range): The range of text to select + * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not * * Sets the selection to the provided range. * - **/ + **/ this.setSelectionRange = function(range, reverse) { if (reverse) { this.setSelectionAnchor(range.end.row, range.end.column); @@ -6229,13 +6259,13 @@ var Selection = function(session) { }; /** - * Selection.selectTo(row, column) - * - row (Number): The row to select to - * - column (Number): The column to select to + * Selection.selectTo(row, column) + * - row (Number): The row to select to + * - column (Number): The column to select to * * Moves the selection cursor to the indicated row and column. * - **/ + **/ this.selectTo = function(row, column) { this.$moveSelection(function() { this.moveCursorTo(row, column); @@ -6243,12 +6273,12 @@ var Selection = function(session) { }; /** - * Selection.selectToPosition(pos) - * - pos (Object): An object containing the row and column - * + * Selection.selectToPosition(pos) + * - pos (Object): An object containing the row and column + * * Moves the selection cursor to the row and column indicated by `pos`. * - **/ + **/ this.selectToPosition = function(pos) { this.$moveSelection(function() { this.moveCursorToPosition(pos); @@ -6256,10 +6286,10 @@ var Selection = function(session) { }; /** - * Selection.selectUp() - * - * Moves the selection up one row. - **/ + * Selection.selectUp() + * + * Moves the selection up one row. + **/ this.selectUp = function() { this.$moveSelection(this.moveCursorUp); }; @@ -6292,10 +6322,10 @@ var Selection = function(session) { }; /** - * Selection.selectLineStart() - * - * Moves the selection to the beginning of the current line. - **/ + * Selection.selectLineStart() + * + * Moves the selection to the beginning of the current line. + **/ this.selectLineStart = function() { this.$moveSelection(this.moveCursorLineStart); }; @@ -6346,34 +6376,36 @@ var Selection = function(session) { }; /** related to: EditSession.getWordRange - * Selection.selectWord() - * - * Moves the selection to highlight the entire word. - **/ + * Selection.selectWord() + * + * Moves the selection to highlight the entire word. + **/ + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.selectionLead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { - var cursor = this.getCursor(); - var range = this.session.getWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); + this.setSelectionRange(this.getWordRange()); }; /** related to: EditSession.getAWordRange - * Selection.selectAWord() - * - * Selects a word, including its right whitespace. - **/ + * Selection.selectAWord() + * + * Selects a word, including its right whitespace. + **/ this.selectAWord = function() { var cursor = this.getCursor(); var range = this.session.getAWordRange(cursor.row, cursor.column); this.setSelectionRange(range); }; - /** - * Selection.selectLine() - * - * Selects the entire line. - **/ - this.selectLine = function() { - var rowStart = this.selectionLead.row; + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.selectionLead.row; var rowEnd; var foldLine = this.session.getFoldLine(rowStart); @@ -6383,35 +6415,44 @@ var Selection = function(session) { } else { rowEnd = rowStart; } - this.setSelectionAnchor(rowStart, 0); - this.$moveSelection(function() { - this.moveCursorTo(rowEnd + 1, 0); - }); + if (excludeLastChar) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + + /** + * Selection.selectLine() + * + * Selects the entire line. + **/ + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); }; /** - * Selection.moveCursorUp() - * - * Moves the cursor up one row. - **/ + * Selection.moveCursorUp() + * + * Moves the cursor up one row. + **/ this.moveCursorUp = function() { this.moveCursorBy(-1, 0); }; /** - * Selection.moveCursorDown() + * Selection.moveCursorDown() * * Moves the cursor down one row. - **/ + **/ this.moveCursorDown = function() { this.moveCursorBy(1, 0); }; /** - * Selection.moveCursorLeft() + * Selection.moveCursorLeft() * * Moves the cursor left one column. - **/ + **/ this.moveCursorLeft = function() { var cursor = this.selectionLead.getPosition(), fold; @@ -6434,7 +6475,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorRight() + * Selection.moveCursorRight() * * Moves the cursor right one column. **/ @@ -6460,7 +6501,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineStart() + * Selection.moveCursorLineStart() * * Moves the cursor to the start of the line. **/ @@ -6493,7 +6534,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineEnd() + * Selection.moveCursorLineEnd() * * Moves the cursor to the end of the line. **/ @@ -6508,7 +6549,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileEnd() + * Selection.moveCursorFileEnd() * * Moves the cursor to the end of the file. **/ @@ -6519,7 +6560,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileStart() + * Selection.moveCursorFileStart() * * Moves the cursor to the start of the file. **/ @@ -6528,11 +6569,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordRight() + * Selection.moveCursorLongWordRight() * * Moves the cursor to the word on the right. **/ - this.moveCursorWordRight = function() { + this.moveCursorLongWordRight = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; var line = this.doc.getLine(row); @@ -6575,11 +6616,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordLeft() + * Selection.moveCursorLongWordLeft() * * Moves the cursor to the word on the left. **/ - this.moveCursorWordLeft = function() { + this.moveCursorLongWordLeft = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; @@ -6625,8 +6666,94 @@ var Selection = function(session) { this.moveCursorTo(row, column); }; + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index <= 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index-- + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) + return this.moveCursorRight(); + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + if (column == 0) + return this.moveCursorLeft(); + + var str = this.session.getLine(row).substring(0, column); + var leftOfCursor = lang.stringReverse(str); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + /** related to: EditSession.documentToScreenPosition - * Selection.moveCursorBy(rows, chars) + * Selection.moveCursorBy(rows, chars) * - rows (Number): The number of rows to move by * - chars (Number): The number of characters to move by * @@ -6652,23 +6779,23 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToPosition(position) - * - position (Object): The position to move to - * + * Selection.moveCursorToPosition(position) + * - position (Object): The position to move to + * * Moves the selection to the position indicated by its `row` and `column`. - **/ + **/ this.moveCursorToPosition = function(position) { this.moveCursorTo(position.row, position.column); }; /** - * Selection.moveCursorTo(row, column, keepDesiredColumn) - * - row (Number): The row to move to - * - column (Number): The column to move to + * Selection.moveCursorTo(row, column, keepDesiredColumn) + * - row (Number): The row to move to + * - column (Number): The column to move to * - keepDesiredColumn (Boolean): [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} * * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} - **/ + **/ this.moveCursorTo = function(row, column, keepDesiredColumn) { // Ensure the row/column is not inside of a fold. var fold = this.session.getFoldAt(row, column, 1); @@ -6686,13 +6813,13 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToScreen(row, column, keepDesiredColumn) + * Selection.moveCursorToScreen(row, column, keepDesiredColumn) * - row (Number): The row to move to * - column (Number): The column to move to * - keepDesiredColumn (Boolean): {:preventUpdateBool} * * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} - **/ + **/ this.moveCursorToScreen = function(row, column, keepDesiredColumn) { var pos = this.session.screenToDocumentPosition(row, column); this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); @@ -7934,7 +8061,8 @@ var Behaviour = function() { }).call(Behaviour.prototype); exports.Behaviour = Behaviour; -});define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { +}); +define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { "use strict"; /* @@ -8040,7 +8168,8 @@ function addUnicodePackage (pack) { exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -8120,11 +8249,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -8132,21 +8261,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -8173,10 +8302,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -8236,82 +8365,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -8322,14 +8450,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -8354,10 +8482,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -8365,7 +8493,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -8385,16 +8513,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -8418,7 +8546,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -8429,7 +8557,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -8455,14 +8583,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -8496,7 +8624,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -8526,15 +8654,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -8550,12 +8678,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -8574,9 +8702,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -8584,7 +8712,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -8606,10 +8734,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -10101,7 +10229,9 @@ function FoldLine(foldData, folds) { && fold.start.column != column && fold.start.row != row) { - throw "Moving characters inside of a fold should never be reached"; + //throwing here breaks whole editor + //@todo properly handle this + window.console && window.console.log(row, column, fold); } else if (fold.start.row == row) { folds = this.folds; var i = folds.indexOf(fold); @@ -10195,7 +10325,8 @@ function FoldLine(foldData, folds) { }).call(FoldLine.prototype); exports.FoldLine = FoldLine; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -10310,7 +10441,8 @@ var Fold = exports.Fold = function(range, placeholder) { }).call(Fold.prototype); -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -11444,6 +11576,18 @@ function HashHandler(config, platform) { } }; + this.bindKey = function(key, command) { + if(!key) + return; + + var ckb = this.commmandKeyBinding; + key.split("|").forEach(function(keyPart) { + var binding = this.parseKeys(keyPart, command); + var hashId = binding.hashId; + (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; + }, this); + }; + this.addCommands = function(commands) { commands && Object.keys(commands).forEach(function(name) { var command = commands[name]; @@ -11466,18 +11610,6 @@ function HashHandler(config, platform) { }, this); }; - this.bindKey = function(key, command) { - if(!key) - return; - - var ckb = this.commmandKeyBinding; - key.split("|").forEach(function(keyPart) { - var binding = parseKeys(keyPart, command); - var hashId = binding.hashId; - (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; - }); - }; - this.bindKeys = function(keyList) { Object.keys(keyList).forEach(function(key) { this.bindKey(key, keyList[key]); @@ -11493,10 +11625,10 @@ function HashHandler(config, platform) { this.bindKey(key, command); }; - function parseKeys(keys, val, ret) { + this.parseKeys = function(keys, val) { var key; var hashId = 0; - var parts = splitSafe(keys.toLowerCase()); + var parts = keys.toLowerCase().trim().split(/\s*\-\s*/); for (var i = 0, l = parts.length; i < l; i++) { if (keyUtil.KEY_MODS[parts[i]]) @@ -11509,17 +11641,12 @@ function HashHandler(config, platform) { key: key, hashId: hashId }; - } - - function splitSafe(s) { - return (s.trim() - .split(new RegExp("[\\s ]*\\-[\\s ]*", "g"), 999)); - } + }; this.findKeyCommand = function findKeyCommand(hashId, keyString) { var ckbr = this.commmandKeyBinding; return ckbr[hashId] && ckbr[hashId][keyString.toLowerCase()]; - } + }; this.handleKeyboard = function(data, hashId, keyString, keyCode) { return { @@ -11530,7 +11657,8 @@ function HashHandler(config, platform) { }).call(HashHandler.prototype) exports.HashHandler = HashHandler; -});define("text!kitchen-sink/docs/plaintext.txt", [], "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.\n" + +}); +define("text!kitchen-sink/docs/plaintext.txt", [], "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.\n" + "\n" + "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.\n" + "\n" + @@ -13238,6 +13366,7 @@ var Editor = function(renderer, session) { this.container = container; this.renderer = renderer; + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); this.textInput = new TextInput(renderer.getTextAreaContainer(), this); this.keyBinding = new KeyBinding(this); @@ -13254,7 +13383,6 @@ var Editor = function(renderer, session) { wrap: true }); - this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); this.setSession(session || new EditSession("")); }; @@ -13618,6 +13746,7 @@ var Editor = function(renderer, session) { this.$highlightBrackets(); this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); }; /** internal, hide @@ -13630,29 +13759,40 @@ var Editor = function(renderer, session) { if (session.$highlightLineMarker) session.removeMarker(session.$highlightLineMarker); + + session.$highlightLineMarker = null; + + if (this.$highlightActiveLine) { + var cursor = this.getCursorPosition(); + var foldLine = this.session.getFoldLine(cursor.row); + + if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { + var range; + if (foldLine) { + range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); + } else { + range = new Range(cursor.row, 0, cursor.row+1, 0); + } + session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); + } + } + }; + + /** internal, hide + * Editor.$updateHighlightGutterLine() + * + * + **/ + this.$updateHighlightGutterLine = function(){ if (typeof this.$lastrow == "number") this.renderer.removeGutterDecoration(this.$lastrow, "ace_gutter_active_line"); - session.$highlightLineMarker = null; this.$lastrow = null; - if (this.getHighlightActiveLine()) { - var cursor = this.getCursorPosition(), - foldLine = this.session.getFoldLine(cursor.row); - - if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { - var range; - if (foldLine) { - range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); - } else { - range = new Range(cursor.row, 0, cursor.row+1, 0); - } - session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); - } - - this.renderer.addGutterDecoration(this.$lastrow = cursor.row, "ace_gutter_active_line"); - } - }; + if (this.$highlightGutterLine) + this.renderer.addGutterDecoration( + this.$lastrow = this.getCursorPosition().row, "ace_gutter_active_line"); + } /** * Editor@onSelectionChange(e) @@ -13674,6 +13814,7 @@ var Editor = function(renderer, session) { session.$selectionMarker = session.addMarker(range, "ace_selection", style); } else { this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); } if (this.$highlightSelectedWord) @@ -13752,6 +13893,7 @@ var Editor = function(renderer, session) { // Update the active line marker as due to folding changes the current // line range on the screen might have changed. this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); // TODO: This might be too much updating. Okay for now. this.renderer.updateFull(); }; @@ -13770,15 +13912,34 @@ var Editor = function(renderer, session) { return text; }; + /** + * Editor.onCopy() + * + * Called whenever a text "copy" happens. + **/ + this.onCopy = function() { + this.commands.exec("copy", this); + }; + /** * Editor.onCut() * - * Emitted whenever a text "cut" happens. + * called whenever a text "cut" happens. **/ this.onCut = function() { this.commands.exec("cut", this); }; + /** + * Editor.onPaste() + * + * called whenever a text "paste" happens. + **/ + this.onPaste = function(text) { + this._emit("paste", text); + this.insert(text); + }; + /** * Editor.insert(text) * - text (String): The new text to add @@ -13884,11 +14045,8 @@ var Editor = function(renderer, session) { * * Emitted when text is entered. **/ - this.onTextInput = function(text, pasted) { - if (pasted) - this._emit("paste", text); - - this.keyBinding.onTextInput(text, pasted); + this.onTextInput = function(text) { + this.keyBinding.onTextInput(text); }; /** @@ -14004,7 +14162,8 @@ var Editor = function(renderer, session) { * **/ this.setHighlightActiveLine = function(shouldHighlight) { - if (this.$highlightActiveLine == shouldHighlight) return; + if (this.$highlightActiveLine == shouldHighlight) + return; this.$highlightActiveLine = shouldHighlight; this.$updateHighlightActiveLine(); @@ -14019,6 +14178,19 @@ var Editor = function(renderer, session) { return this.$highlightActiveLine; }; + this.$highlightGutterLine = true; + this.setHighlightGutterLine = function(shouldHighlightGutterLine) { + if (this.$highlightGutterLine == shouldHighlightGutterLine) + return; + + this.$highlightGutterLine = shouldHighlightGutterLine; + this.$updateHighlightGutterLine(); + }; + + this.getHighlightGutterLine = function() { + return this.$highlightGutterLine; + }; + this.$highlightSelectedWord = true; /** * Editor.setHighlightSelectedWord(shouldHighlight) @@ -14173,6 +14345,14 @@ var Editor = function(renderer, session) { return this.renderer.$gutterLayer.getShowFoldWidgets(); }; + this.setFadeFoldWidgets = function(show) { + this.renderer.setFadeFoldWidgets(show); + }; + + this.getFadeFoldWidgets = function() { + return this.renderer.getFadeFoldWidgets(); + }; + /** * Editor.remove(dir) * - dir (String): The direction of the deletion to occur, either "left" or "right" @@ -14182,7 +14362,7 @@ var Editor = function(renderer, session) { **/ this.remove = function(dir) { if (this.selection.isEmpty()){ - if(dir == "left") + if (dir == "left") this.selection.selectLeft(); else this.selection.selectRight(); @@ -14607,15 +14787,29 @@ var Editor = function(renderer, session) { return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; }; - this.$getPageDownRow = function() { - return this.renderer.getScrollBottomRow(); - }; + this.$moveByPage = function(dir, select) { + var renderer = this.renderer; + var config = this.renderer.layerConfig; + var rows = dir * Math.floor(config.height / config.lineHeight); - this.$getPageUpRow = function() { - var firstRow = this.renderer.getScrollTopRow(); - var lastRow = this.renderer.getScrollBottomRow(); + this.$blockScrolling++; + if (select == true) { + this.selection.$moveSelection(function(){ + this.moveCursorBy(rows, 0); + }); + } else if (select == false) { + this.selection.moveCursorBy(rows, 0); + this.selection.clearSelection(); + } + this.$blockScrolling--; - return firstRow - (lastRow - firstRow); + var scrollTop = renderer.scrollTop; + + renderer.scrollBy(0, rows * config.lineHeight); + if (select != null) + renderer.scrollCursorIntoView(null, 0.5); + + renderer.animateScrolling(scrollTop); }; /** @@ -14624,14 +14818,7 @@ var Editor = function(renderer, session) { * Selects the text from the current position of the document until where a "page down" finishes. **/ this.selectPageDown = function() { - var row = this.$getPageDownRow() + Math.floor(this.$getVisibleRowCount() / 2); - - this.scrollPageDown(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); + this.$moveByPage(1, true); }; /** @@ -14640,15 +14827,7 @@ var Editor = function(renderer, session) { * Selects the text from the current position of the document until where a "page up" finishes. **/ this.selectPageUp = function() { - var visibleRows = this.renderer.getScrollTopRow() - this.renderer.getScrollBottomRow(); - var row = this.$getPageUpRow() + Math.round(visibleRows / 2); - - this.scrollPageUp(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); + this.$moveByPage(-1, true); }; /** @@ -14657,11 +14836,7 @@ var Editor = function(renderer, session) { * Shifts the document to wherever "page down" is, as well as moving the cursor position. **/ this.gotoPageDown = function() { - var row = this.$getPageDownRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); + this.$moveByPage(1, false); }; /** @@ -14670,11 +14845,7 @@ var Editor = function(renderer, session) { * Shifts the document to wherever "page up" is, as well as moving the cursor position. **/ this.gotoPageUp = function() { - var row = this.$getPageUpRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); + this.$moveByPage(-1, false); }; /** @@ -14683,7 +14854,7 @@ var Editor = function(renderer, session) { * Scrolls the document to wherever "page down" is, without changing the cursor position. **/ this.scrollPageDown = function() { - this.scrollToRow(this.$getPageDownRow()); + this.$moveByPage(1); }; /** @@ -14692,7 +14863,7 @@ var Editor = function(renderer, session) { * Scrolls the document to wherever "page up" is, without changing the cursor position. **/ this.scrollPageUp = function() { - this.renderer.scrollToRow(this.$getPageUpRow()); + this.$moveByPage(-1); }; /** related to: VirtualRenderer.scrollToRow @@ -14710,11 +14881,13 @@ var Editor = function(renderer, session) { * Editor.scrollToLine(line, center) * - line (Number): The line to scroll to * - center (Boolean): If `true` + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called when the animation has finished * - * TODO scrollsa to line, if center == true, puts line in middle of screen or attempts to) + * TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to) **/ - this.scrollToLine = function(line, center) { - this.renderer.scrollToLine(line, center); + this.scrollToLine = function(line, center, animate, callback) { + this.renderer.scrollToLine(line, center, animate, callback); }; /** @@ -14832,19 +15005,21 @@ var Editor = function(renderer, session) { * Editor.gotoLine(lineNumber, column) * - lineNumber (Number): The line number to go to * - column (Number): A column number to go to + * - animate (Boolean): If `true` animates scolling * * Moves the cursor to the specified line number, and also into the indiciated column. * **/ - this.gotoLine = function(lineNumber, column) { + this.gotoLine = function(lineNumber, column, animate) { this.selection.clearSelection(); this.session.unfold({row: lineNumber - 1, column: column || 0}); this.$blockScrolling += 1; - this.moveCursorTo(lineNumber-1, column || 0); + this.moveCursorTo(lineNumber - 1, column || 0); this.$blockScrolling -= 1; - if (!this.isRowFullyVisible(this.getCursorPosition().row)) - this.scrollToLine(lineNumber, true); + + if (!this.isRowFullyVisible(lineNumber - 1)) + this.scrollToLine(lineNumber - 1, true, animate); }; /** related to: Editor.moveCursorTo @@ -14950,8 +15125,10 @@ var Editor = function(renderer, session) { * Moves the cursor to the end of the current file. Note that this does de-select the current selection. **/ this.navigateFileEnd = function() { + var scrollTop = this.renderer.scrollTop; this.selection.moveCursorFileEnd(); this.clearSelection(); + this.renderer.animateScrolling(scrollTop); }; /** @@ -14960,8 +15137,10 @@ var Editor = function(renderer, session) { * Moves the cursor to the start of the current file. Note that this does de-select the current selection. **/ this.navigateFileStart = function() { + var scrollTop = this.renderer.scrollTop; this.selection.moveCursorFileStart(); this.clearSelection(); + this.renderer.animateScrolling(scrollTop); }; /** @@ -15070,44 +15249,45 @@ var Editor = function(renderer, session) { * Editor.find(needle, options) * - needle (String): The text to search for * - options (Object): An object defining various search properties + * - animate (Boolean): If `true` animate scrolling * * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. **/ - this.find = function(needle, options) { + this.find = function(needle, options, animate) { this.clearSelection(); options = options || {}; options.needle = needle; this.$search.set(options); - this.$find(); + this.$find(false, animate); }; /** related to: Editor.find * Editor.findNext(options) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling * * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. **/ - this.findNext = function(options) { + this.findNext = function(options, animate) { options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = false; this.$search.set(options); - this.$find(); + this.$find(false, animate); }; /** related to: Editor.find * Editor.findPrevious(options) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling * * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. **/ - this.findPrevious = function(options) { + this.findPrevious = function(options, animate) { options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = true; this.$search.set(options); - this.$find(); + this.$find(true, animate); }; - this.$find = function(backwards) { + this.$find = function(backwards, animate) { if (!this.selection.isEmpty()) this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())}); @@ -15116,24 +15296,14 @@ var Editor = function(renderer, session) { var range = this.$search.find(this.session); if (range) { - this.session.unfold(range); - this.$blockScrolling += 1; + this.session.unfold(range); this.selection.setSelectionRange(range); this.$blockScrolling -= 1; - if (this.getAnimatedScroll()) { - var cursor = this.getCursorPosition(); - if (!this.isRowFullyVisible(cursor.row)) - this.scrollToLine(cursor.row, true); - - //@todo scroll X - //if (!this.isColumnFullyVisible(cursor.column)) - //this.scrollToRow(cursor.column); - } - else { - this.renderer.scrollSelectionIntoView(range.start, range.end); - } + var scrollTop = this.renderer.scrollTop; + this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); + this.renderer.animateScrolling(scrollTop); } }; @@ -15143,7 +15313,10 @@ var Editor = function(renderer, session) { * {:UndoManager.undo} **/ this.undo = function() { + this.$blockScrolling++; this.session.getUndoManager().undo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); }; /** related to: UndoManager.redo @@ -15152,7 +15325,10 @@ var Editor = function(renderer, session) { * {:UndoManager.redo} **/ this.redo = function() { + this.$blockScrolling++; this.session.getUndoManager().redo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); }; /** @@ -15243,13 +15419,18 @@ var TextInput = function(parentNode, host) { if (!copied) { var value = valueToSend || text.value; if (value) { - if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) { - value = value.slice(0, -1); - if (value) - host.onTextInput(value, pasted); + if (value.length > 1) { + if (value.charAt(0) == PLACEHOLDER) + value = value.substr(1); + else if (value.charAt(value.length - 1) == PLACEHOLDER) + value = value.slice(0, -1); } - else { - host.onTextInput(value, pasted); + + if (value && value != PLACEHOLDER) { + if (pasted) + host.onPaste(value); + else + host.onTextInput(value); } // If editor is no longer focused we quit immediately, since @@ -15270,7 +15451,7 @@ var TextInput = function(parentNode, host) { var onTextInput = function(e) { setTimeout(function () { if (!inCompostion) - sendText(e.data); + sendText(e.data); }, 0); }; @@ -15326,6 +15507,7 @@ var TextInput = function(parentNode, host) { }; event.addCommandKeyListener(text, host.onCommandKey.bind(host)); + if (useragent.isOldIE) { var keytable = { 13:1, 27:1 }; event.addListener(text, "keyup", function (e) { @@ -15648,6 +15830,19 @@ function DefaultHandlers(editor) { var selectionEmpty = selectionRange.isEmpty(); var state = STATE_UNKNOWN; + var button = ev.getButton(); + if (button !== 0) { + if (selectionEmpty) { + editor.moveCursorToPosition(pos); + editor.selection.clearSelection(); + } + if (button == 2) { + editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); + event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); + } + return; + } + // if this click caused the editor to be focused should not clear the // selection if ( @@ -15661,18 +15856,6 @@ function DefaultHandlers(editor) { return; } - var button = ev.getButton(); - if (button !== 0) { - if (selectionEmpty) { - editor.moveCursorToPosition(pos); - } - if (button == 2) { - editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); - event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); - } - return; - } - if (!inSelection) { // Directly pick STATE_SELECT, since the user is not clicking inside // a selection. @@ -16010,7 +16193,8 @@ function GutterHandler(editor) { exports.GutterHandler = GutterHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -16224,7 +16408,8 @@ function FoldHandler(editor) { exports.FoldHandler = FoldHandler; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -16273,15 +16458,27 @@ require("../commands/default_commands"); var KeyBinding = function(editor) { this.$editor = editor; this.$data = { }; - this.$handlers = [this]; + this.$handlers = []; + this.setDefaultHandler(editor.commands); }; (function() { + this.setDefaultHandler = function(keyboardHandler) { + this.removeKeyboardHandler(this.$defaultHandler); + this.$defaultHandler = keyboardHandler; + if (keyboardHandler) + this.$handlers.unshift(keyboardHandler); + this.$data = { }; + }; + this.setKeyboardHandler = function(keyboardHandler) { if (this.$handlers[this.$handlers.length - 1] == keyboardHandler) return; this.$data = { }; - this.$handlers = keyboardHandler ? [this, keyboardHandler] : [this]; + this.$handlers = []; + this.setDefaultHandler(this.$defaultHandler); + if (keyboardHandler) + this.$handlers.push(keyboardHandler); }; this.addKeyboardHandler = function(keyboardHandler) { @@ -16319,7 +16516,7 @@ var KeyBinding = function(editor) { // allow keyboardHandler to consume keys if (toExecute.command != "null") - success = commands.exec(toExecute.command, this.$editor, toExecute.args); + success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); else success = true; @@ -16329,20 +16526,14 @@ var KeyBinding = function(editor) { return success; }; - this.handleKeyboard = function(data, hashId, keyString) { - return { - command: this.$editor.commands.findKeyCommand(hashId, keyString) - }; - }; - this.onCommandKey = function(e, hashId, keyCode) { var keyString = keyUtil.keyCodeToString(keyCode); this.$callKeyboardHandlers(hashId, keyString, keyCode, e); }; - this.onTextInput = function(text, pasted) { + this.onTextInput = function(text) { var success = false; - if (!pasted && text.length == 1) + if (text.length == 1) success = this.$callKeyboardHandlers(0, text); if (!success) this.$editor.commands.exec("insertstring", this.$editor, text); @@ -16665,7 +16856,7 @@ exports.commands = [{ multiSelectAction: "forEach" }, { name: "togglecomment", - bindKey: bindKey("Ctrl-7", "Command-7"), + bindKey: bindKey("Ctrl-/", "Command-/"), exec: function(editor) { editor.toggleCommentLines(); }, multiSelectAction: "forEach" }, { @@ -17243,7 +17434,7 @@ var CommandManager = function(platform, commands) { this.addCommands(commands); this.setDefaultHandler("exec", function(e) { - e.command.exec(e.editor, e.args || {}); + return e.command.exec(e.editor, e.args || {}); }); }; @@ -17263,8 +17454,18 @@ oop.inherits(CommandManager, HashHandler); if (editor && editor.$readOnly && !command.readOnly) return false; - this._emit("exec", {editor: editor, command: command, args: args}); - return true; + try { + var retvalue = this._emit("exec", { + editor: editor, + command: command, + args: args + }); + } catch (e) { + window.console && window.console.log(e); + return true; + } + + return retvalue === false ? false : true; }; this.toggleRecording = function() { @@ -17429,6 +17630,7 @@ var VirtualRenderer = function(container, theme) { this.$gutterLayer = new GutterLayer(this.$gutter); this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true)); + this.setFadeFoldWidgets(true); this.$markerBack = new MarkerLayer(this.content); @@ -17444,14 +17646,15 @@ var VirtualRenderer = function(container, theme) { this.$cursorPadding = 8; // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = true; - this.$horizScrollAlwaysVisible = true; + this.$horizScroll = false; + this.$horizScrollAlwaysVisible = false; this.$animatedScroll = false; this.scrollBar = new ScrollBar(container); this.scrollBar.addEventListener("scroll", function(e) { - _self.session.setScrollTop(e.data); + if (!_self.$inScrollAnimation) + _self.session.setScrollTop(e.data); }); this.scrollTop = 0; @@ -17462,12 +17665,9 @@ var VirtualRenderer = function(container, theme) { _self.scrollLeft = scrollLeft; _self.session.setScrollLeft(scrollLeft); - if (scrollLeft == 0) { - _self.$gutter.className = "ace_gutter"; - } - else { - _self.$gutter.className = "ace_gutter horscroll"; - } + _self.scroller.className = scrollLeft == 0 + ? "ace_scroller" + : "ace_scroller horscroll"; }); this.cursorPos = { @@ -17539,12 +17739,16 @@ var VirtualRenderer = function(container, theme) { **/ this.setSession = function(session) { this.session = session; + + this.scroller.className = "ace_scroller"; + this.$cursorLayer.setSession(session); this.$markerBack.setSession(session); this.$markerFront.setSession(session); this.$gutterLayer.setSession(session); this.$textLayer.setSession(session); this.$loop.schedule(this.CHANGE_FULL); + }; /** @@ -17763,6 +17967,17 @@ var VirtualRenderer = function(container, theme) { this.onResize(true); }; + this.getFadeFoldWidgets = function(){ + return dom.hasCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + + this.setFadeFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.$gutter, "ace_fade-fold-widgets"); + else + dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + this.$updatePrintMargin = function() { var containerEl; @@ -18206,18 +18421,18 @@ var VirtualRenderer = function(container, theme) { this.$cursorLayer.showCursor(); }; - this.scrollSelectionIntoView = function(anchor, lead) { + this.scrollSelectionIntoView = function(anchor, lead, offset) { // first scroll anchor into view then scroll lead into view - this.scrollCursorIntoView(anchor); - this.scrollCursorIntoView(lead); + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); }; /** - * VirtualRenderer.scrollCursorIntoView() -> Void + * VirtualRenderer.scrollCursorIntoView(cursor, offset) -> Void * * Scrolls the cursor into the first visibile area of the editor **/ - this.scrollCursorIntoView = function(cursor) { + this.scrollCursorIntoView = function(cursor, offset) { // the editor is not visible if (this.$size.scrollerHeight === 0) return; @@ -18228,10 +18443,12 @@ var VirtualRenderer = function(container, theme) { var top = pos.top; if (this.scrollTop > top) { + if (offset) + top -= offset * this.$size.scrollerHeight; this.session.setScrollTop(top); - } - - if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + } else if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + if (offset) + top += offset * this.$size.scrollerHeight; this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); } @@ -18241,9 +18458,7 @@ var VirtualRenderer = function(container, theme) { if (left < this.$padding + 2 * this.layerConfig.characterWidth) left = 0; this.session.setScrollLeft(left); - } - - if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); } }; @@ -18294,36 +18509,70 @@ var VirtualRenderer = function(container, theme) { this.session.setScrollTop(row * this.lineHeight); }; + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + /** - * VirtualRenderer.scrollToLine(line, center) -> Void + * VirtualRenderer.scrollToLine(line, center, animate, callback) -> Void * - line (Number): A line number * - center (Boolean): If `true`, centers the editor the to indicated line - * + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called after the animation has finished + * * Gracefully scrolls the editor to the row indicated. **/ - this.scrollToLine = function(line, center) { + this.scrollToLine = function(line, center, animate, callback) { var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); var offset = pos.top; if (center) offset -= this.$size.scrollerHeight / 2; - if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) { - var _self = this; - var steps = _self.$calcSteps(this.scrollTop, offset); - - clearInterval(this.$timer); - this.$timer = setInterval(function() { - _self.session.setScrollTop(steps.shift()); - - if (!steps.length) - clearInterval(_self.$timer); - }, 10); - } - else { + var initialScroll = this.scrollTop; this.session.setScrollTop(offset); - } + if (animate !== false) + this.animateScrolling(initialScroll, callback); }; + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) { + var _self = this; + var steps = _self.$calcSteps(fromValue, toValue); + this.$inScrollAnimation = true; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + // trick session to think it's already scrolled to not loose toValue + _self.session.$scrollTop = toValue; + } else { + this.$inScrollAnimation = false; + clearInterval(_self.$timer); + + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + callback && callback(); + } + }, 10); + } + }; + /** * VirtualRenderer.scrollToY(scrollTop) -> Number * - scrollTop (Number): The position to scroll to @@ -19000,7 +19249,8 @@ var Marker = function(parentEl) { exports.Marker = Marker; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -19392,21 +19642,18 @@ var Text = function(parentEl) { this.$renderToken = function(stringBuilder, screenColumn, token, value) { var self = this; - var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g; + var replaceReg = /\t|&|<|( +)|([\u0000-\u0019\u00a0\u2000-\u200b\u2028\u2029\u3000])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (c.charCodeAt(0) == 32) { + if (a) { return new Array(c.length+1).join(" "); + } else if (c == "&") { + return useragent.isOldGecko ? "&" : "&"; + } else if (c == "<") { + return "<"; } else if (c == "\t") { var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); screenColumn += tabSize - 1; return self.$tabStrings[tabSize]; - } else if (c == "&") { - if (useragent.isOldGecko) - return "&"; - else - return "&"; - } else if (c == "<") { - return "<"; } else if (c == "\u3000") { // U+3000 is both invisible AND full-width, so must be handled uniquely var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; @@ -19415,13 +19662,11 @@ var Text = function(parentEl) { return "" + space + ""; - } else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) { - if (self.showInvisibles) { - var space = new Array(c.length+1).join(self.SPACE_CHAR); - return "" + space + ""; - } else { + } else if (b) { + if (self.showInvisibles) + return "" + self.SPACE_CHAR + ""; + else return " "; - } } else { screenColumn += 1; return " 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) + return; + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + + this.toggleBlockSelection = function () { if (this.rangeCount > 1) { var ranges = this.rangeList.ranges; var lastRange = ranges[ranges.length - 1]; @@ -20629,7 +20924,7 @@ var EditSession = require("./edit_session").EditSession; // extend Editor var Editor = require("./editor").Editor; (function() { - + /** extension * Editor.updateSelectionMarkers() * @@ -20693,13 +20988,13 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onRemoveRange = function(e) { this.removeSelectionMarkers(e.ranges); this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onMultiSelect = function(e) { if (this.inMultiSelectMode) return; @@ -20712,7 +21007,7 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onSingleSelect = function(e) { if (this.session.multiSelect.inVirtualMode) return; @@ -20780,9 +21075,9 @@ var Editor = require("./editor").Editor; this.onCursorChange(); this.onSelectionChange(); }; - + /** extension - * Editor.exitMultiSelectMode() + * Editor.exitMultiSelectMode() -> Void * * Removes all the selections except the last added one. **/ @@ -20808,15 +21103,35 @@ var Editor = require("./editor").Editor; return text; }; + this.onPaste = function(text) { + this._emit("paste", text); + if (!this.inMultiSelectMode) + return this.insert(text); + + var lines = text.split(this.session.getDocument().getNewLineCharacter()); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length) { + this.commands.exec("insertstring", this, text); + return; + } + + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + }; + /** extension - * Editor.findAll(needle, dir, additive) -> Number - * - needle (String): The text to find - * - options (Object): Any of the additional [[Search search options]] - * - additive (Boolean): TODO - * + (Number): The number of found ranges. + * Editor.findAll(dir, options) -> Number + * - needle: text to find + * - options: search options + * - additive: keeps * * Finds and selects all the occurences of `needle`. - * **/ this.findAll = function(needle, options, additive) { options = options || {}; @@ -20829,10 +21144,10 @@ var Editor = require("./editor").Editor; this.$blockScrolling += 1; var selection = this.multiSelect; - + if (!additive) selection.toSingleRange(ranges[0]); - + for (var i = ranges.length; i--; ) selection.addRange(ranges[i], true); @@ -20892,7 +21207,6 @@ var Editor = require("./editor").Editor; * - dir (Number): The direction to rotate selections * * Transposes the selected ranges. - * **/ this.transposeSelections = function(dir) { var session = this.session; @@ -20910,7 +21224,7 @@ var Editor = require("./editor").Editor; } } sel.mergeOverlappingRanges(); - + var words = []; for (var i = all.length; i--; ) { var range = all[i]; @@ -21017,7 +21331,7 @@ function MultiSelect(editor) { editor.on("mousedown", onMouseDown); editor.commands.addCommands(exports.commands.defaultCommands); - + addAltCursorListeners(editor); } @@ -21025,7 +21339,7 @@ function addAltCursorListeners(editor){ var el = editor.textInput.getElement(); var altCursor = false; var contentEl = editor.renderer.content; - el.addEventListener("keydown", function(e) { + event.addListener(el, "keydown", function(e) { if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { if (!altCursor) { contentEl.style.cursor = "crosshair"; @@ -21035,9 +21349,9 @@ function addAltCursorListeners(editor){ contentEl.style.cursor = ""; } }); - - el.addEventListener("keyup", reset); - el.addEventListener("blur", reset); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); function reset() { if (altCursor) { contentEl.style.cursor = ""; @@ -21048,7 +21362,8 @@ function addAltCursorListeners(editor){ exports.MultiSelect = MultiSelect; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -21445,7 +21760,8 @@ function onMouseDown(e) { exports.onMouseDown = onMouseDown; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -21531,20 +21847,22 @@ exports.defaultCommands = [{ exec: function(editor) { editor.multiSelect.splitIntoLines(); }, bindKey: {win: "Ctrl-Shift-L", mac: "Ctrl-Shift-L"}, readonly: true -}]; - -// commands active in multiselect mode -exports.multiEditCommands = [{ +}, { name: "singleSelection", bindKey: "esc", exec: function(editor) { editor.exitMultiSelectMode(); }, - readonly: true + readonly: true, + isAvailable: function(editor) {return editor.inMultiSelectMode} }]; +// commands active in multiselect mode +exports.multiEditCommands = {"singleSelection": "esc"}; + var HashHandler = require("../keyboard/hash_handler").HashHandler; exports.keyboardHandler = new HashHandler(exports.multiEditCommands); -});; +}); +; (function() { window.require(["ace/ace"], function(a) { if (!window.ace) diff --git a/build/demo/kitchen-sink/mode-c_cpp-uncompressed.js b/build/demo/kitchen-sink/mode-c_cpp-uncompressed.js index d877348d..a2bcc872 100644 --- a/build/demo/kitchen-sink/mode-c_cpp-uncompressed.js +++ b/build/demo/kitchen-sink/mode-c_cpp-uncompressed.js @@ -708,7 +708,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -802,7 +803,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-coffee-uncompressed.js b/build/demo/kitchen-sink/mode-coffee-uncompressed.js index 19e30ecc..0e7c3b9f 100644 --- a/build/demo/kitchen-sink/mode-coffee-uncompressed.js +++ b/build/demo/kitchen-sink/mode-coffee-uncompressed.js @@ -118,7 +118,8 @@ oop.inherits(Mode, TextMode); exports.Mode = Mode; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -490,7 +491,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-coldfusion-uncompressed.js b/build/demo/kitchen-sink/mode-coldfusion-uncompressed.js index e2544d91..7c752ee5 100644 --- a/build/demo/kitchen-sink/mode-coldfusion-uncompressed.js +++ b/build/demo/kitchen-sink/mode-coldfusion-uncompressed.js @@ -480,7 +480,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -704,7 +705,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -965,7 +967,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2131,7 +2134,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-csharp-uncompressed.js b/build/demo/kitchen-sink/mode-csharp-uncompressed.js index 33bc754c..4bcdd072 100644 --- a/build/demo/kitchen-sink/mode-csharp-uncompressed.js +++ b/build/demo/kitchen-sink/mode-csharp-uncompressed.js @@ -558,7 +558,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -652,7 +653,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-css-uncompressed.js b/build/demo/kitchen-sink/mode-css-uncompressed.js index 93634a57..f3d6edbf 100644 --- a/build/demo/kitchen-sink/mode-css-uncompressed.js +++ b/build/demo/kitchen-sink/mode-css-uncompressed.js @@ -691,7 +691,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-groovy-uncompressed.js b/build/demo/kitchen-sink/mode-groovy-uncompressed.js index f3651008..2fca0ad9 100644 --- a/build/demo/kitchen-sink/mode-groovy-uncompressed.js +++ b/build/demo/kitchen-sink/mode-groovy-uncompressed.js @@ -1205,7 +1205,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1299,7 +1300,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-haxe-uncompressed.js b/build/demo/kitchen-sink/mode-haxe-uncompressed.js index c47c64c9..17634863 100644 --- a/build/demo/kitchen-sink/mode-haxe-uncompressed.js +++ b/build/demo/kitchen-sink/mode-haxe-uncompressed.js @@ -558,7 +558,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -652,7 +653,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-html-uncompressed.js b/build/demo/kitchen-sink/mode-html-uncompressed.js index fc20682c..cbbe24bd 100644 --- a/build/demo/kitchen-sink/mode-html-uncompressed.js +++ b/build/demo/kitchen-sink/mode-html-uncompressed.js @@ -1264,7 +1264,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1358,7 +1359,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2200,7 +2202,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2285,7 +2288,8 @@ var FoldMode = exports.FoldMode = function() { oop.inherits(FoldMode, MixedFoldMode); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2372,7 +2376,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2633,4 +2638,4 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -}); \ No newline at end of file +}); diff --git a/build/demo/kitchen-sink/mode-java-uncompressed.js b/build/demo/kitchen-sink/mode-java-uncompressed.js index 5bdfaa72..23854c78 100644 --- a/build/demo/kitchen-sink/mode-java-uncompressed.js +++ b/build/demo/kitchen-sink/mode-java-uncompressed.js @@ -1206,7 +1206,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1300,7 +1301,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-javascript-uncompressed.js b/build/demo/kitchen-sink/mode-javascript-uncompressed.js index 0a6335de..66b47e15 100644 --- a/build/demo/kitchen-sink/mode-javascript-uncompressed.js +++ b/build/demo/kitchen-sink/mode-javascript-uncompressed.js @@ -1181,7 +1181,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1275,7 +1276,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-json-uncompressed.js b/build/demo/kitchen-sink/mode-json-uncompressed.js index a3d4f713..17b9d306 100644 --- a/build/demo/kitchen-sink/mode-json-uncompressed.js +++ b/build/demo/kitchen-sink/mode-json-uncompressed.js @@ -97,7 +97,8 @@ oop.inherits(Mode, TextMode); }).call(Mode.prototype); exports.Mode = Mode; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -489,7 +490,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -583,7 +585,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-less-uncompressed.js b/build/demo/kitchen-sink/mode-less-uncompressed.js index b59684dd..dbec8c25 100644 --- a/build/demo/kitchen-sink/mode-less-uncompressed.js +++ b/build/demo/kitchen-sink/mode-less-uncompressed.js @@ -539,7 +539,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-lua-uncompressed.js b/build/demo/kitchen-sink/mode-lua-uncompressed.js index c3f87547..93925249 100644 --- a/build/demo/kitchen-sink/mode-lua-uncompressed.js +++ b/build/demo/kitchen-sink/mode-lua-uncompressed.js @@ -56,7 +56,7 @@ oop.inherits(Mode, TextMode); var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; - + var chunks = ["function", "then", "do", "repeat"]; if (state == "start") { @@ -198,7 +198,7 @@ var LuaHighlightRules = function() { this.$rules = { "start" : - + // bracketed comments [{ token : "comment", // --[[ comment @@ -219,9 +219,9 @@ var LuaHighlightRules = function() { token : "comment", // --[====+[ comment regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' }, - - // multiline bracketed comments - { + + // multiline bracketed comments + { token : "comment", // --[[ comment regex : strPre + '\\-\\-\\[\\[.*$', merge : true, @@ -271,7 +271,7 @@ var LuaHighlightRules = function() { }, // bracketed strings - { + { token : "string", // [[ string regex : strPre + '\\[\\[.*\\]\\]' }, { @@ -290,8 +290,8 @@ var LuaHighlightRules = function() { token : "string", // [====+[ string regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' }, - - // multiline bracketed strings + + // multiline bracketed strings { token : "string", // [[ string regex : strPre + '\\[\\[.*$', diff --git a/build/demo/kitchen-sink/mode-markdown-uncompressed.js b/build/demo/kitchen-sink/mode-markdown-uncompressed.js index 584467d4..17e27e45 100644 --- a/build/demo/kitchen-sink/mode-markdown-uncompressed.js +++ b/build/demo/kitchen-sink/mode-markdown-uncompressed.js @@ -78,7 +78,8 @@ oop.inherits(Mode, TextMode); }).call(Mode.prototype); exports.Mode = Mode; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1261,7 +1262,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1355,7 +1357,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1879,7 +1882,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2140,7 +2144,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2800,7 +2805,8 @@ var FoldMode = exports.FoldMode = function() { oop.inherits(FoldMode, MixedFoldMode); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2887,7 +2893,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -3081,4 +3088,4 @@ var MarkdownHighlightRules = function() { oop.inherits(MarkdownHighlightRules, TextHighlightRules); exports.MarkdownHighlightRules = MarkdownHighlightRules; -}); \ No newline at end of file +}); diff --git a/build/demo/kitchen-sink/mode-perl-uncompressed.js b/build/demo/kitchen-sink/mode-perl-uncompressed.js index 04796f61..ff6f8ddd 100644 --- a/build/demo/kitchen-sink/mode-perl-uncompressed.js +++ b/build/demo/kitchen-sink/mode-perl-uncompressed.js @@ -458,7 +458,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-php-uncompressed.js b/build/demo/kitchen-sink/mode-php-uncompressed.js index 37733f26..eedc0308 100644 --- a/build/demo/kitchen-sink/mode-php-uncompressed.js +++ b/build/demo/kitchen-sink/mode-php-uncompressed.js @@ -1674,7 +1674,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1768,7 +1769,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-powershell-uncompressed.js b/build/demo/kitchen-sink/mode-powershell-uncompressed.js index e6f9deea..930ce6af 100644 --- a/build/demo/kitchen-sink/mode-powershell-uncompressed.js +++ b/build/demo/kitchen-sink/mode-powershell-uncompressed.js @@ -499,7 +499,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -593,7 +594,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-python-uncompressed.js b/build/demo/kitchen-sink/mode-python-uncompressed.js index 9a12dece..4783433a 100644 --- a/build/demo/kitchen-sink/mode-python-uncompressed.js +++ b/build/demo/kitchen-sink/mode-python-uncompressed.js @@ -391,7 +391,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-scad-uncompressed.js b/build/demo/kitchen-sink/mode-scad-uncompressed.js index 87418fee..f3cb57b4 100644 --- a/build/demo/kitchen-sink/mode-scad-uncompressed.js +++ b/build/demo/kitchen-sink/mode-scad-uncompressed.js @@ -696,7 +696,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -790,7 +791,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-scala-uncompressed.js b/build/demo/kitchen-sink/mode-scala-uncompressed.js index 5779b9cd..c59a625f 100644 --- a/build/demo/kitchen-sink/mode-scala-uncompressed.js +++ b/build/demo/kitchen-sink/mode-scala-uncompressed.js @@ -1206,7 +1206,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1300,7 +1301,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-scss-uncompressed.js b/build/demo/kitchen-sink/mode-scss-uncompressed.js index fc6d611f..63ed5684 100644 --- a/build/demo/kitchen-sink/mode-scss-uncompressed.js +++ b/build/demo/kitchen-sink/mode-scss-uncompressed.js @@ -563,7 +563,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-svg-uncompressed.js b/build/demo/kitchen-sink/mode-svg-uncompressed.js index 386a04c0..45759dc8 100644 --- a/build/demo/kitchen-sink/mode-svg-uncompressed.js +++ b/build/demo/kitchen-sink/mode-svg-uncompressed.js @@ -487,7 +487,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -711,7 +712,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -972,7 +974,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2138,7 +2141,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2296,4 +2300,4 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -}); \ No newline at end of file +}); diff --git a/build/demo/kitchen-sink/mode-xml-uncompressed.js b/build/demo/kitchen-sink/mode-xml-uncompressed.js index c5101718..5cdd3bc2 100644 --- a/build/demo/kitchen-sink/mode-xml-uncompressed.js +++ b/build/demo/kitchen-sink/mode-xml-uncompressed.js @@ -409,7 +409,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -633,7 +634,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -894,7 +896,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/demo/kitchen-sink/mode-xquery-uncompressed.js b/build/demo/kitchen-sink/mode-xquery-uncompressed.js index 69effad6..1f35638f 100644 --- a/build/demo/kitchen-sink/mode-xquery-uncompressed.js +++ b/build/demo/kitchen-sink/mode-xquery-uncompressed.js @@ -537,4 +537,4 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -}); \ No newline at end of file +}); diff --git a/build/demo/kitchen-sink/styles.css b/build/demo/kitchen-sink/styles.css index 74c53b90..e71e7e53 100644 --- a/build/demo/kitchen-sink/styles.css +++ b/build/demo/kitchen-sink/styles.css @@ -1,3 +1,5 @@ +@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono); + html { height: 100%; width: 100%; diff --git a/build/demo/kitchen-sink/theme-monokai-uncompressed.js b/build/demo/kitchen-sink/theme-monokai-uncompressed.js index 414b07f7..4f639944 100644 --- a/build/demo/kitchen-sink/theme-monokai-uncompressed.js +++ b/build/demo/kitchen-sink/theme-monokai-uncompressed.js @@ -49,8 +49,8 @@ exports.cssText = "\ }\ \ .ace-monokai .ace_gutter {\ - background: #e8e8e8;\ - color: #333;\ + background: #292a24;\ + color: #f1f1f1;\ }\ \ .ace-monokai .ace_print_margin {\ @@ -94,9 +94,12 @@ exports.cssText = "\ border: 1px solid #49483E;\ }\ \ -.ace-monokai .ace_marker-layer .ace_active_line {\ +.ace-monokai .ace_marker-layer .ace_active_line{\ background: #49483E;\ }\ +.ace-monokai .ace_gutter_active_line{\ + background: #191916;\ +}\ \ .ace-monokai .ace_marker-layer .ace_selected_word {\ border: 1px solid #49483E;\ diff --git a/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js b/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js index 65ccdf28..f96e08e7 100644 --- a/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js +++ b/build/demo/kitchen-sink/theme-solarized_dark-uncompressed.js @@ -49,8 +49,8 @@ exports.cssText = "\ }\ \ .ace-solarized-dark .ace_gutter {\ - background: #e8e8e8;\ - color: #333;\ + background: #09222b;\ + color: #d0edf7;\ }\ \ .ace-solarized-dark .ace_print_margin {\ @@ -97,6 +97,9 @@ exports.cssText = "\ .ace-solarized-dark .ace_marker-layer .ace_active_line {\ background: #073642;\ }\ +.ace-solarized-dark .ace_gutter_active_line{\ + background: #0d3440;\ +}\ \ .ace-solarized-dark .ace_marker-layer .ace_selected_word {\ border: 1px solid #073642;\ diff --git a/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js b/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js index ff831a06..7c014296 100644 --- a/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js +++ b/build/demo/kitchen-sink/theme-tomorrow_night_blue-uncompressed.js @@ -49,8 +49,8 @@ exports.cssText = "\ }\ \ .ace-tomorrow-night-blue .ace_gutter {\ - background: #e8e8e8;\ - color: #333;\ + background: #022346;\ + color: #7388b5;\ }\ \ .ace-tomorrow-night-blue .ace_print_margin {\ @@ -94,9 +94,12 @@ exports.cssText = "\ border: 1px solid #404F7D;\ }\ \ -.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line {\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line{\ background: #00346E;\ }\ +.ace-tomorrow-night-blue .ace_gutter_active_line{\ + background: #022040;\ +}\ \ .ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\ border: 1px solid #003F8E;\ diff --git a/build/demo/kitchen-sink/worker-coffee.js b/build/demo/kitchen-sink/worker-coffee.js index 7d666b32..aa9daade 100644 --- a/build/demo/kitchen-sink/worker-coffee.js +++ b/build/demo/kitchen-sink/worker-coffee.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1594,7 +1597,8 @@ oop.inherits(Worker, Mirror); }).call(Worker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1636,7 +1640,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1716,11 +1721,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1728,21 +1733,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1769,10 +1774,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1832,82 +1837,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1918,14 +1922,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1950,10 +1954,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1961,7 +1965,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1981,16 +1985,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -2014,7 +2018,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -2025,7 +2029,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2051,14 +2055,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2092,7 +2096,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2122,15 +2126,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2146,12 +2150,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2170,9 +2174,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2180,7 +2184,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2202,10 +2206,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -3296,7 +3300,8 @@ define('ace/mode/coffee/coffee-script', ['require', 'exports', 'module' , 'ace/m exports.parse = function(code) { return parser.parse(lexer.tokenize(code)); }; -});/* +}); +/* * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person @@ -5079,7 +5084,8 @@ parse: function parse(input) { module.exports = parser; -});/* +}); +/* * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person diff --git a/build/demo/kitchen-sink/worker-css.js b/build/demo/kitchen-sink/worker-css.js index 291f8d0c..a86bbcb0 100644 --- a/build/demo/kitchen-sink/worker-css.js +++ b/build/demo/kitchen-sink/worker-css.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1568,7 +1571,8 @@ oop.inherits(Worker, Mirror); }).call(Worker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1610,7 +1614,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1690,11 +1695,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1702,21 +1707,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1743,10 +1748,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1806,82 +1811,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1892,14 +1896,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1924,10 +1928,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1935,7 +1939,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1955,16 +1959,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -1988,7 +1992,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -1999,7 +2003,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2025,14 +2029,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2066,7 +2070,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2096,15 +2100,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2120,12 +2124,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2144,9 +2148,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2154,7 +2158,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2176,10 +2180,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; diff --git a/build/demo/kitchen-sink/worker-javascript.js b/build/demo/kitchen-sink/worker-javascript.js index 3f87e76e..bd77cc7f 100644 --- a/build/demo/kitchen-sink/worker-javascript.js +++ b/build/demo/kitchen-sink/worker-javascript.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1590,7 +1593,8 @@ oop.inherits(JavaScriptWorker, Mirror); }).call(JavaScriptWorker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1632,7 +1636,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1712,11 +1717,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1724,21 +1729,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1765,10 +1770,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1828,82 +1833,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1914,14 +1918,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1946,10 +1950,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1957,7 +1961,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1977,16 +1981,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -2010,7 +2014,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -2021,7 +2025,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2047,14 +2051,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2088,7 +2092,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2118,15 +2122,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2142,12 +2146,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2166,9 +2170,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2176,7 +2180,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2198,10 +2202,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -7698,7 +7702,8 @@ loop: for (;;) { if (typeof exports === 'object' && exports) exports.JSHINT = JSHINT; -});/* -*- Mode: JS; tab-width: 4; indent-tabs-mode: nil; -*- +}); +/* -*- Mode: JS; tab-width: 4; indent-tabs-mode: nil; -*- * vim: set sw=4 ts=4 et tw=78: * ***** BEGIN LICENSE BLOCK ***** * @@ -9769,7 +9774,8 @@ exports.Parser = Parser; exports.Module = Module; exports.Export = Export; -});/* vim: set sw=4 ts=4 et tw=78: */ +}); +/* vim: set sw=4 ts=4 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -10366,7 +10372,8 @@ Tokenizer.prototype = { exports.isIdentifier = isIdentifier; exports.Tokenizer = Tokenizer; -});/* vim: set sw=4 ts=4 et tw=78: */ +}); +/* vim: set sw=4 ts=4 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -11061,7 +11068,8 @@ exports.Dict = Dict; exports.WeakMap = _WeakMap; exports.Stack = Stack; -});/* vim: set sw=4 ts=4 et tw=78: */ +}); +/* vim: set sw=4 ts=4 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -11121,4 +11129,4 @@ exports.mozillaMode = true; // Allow experimental paren-free mode? exports.parenFreeMode = false; -}); \ No newline at end of file +}); diff --git a/build/demo/kitchen-sink/worker-json.js b/build/demo/kitchen-sink/worker-json.js index 3054287e..cffed24f 100644 --- a/build/demo/kitchen-sink/worker-json.js +++ b/build/demo/kitchen-sink/worker-json.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1605,7 +1608,8 @@ oop.inherits(JsonWorker, Mirror); }).call(JsonWorker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1647,7 +1651,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1727,11 +1732,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1739,21 +1744,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1780,10 +1785,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1843,82 +1848,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1929,14 +1933,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1961,10 +1965,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1972,7 +1976,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1992,16 +1996,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -2025,7 +2029,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -2036,7 +2040,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2062,14 +2066,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2103,7 +2107,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2133,15 +2137,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2157,12 +2161,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2181,9 +2185,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2191,7 +2195,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2213,10 +2217,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -3590,4 +3594,4 @@ define('ace/mode/json/json_parse', ['require', 'exports', 'module' ], function(r return reviver.call(holder, key, value); }({'': result}, '') : result; }; -}); \ No newline at end of file +}); diff --git a/build/kitchen-sink.html b/build/kitchen-sink.html index d0c2d602..a655825e 100644 --- a/build/kitchen-sink.html +++ b/build/kitchen-sink.html @@ -11,7 +11,7 @@ Ace version 0.2.0 - commit 48cd061c6e3fea068c436e545f6ba68942a98df1 + commit 97de85b0aa76ef89a7f21102c0ef873ac093bd59 --> @@ -133,13 +133,6 @@ - - - - - - - @@ -201,6 +194,14 @@ + + + + + + + +
diff --git a/build/src/ace-noconflict.js b/build/src/ace-noconflict.js index 69e9594e..e912043e 100644 --- a/build/src/ace-noconflict.js +++ b/build/src/ace-noconflict.js @@ -1,4 +1,4 @@ -(function(){function g(a){if(typeof requirejs!="undefined"){var e=b.define;b.define=function(a,b,c){return typeof c!="function"?e.apply(this,arguments):ace.define(a,b,function(a,d,e){return b[2]=="module"&&(e.packaged=!0),c.apply(this,arguments)})},b.define.packaged=!0;return}var f=function(a,b){return d("",a,b)};f.packaged=!0;var g=b;a&&(b[a]||(b[a]={}),g=b[a]),g.define&&(c.original=g.define),g.define=c,g.require&&(d.original=g.require),g.require=f}var a="ace",b=function(){return this}(),c=function(a,b,d){if(typeof a!="string"){c.original?c.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(d=b),c.modules||(c.modules={}),c.modules[a]=d},d=function(a,b,c){if(Object.prototype.toString.call(b)==="[object Array]"){var e=[];for(var g=0,h=b.length;g1&&h(b,"")>-1&&(i=RegExp(this.source,d.replace.call(g(this),"g","")),d.replace.call(a.slice(b.index),i,function(){for(var a=1;ab.index&&this.lastIndex--}return b},f||(RegExp.prototype.test=function(a){var b=d.exec.call(this,a);return b&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--,!!b})}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(a,b,c){function p(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=g.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,h=c.apply(f,d.concat(g.call(arguments)));return h!==null&&Object(h)===h?h:f}return c.apply(b,d.concat(g.call(arguments)))};return e});var d=Function.prototype.call,e=Array.prototype,f=Object.prototype,g=e.slice,h=d.bind(f.toString),i=d.bind(f.hasOwnProperty),j,k,l,m,n;if(n=i(f,"__defineGetter__"))j=d.bind(f.__defineGetter__),k=d.bind(f.__defineSetter__),l=d.bind(f.__lookupGetter__),m=d.bind(f.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return h(b)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b){var c=G(this),d=arguments[1],e=0,f=c.length>>>0;if(h(b)!="[object Function]")throw new TypeError;while(e>>0,e=Array(d),f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=[],f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e=0,f;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);for(;e>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e,f=d-1;if(arguments.length>=2)e=arguments[1];else do{if(f in c){e=c[f--];break}if(--f<0)throw new TypeError}while(!0);do f in this&&(e=b.call(void 0,e,c[f],f,c));while(f--);return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=G(this),d=c.length>>>0;if(!d)return-1;var e=0;arguments.length>1&&(e=E(arguments[1])),e=e>=0?e:Math.max(0,d+e);for(;e>>0;if(!d)return-1;var e=d-1;arguments.length>1&&(e=Math.min(e,E(arguments[1]))),e=e>=0?e:d-Math.abs(e);for(;e>=0;e--)if(e in c&&b===c[e])return e;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||(b.constructor?b.constructor.prototype:f)});if(!Object.getOwnPropertyDescriptor){var o="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(o+b);if(!i(b,c))return;var d,e,g;d={enumerable:!0,configurable:!0};if(n){var h=b.__proto__;b.__proto__=f;var e=l(b,c),g=m(b,c);b.__proto__=h;if(e||g)return e&&(d.get=e),g&&(d.set=g),d}return d.value=b[c],d}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={__proto__:null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}return c!==void 0&&Object.defineProperties(d,c),d});if(Object.defineProperty){var q=p({}),r=typeof document=="undefined"||p(document.createElement("div"));if(!q||!r)var s=Object.defineProperty}if(!Object.defineProperty||s){var t="Property description must be an object: ",u="Object.defineProperty called on non-object: ",v="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(u+b);if(typeof d!="object"&&typeof d!="function"||d===null)throw new TypeError(t+d);if(s)try{return s.call(Object,b,c,d)}catch(e){}if(i(d,"value"))if(n&&(l(b,c)||m(b,c))){var g=b.__proto__;b.__proto__=f,delete b[c],b[c]=d.value,b.__proto__=g}else b[c]=d.value;else{if(!n)throw new TypeError(v);i(d,"get")&&j(b,c,d.get),i(d,"set")&&k(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)i(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(w){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){if(Object(b)===b)throw new TypeError;var c="";while(i(b,c))c+="?";b[c]=!0;var d=i(b,c);return delete b[c],d});if(!Object.keys){var x=!0,y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],z=y.length;for(var A in{toString:null})x=!1;Object.keys=function H(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)i(a,b)&&H.push(b);if(x)for(var c=0,d=z;c9999?"+":"")+("00000"+Math.abs(e)).slice(0<=e&&e<=9999?-4:-6),c=b.length;while(c--)d=b[c],d<10&&(b[c]="0"+d);return e+"-"+b.slice(0,2).join("-")+"T"+b.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(b){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(a){var b=function e(b,c,d,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=j==1&&String(b)===b?new a(e.parse(b)):j>=7?new a(b,c,d,f,g,h,i):j>=6?new a(b,c,d,f,g,h):j>=5?new a(b,c,d,f,g):j>=4?new a(b,c,d,f):j>=3?new a(b,c,d):j>=2?new a(b,c):j>=1?new a(b):new a;return k.constructor=e,k}return a.apply(this,arguments)},c=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var d in a)b[d]=a[d];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;var g=+e.pop(),h=+e.pop(),i=e.pop(),j=0;if(i){if(h>23||g>59)return NaN;j=(h*60+g)*6e4*(i=="+"?-1:1)}var k=+e[0];return 0<=k&&k<=99?(e[0]=k+400,a.UTC.apply(this,e)+j-126227808e5):a.UTC.apply(this,e)+j}return a.parse.apply(this,arguments)},b}(Date));var B=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||B.trim()){B="["+B+"]";var C=new RegExp("^"+B+B+"*"),D=new RegExp(B+B+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(D,"")}}var E=function(a){return a=+a,a!==a?a=0:a!==0&&a!==1/0&&a!==-Infinity&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a},F="a"[0]!="a",G=function(a){if(a==null)throw new TypeError;return F&&typeof a=="string"&&a?a.split(""):Object(a)}}),ace.define("ace/lib/dom",["require","exports","module"],function(a,b,c){"use strict";var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}return d&&c.push(b),a.className=c.join(" "),d},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.hasCssString=function(a,b){var c=0,d;b=b||document;if(b.createStyleSheet&&(d=b.styleSheets)){while(c5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isOldIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko||e.isOpera){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){return h=a.keyIdentifier||a.keyCode,g(c,a,a.keyCode)})}};if(window.postMessage){var h=1;b.nextTick=function(a,c){c=c||window;var d="zero-timeout-message-"+h;b.addListener(c,"message",function e(f){f.data==d&&(b.stopPropagation(f),b.removeListener(c,"message",e),a())}),c.postMessage(d,"*")}}else b.nextTick=function(a,b){b=b||window,window.setTimeout(a,0)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(a,b,c){"use strict";var d=a("./oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(var b in a.FUNCTION_KEYS){var c=a.FUNCTION_KEYS[b].toUpperCase();a[c]=parseInt(b,10)}return d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS),a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),ace.define("ace/lib/oop",["require","exports","module"],function(a,b,c){"use strict",b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(a,b,c){"use strict";var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),b.isOldIE=b.isIE&&b.isIE<9,b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOldGecko=b.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isChrome=parseFloat(e.split(" Chrome/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.isIPad=e.indexOf("iPad")>=0,b.isTouchPad=e.indexOf("TouchPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands"],function(a,b,c){"use strict",a("./lib/fixoldbrowsers");var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/useragent"),g=a("./keyboard/textinput").TextInput,h=a("./mouse/mouse_handler").MouseHandler,i=a("./mouse/fold_handler").FoldHandler,j=a("./keyboard/keybinding").KeyBinding,k=a("./edit_session").EditSession,l=a("./search").Search,m=a("./range").Range,n=a("./lib/event_emitter").EventEmitter,o=a("./commands/command_manager").CommandManager,p=a("./commands/default_commands").commands,q=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(a.getTextAreaContainer(),this),this.keyBinding=new j(this),f.isIPad||(this.$mouseHandler=new h(this),new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.commands=new o(f.isMac?"mac":"win",p),this.setSession(b||new k(""))};(function(){d.implement(this,n),this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session==a)return;if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:a,oldSession:b})},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.setFontSize=function(a){this.container.style.fontSize=a,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket","text")}},10)},this.focus=function(){var a=this;setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.$cursorChange=function(){this.renderer.updateCursor(),this.renderer.moveTextAreaToCursor(this.textInput.getElement())},this.onDocumentChange=function(a){var b=a.data,c=b.range,d;c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines"?d=c.end.row:d=Infinity,this.renderer.updateLines(c.start.row,d),this._emit("change",a),this.$cursorChange()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),typeof this.$lastrow=="number"&&this.renderer.removeGutterDecoration(this.$lastrow,"ace_gutter_active_line"),a.$highlightLineMarker=null,this.$lastrow=null;if(this.getHighlightActiveLine()){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row);if(this.getSelectionStyle()!="line"||!this.selection.isMultiLine()){var d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","background")}this.renderer.addGutterDecoration(this.$lastrow=b.row,"ace_gutter_active_line")}},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getCopyText=function(){var a="";return this.selection.isEmpty()||(a=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",a),a},this.onCut=function(){this.commands.exec("cut",this)},this.insert=function(a){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace(" ",this.session.getTabString());if(!this.selection.isEmpty())d=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)==" "?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}i&&c.autoOutdent(h,b,d.row)},this.onTextInput=function(a,b){b&&this._emit("paste",a),this.keyBinding.onTextInput(a,b)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(a){this.$mouseHandler.setDragDelay(a)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(a){if(this.$selectionStyle==a)return;this.$selectionStyle=a,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:a})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){if(this.$highlightActiveLine==a)return;this.$highlightActiveLine=a,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){if(this.$highlightSelectedWord==a)return;this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setShowInvisibles=function(a){if(this.getShowInvisibles()==a)return;this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.setShowFoldWidgets=function(a){var b=this.renderer.$gutterLayer;if(b.getShowFoldWidgets()==a)return;this.renderer.$gutterLayer.setShowFoldWidgets(a),this.$showFoldWidgets=a,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.remove=function(a){this.selection.isEmpty()&&(a=="left"?this.selection.selectLeft():this.selection.selectRight());var b=this.getSelectionRange();if(this.getBehavioursEnabled()){var c=this.session,d=c.getState(b.start.row),e=c.getMode().transformAction(d,"deletion",this,c,b);e&&(b=e)}this.session.remove(b),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b===0)return;var c=this.session.getLine(a.row),d,e;b=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.isRowFullyVisible=function(a){return a>=this.renderer.getFirstFullyVisibleRow()&&a<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$getPageDownRow=function(){return this.renderer.getScrollBottomRow()},this.$getPageUpRow=function(){var a=this.renderer.getScrollTopRow(),b=this.renderer.getScrollBottomRow();return a-(b-a)},this.selectPageDown=function(){var a=this.$getPageDownRow()+Math.floor(this.$getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection(),c=this.session.documentToScreenPosition(b.getSelectionLead()),d=this.session.screenToDocumentPosition(a,c.column);b.selectTo(d.row,d.column)},this.selectPageUp=function(){var a=this.renderer.getScrollTopRow()-this.renderer.getScrollBottomRow(),b=this.$getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection(),d=this.session.documentToScreenPosition(c.getSelectionLead()),e=this.session.screenToDocumentPosition(b,d.column);c.selectTo(e.row,e.column)},this.gotoPageDown=function(){var a=this.$getPageDownRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.gotoPageUp=function(){var a=this.$getPageUpRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.$getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.$getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.scrollToLine=function(a,b){this.renderer.scrollToLine(a,b)},this.centerSelection=function(){var a=this.getSelectionRange(),b=Math.floor(a.start.row+(a.end.row-a.start.row)/2);this.renderer.scrollToLine(b,!0)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b)},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a)},this.jumpToMatching=function(){var a=this.getCursorPosition(),b=this.session.findMatchingBracket(a);b||(a.column+=1,b=this.session.findMatchingBracket(a)),b||(a.column-=2,b=this.session.findMatchingBracket(a)),b&&(this.clearSelection(),this.moveCursorTo(b.row,b.column))},this.gotoLine=function(a,b){this.selection.clearSelection(),this.session.unfold({row:a-1,column:b||0}),this.$blockScrolling+=1,this.moveCursorTo(a-1,b||0),this.$blockScrolling-=1,this.isRowFullyVisible(this.getCursorPosition().row)||this.scrollToLine(a,!0)},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b)},this.navigateUp=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(-a,0)},this.navigateDown=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(a,0)},this.navigateLeft=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().start;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().end;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.session),d=0;return c?(this.$tryReplace(c,a)&&(d=1),c!==null&&(this.selection.setSelectionRange(c),this.renderer.scrollSelectionIntoView(c.start,c.end)),d):d},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.session),d=0;if(!c.length)return d;this.$blockScrolling+=1;var e=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var f=c.length-1;f>=0;--f)this.$tryReplace(c[f],a)&&d++;return this.selection.setSelectionRange(e),this.$blockScrolling-=1,d},this.$tryReplace=function(a,b){var c=this.session.getTextRange(a);return b=this.$search.replace(c,b),b!==null?(a.end=this.session.replace(a,b),a):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.session.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.session);if(b){this.session.unfold(b),this.$blockScrolling+=1,this.selection.setSelectionRange(b),this.$blockScrolling-=1;if(this.getAnimatedScroll()){var c=this.getCursorPosition();this.isRowFullyVisible(c.row)||this.scrollToLine(c.row,!0)}else this.renderer.scrollSelectionIntoView(b.start,b.end)}},this.undo=function(){this.session.getUndoManager().undo()},this.redo=function(){this.session.getUndoManager().redo()},this.destroy=function(){this.renderer.destroy()}}).call(q.prototype),b.Editor=q}),ace.define("ace/lib/lang",["require","exports","module"],function(a,b,c){"use strict",b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(var c=0,d=a.length;c128)return;setTimeout(function(){h||m()},0)},p=function(a){h=!0,b.onCompositionStart(),e.isGecko||setTimeout(q,0)},q=function(){if(!h)return;b.onCompositionUpdate(c.value)},r=function(a){h=!1,b.onCompositionEnd()},s=function(a){i=!0;var d=b.getCopyText();d?c.value=d:a.preventDefault(),l(),setTimeout(function(){m()},0)},t=function(a){i=!0;var d=b.getCopyText();d?(c.value=d,b.onCut()):a.preventDefault(),l(),setTimeout(function(){m()},0)};d.addCommandKeyListener(c,b.onCommandKey.bind(b));if(e.isOldIE){var u={13:1,27:1};d.addListener(c,"keyup",function(a){h&&(!c.value||u[a.keyCode])&&setTimeout(r,0);if((c.value.charCodeAt(0)|0)<129)return;h?q():p()})}"onpropertychange"in c&&!("oninput"in c)?d.addListener(c,"propertychange",o):d.addListener(c,"input",n),d.addListener(c,"paste",function(a){j=!0,a.clipboardData&&a.clipboardData.getData?(m(a.clipboardData.getData("text/plain")),a.preventDefault()):o()}),"onbeforecopy"in c&&typeof clipboardData!="undefined"?(d.addListener(c,"beforecopy",function(a){var c=b.getCopyText();c?clipboardData.setData("Text",c):a.preventDefault()}),d.addListener(a,"keydown",function(a){if(a.ctrlKey&&a.keyCode==88){var c=b.getCopyText();c&&(clipboardData.setData("Text",c),b.onCut()),d.preventDefault(a)}})):(d.addListener(c,"copy",s),d.addListener(c,"cut",t)),d.addListener(c,"compositionstart",p),e.isGecko&&d.addListener(c,"text",q),e.isWebKit&&d.addListener(c,"keyup",q),d.addListener(c,"compositionend",r),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),l()}),this.focus=function(){b.onFocus(),l(),c.focus()},this.blur=function(){c.blur()},this.isFocused=v,this.getElement=function(){return c},this.onContextMenu=function(a,b){a&&(k||(k=c.style.cssText),c.style.cssText="position:fixed; z-index:1000;left:"+(a.x-2)+"px; top:"+(a.y-2)+"px;"),b&&(c.value="")},this.onContextMenuClose=function(){setTimeout(function(){k&&(c.style.cssText=k,k=""),m()},0)}};b.TextInput=g}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event"],function(a,b,c){"use strict";var d=a("../lib/event"),e=a("./default_handlers").DefaultHandlers,f=a("./default_gutter_handler").GutterHandler,g=a("./mouse_event").MouseEvent,h=function(a){this.editor=a,new e(a),new f(a),d.addListener(a.container,"mousedown",function(b){return a.focus(),d.preventDefault(b)}),d.addListener(a.container,"selectstart",function(a){return d.preventDefault(a)});var b=a.renderer.getMouseEventTarget();d.addListener(b,"mousedown",this.onMouseEvent.bind(this,"mousedown")),d.addListener(b,"click",this.onMouseEvent.bind(this,"click")),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove")),d.addMultiMouseDownListener(b,0,2,500,this.onMouseEvent.bind(this,"dblclick")),d.addMultiMouseDownListener(b,0,3,600,this.onMouseEvent.bind(this,"tripleclick")),d.addMultiMouseDownListener(b,0,4,600,this.onMouseEvent.bind(this,"quadclick")),d.addMouseWheelListener(a.container,this.onMouseWheel.bind(this,"mousewheel"));var c=a.renderer.$gutter;d.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),d.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),d.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),d.addListener(c,"mousemove",this.onMouseMove.bind(this,"gutter"))};(function(){this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(a,b){this.editor._emit(a,new g(b,this.editor))},this.$dragDelay=250,this.setDragDelay=function(a){this.$dragDelay=a},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(a,b){var c=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!c||!c.length)return;this.editor._emit(a,new g(b,this.editor))},this.onMouseWheel=function(a,b){var c=new g(b,this.editor);c.speed=this.$scrollSpeed*2,c.wheelX=b.wheelX,c.wheelY=b.wheelY,this.editor._emit(a,c)}}).call(h.prototype),b.MouseHandler=h}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/event","ace/lib/dom","ace/lib/browser_focus"],function(a,b,c){function k(a){this.editor=a,this.$clickSelection=null,this.browserFocus=new f,a.setDefaultHandler("mousedown",this.onMouseDown.bind(this)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(this)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(this)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(this)),a.setDefaultHandler("mousewheel",this.onScroll.bind(this))}function l(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))}"use strict";var d=a("../lib/event"),e=a("../lib/dom"),f=a("../lib/browser_focus").BrowserFocus,g=0,h=1,i=2,j=5;(function(){this.onMouseDown=function(a){function C(b){a.getShiftKey()?m.selection.selectToPosition(b):n.$clickSelection||(m.moveCursorToPosition(b),m.selection.clearSelection()),q=h}var b=a.inSelection(),c=a.pageX,f=a.pageY,k=a.getDocumentPosition(),m=this.editor,n=this,o=m.getSelectionRange(),p=o.isEmpty(),q=g;if(b&&(!this.browserFocus.isFocused()||(new Date).getTime()-this.browserFocus.lastFocus<20||!m.isFocused())){m.focus();return}var r=a.getButton();if(r!==0){p&&m.moveCursorToPosition(k),r==2&&(m.textInput.onContextMenu({x:a.clientX,y:a.clientY},p),d.capture(m.container,function(){},m.textInput.onContextMenuClose));return}b||C(k);var s=c,t=f,u=(new Date).getTime(),v,w,x,y=function(a){s=d.getDocumentX(a),t=d.getDocumentY(a)},z=function(a){clearInterval(F),q==g?C(k):q==i&&A(a),n.$clickSelection=null,q=g},A=function(a){e.removeCssClass(m.container,"ace_dragging"),m.session.removeMarker(x),m.$mouseHandler.$clickSelection||v||(m.moveCursorToPosition(k),m.selection.clearSelection());if(!v)return;if(w.contains(v.row,v.column)){v=null;return}m.clearSelection();if(a&&(a.ctrlKey||a.altKey))var b=m.session,c=b.insert(v,b.getTextRange(w));else var c=m.moveText(w,v);if(!c){v=null;return}m.selection.setSelectionRange(c)},B=function(){if(q==g){var a=l(c,f,s,t),b=(new Date).getTime();if(a>j){q=h;var d=m.renderer.screenToTextCoordinates(s,t);C(d)}else if(b-u>m.getDragDelay()){q=i,w=m.getSelectionRange();var k=m.getSelectionStyle();x=m.session.addMarker(w,"ace_selection",k),m.clearSelection(),e.addCssClass(m.container,"ace_dragging")}}q==i?E():q==h&&D()},D=function(){var a,b=m.renderer.screenToTextCoordinates(s,t);n.$clickSelection?n.$clickSelection.contains(b.row,b.column)?m.selection.setSelectionRange(n.$clickSelection):(n.$clickSelection.compare(b.row,b.column)==-1?a=n.$clickSelection.end:a=n.$clickSelection.start,m.selection.setSelectionAnchor(a.row,a.column),m.selection.selectToPosition(b)):m.selection.selectToPosition(b),m.renderer.scrollCursorIntoView()},E=function(){v=m.renderer.screenToTextCoordinates(s,t),m.moveCursorToPosition(v)};d.capture(m.container,y,z);var F=setInterval(B,20);return a.preventDefault()},this.onDoubleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectWord(),this.$clickSelection=c.getSelectionRange()},this.onTripleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectLine(),this.$clickSelection=c.getSelectionRange()},this.onQuadClick=function(a){var b=this.editor;b.selectAll(),this.$clickSelection=b.getSelectionRange()},this.onScroll=function(a){var b=this.editor;b.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed);if(b.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed))return a.preventDefault()}}).call(k.prototype),b.DefaultHandlers=k}),ace.define("ace/lib/browser_focus",["require","exports","module","ace/lib/oop","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./oop"),e=a("./event"),f=a("./event_emitter").EventEmitter,g=function(a){a=a||window,this.lastFocus=(new Date).getTime(),this._isFocused=!0;var b=this;"onfocusin"in a.document?(e.addListener(a.document,"focusin",function(a){b._setFocused(!0)}),e.addListener(a.document,"focusout",function(a){b._setFocused(!!a.toElement)})):(e.addListener(a,"blur",function(a){b._setFocused(!1)}),e.addListener(a,"focus",function(a){b._setFocused(!0)}))};(function(){d.implement(this,f),this.isFocused=function(){return this._isFocused},this._setFocused=function(a){if(this._isFocused==a)return;a&&(this.lastFocus=(new Date).getTime()),this._isFocused=a,this._emit("changeFocus")}}).call(g.prototype),b.BrowserFocus=g}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(a,b,c){"use strict";var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var c=this._eventRegistry[a]||[],d=this._defaultHandlers[a];if(!c.length&&!d)return;b=b||{},b.type=a,b.stopPropagation||(b.stopPropagation=function(){this.propagationStopped=!0}),b.preventDefault||(b.preventDefault=function(){this.defaultPrevented=!0});for(var e=0;e=4352&&a<=4447||a>=4515&&a<=4519||a>=4602&&a<=4607||a>=9001&&a<=9002||a>=11904&&a<=11929||a>=11931&&a<=12019||a>=12032&&a<=12245||a>=12272&&a<=12283||a>=12288&&a<=12350||a>=12353&&a<=12438||a>=12441&&a<=12543||a>=12549&&a<=12589||a>=12593&&a<=12686||a>=12688&&a<=12730||a>=12736&&a<=12771||a>=12784&&a<=12830||a>=12832&&a<=12871||a>=12880&&a<=13054||a>=13056&&a<=19903||a>=19968&&a<=42124||a>=42128&&a<=42182||a>=43360&&a<=43388||a>=44032&&a<=55203||a>=55216&&a<=55238||a>=55243&&a<=55291||a>=63744&&a<=64255||a>=65040&&a<=65049||a>=65072&&a<=65106||a>=65108&&a<=65126||a>=65128&&a<=65131||a>=65281&&a<=65376||a>=65504&&a<=65510}e.implement(this,h),this.setDocument=function(a){if(this.doc)throw new Error("Document is already set");this.doc=a,a.on("change",this.onChange.bind(this)),this.on("changeFold",this.onChangeFold.bind(this)),this.bgTokenizer&&(this.bgTokenizer.setDocument(this.getDocument()),this.bgTokenizer.start(0))},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(a==0){this.$rowCache=[];return}var b=this.$rowCache;for(var c=0;c=a){b.splice(c,b.length);return}},this.onChangeFold=function(a){var b=a.data;this.$resetRowCache(b.start.row)},this.onChange=function(a){var b=a.data;this.$modified=!0,this.$resetRowCache(b.range.start.row);var c=this.$updateInternalDataOnChange(a);!this.$fromUndo&&this.$undoManager&&!b.ignore&&(this.$deltasDoc.push(b),c&&c.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:c}),this.$informUndoManager.schedule()),this.bgTokenizer.start(b.range.start.row),this._emit("change",a)},this.setValue=function(a){this.doc.setValue(a),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(a){return this.bgTokenizer.getState(a)},this.getTokens=function(a,b){return this.bgTokenizer.getTokens(a,b)},this.getTokenAt=function(a,b){var c=this.bgTokenizer.getTokens(a,a)[0].tokens,d,e=0;if(b==null)f=c.length-1,e=this.getLine(a).length;else for(var f=0;f=b)break}return d=c[f],d?(d.index=f,d.start=e-d.value.length,d):null},this.setUndoManager=function(a){this.$undoManager=a,this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.$deltasFold.length&&(b.$deltas.push({group:"fold",deltas:b.$deltasFold}),b.$deltasFold=[]),b.$deltasDoc.length&&(b.$deltas.push({group:"doc",deltas:b.$deltasDoc}),b.$deltasDoc=[]),b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]},this.$informUndoManager=f.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?f.stringRepeat(" ",this.getTabSize()):" "},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){if(this.$useSoftTabs===a)return;this.$useSoftTabs=a},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){if(isNaN(a)||this.$tabSize===a)return;this.$modified=!0,this.$tabSize=a,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(a){if(this.$overwrite==a)return;this.$overwrite=a,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=this.doc.getLength()-1)return 0;var c=this.doc.removeLines(a,b);return this.doc.insertLines(a+1,c),1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.doc.insertLines(a,c);var d=b-a+1;return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},this.$clipColumnToRow=function(a,b){return b<0?0:Math.min(this.doc.getLine(a).length,b)},this.$clipPositionToDocument=function(a,b){b=Math.max(0,b);if(a<0)a=0,b=0;else{var c=this.doc.getLength();a>=c?(a=c-1,b=this.doc.getLine(c-1).length):b=Math.min(this.doc.getLine(a).length,b)}return{row:a,column:b}},this.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var b=this.doc.getLength()-1;return a.end.row>b?(a.end.row=b,a.end.column=this.doc.getLine(b).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(a){if(a!=this.$useWrapMode){this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0);if(a){var b=this.getLength();this.$wrapData=[];for(var c=0;c0?(this.$wrapLimit=b,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(a){var b=this.$wrapLimitRange.min;b&&(a=Math.max(b,a));var c=this.$wrapLimitRange.max;return c&&(a=Math.min(c,a)),Math.max(1,a)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(a){var b=this.$useWrapMode,c,d=a.data.action,e=a.data.range.start.row,f=a.data.range.end.row,g=a.data.range.start,h=a.data.range.end,i=null;d.indexOf("Lines")!=-1?(d=="insertLines"?f=e+a.data.lines.length:f=e,c=a.data.lines?a.data.lines.length:f-e):c=f-e;if(c!=0)if(d.indexOf("remove")!=-1){b&&this.$wrapData.splice(e,c);var j=this.$foldData;i=this.getFoldsInRange(a.data.range),this.removeFolds(i);var k=this.getFoldLine(h.row),l=0;if(k){k.addRemoveChars(h.row,h.column,g.column-h.column),k.shiftRow(-c);var m=this.getFoldLine(e);m&&m!==k&&(m.merge(k),k=m),l=j.indexOf(k)+1}for(l;l=h.row&&k.shiftRow(-c)}f=e}else{var n;if(b){n=[e,0];for(var o=0;o=e&&k.shiftRow(c)}}else{c=Math.abs(a.data.range.start.column-a.data.range.end.column),d.indexOf("remove")!=-1&&(i=this.getFoldsInRange(a.data.range),this.removeFolds(i),c=-c);var k=this.getFoldLine(e);k&&k.addRemoveChars(e,g.column,c)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),b&&this.$updateWrapData(e,f),i},this.$updateWrapData=function(a,b){var c=this.doc.getAllLines(),d=this.getTabSize(),e=this.$wrapData,g=this.$wrapLimit,h,k,l=a;b=Math.min(b,c.length-1);while(l<=b){k=this.getFoldLine(l,k);if(!k)h=this.$getDisplayTokens(f.stringTrimRight(c[l])),e[l]=this.$computeWrapSplits(h,g,d),l++;else{h=[],k.walk(function(a,b,d,e){var f;if(a){f=this.$getDisplayTokens(a,h.length),f[0]=i;for(var g=1;g=n)h.pop();e[k.start.row]=this.$computeWrapSplits(h,g,d),l=k.end.row+1}}};var b=1,c=2,i=3,j=4,l=9,n=10,o=11,p=12;this.$computeWrapSplits=function(a,b){function g(b){var d=a.slice(e,b),g=d.length;d.join("").replace(/12/g,function(){g-=1}).replace(/2/g,function(){g-=1}),f+=g,c.push(f),e=b}if(a.length==0)return[];var c=[],d=a.length,e=0,f=0;while(d-e>b){var h=e+b;if(a[h]>=n){while(a[h]>=n)h++;g(h);continue}if(a[h]==i||a[h]==j){for(h;h!=e-1;h--)if(a[h]==i)break;if(h>e){g(h);continue}h=e+b;for(h;hk&&a[h]k&&a[h]==l)h--;if(h>k){g(++h);continue}h=e+b,g(h)}return c},this.$getDisplayTokens=function(a,d){var e=[],f;d=d||0;for(var g=0;g39&&h<48||h>57&&h<64?e.push(l):h>=4352&&q(h)?e.push(b,c):e.push(b)}return e},this.$getStringScreenWidth=function(a,b,c){if(b==0)return[0,0];b==null&&(b=c+a.length*Math.max(this.getTabSize(),2)),c=c||0;var d,e;for(e=0;e=4352&&q(d)?c+=2:c+=1;if(c>b)break}return[c,e]},this.getRowLength=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},this.getRowHeight=function(a,b){return this.getRowLength(b)*a.lineHeight},this.getScreenLastRowColumn=function(a){var b=this.screenToDocumentPosition(a,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},this.getDocumentLastRowColumn=function(a,b){var c=this.documentToScreenRow(a,b);return this.getScreenLastRowColumn(c)},this.getDocumentLastRowColumnPosition=function(a,b){var c=this.documentToScreenRow(a,b);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},this.getRowSplitData=function(a){return this.$useWrapMode?this.$wrapData[a]:undefined},this.getScreenTabSize=function(a){return this.$tabSize-a%this.$tabSize},this.screenToDocumentRow=function(a,b){return this.screenToDocumentPosition(a,b).row},this.screenToDocumentColumn=function(a,b){return this.screenToDocumentPosition(a,b).column},this.screenToDocumentPosition=function(a,b){if(a<0)return{row:0,column:0};var c,d=0,e=0,f,g=0,h=0,i=this.$rowCache;for(var j=0;j=a||d>=l)break;g+=h,d++,d>n&&(d=m.end.row+1,m=this.getNextFoldLine(d,m),n=m?m.start.row:Infinity),k&&i.push({docRow:d,screenRow:g})}if(m&&m.start.row<=d)c=this.getFoldDisplayLine(m),d=m.start.row;else{if(g+h<=a||d>l)return{row:l,column:this.getLine(l).length};c=this.getLine(d),m=null}if(this.$useWrapMode){var o=this.$wrapData[d];o&&(f=o[a-g],a>g&&o.length&&(e=o[a-g-1]||o[o.length-1],c=c.substring(e)))}return e+=this.$getStringScreenWidth(c,b)[1],this.$useWrapMode&&e>=f&&(e=f-1),m?m.idxToPosition(e):{row:d,column:e}},this.documentToScreenPosition=function(a,b){if(typeof b=="undefined")var c=this.$clipPositionToDocument(a.row,a.column);else c=this.$clipPositionToDocument(a,b);a=c.row,b=c.column;var d;if(this.$useWrapMode){d=this.$wrapData;if(a>d.length-1)return{row:this.getScreenLength(),column:d.length==0?0:d[d.length-1].length-1}}var e=0,f=null,g=null;g=this.getFoldAt(a,b,1),g&&(a=g.start.row,b=g.start.column);var h,i=0,j=this.$rowCache;for(var k=0;k=n){h=m.end.row+1;if(h>a)break;m=this.getNextFoldLine(h,m),n=m?m.start.row:Infinity}else h=i+1;e+=this.getRowLength(i),i=h,l&&j.push({docRow:i,screenRow:e})}var o="";m&&i>=n?(o=this.getFoldDisplayLine(m,a,b),f=m.start.row):(o=this.getLine(a).substring(0,b),f=a);if(this.$useWrapMode){var p=d[f],q=0;while(o.length>=p[q])e++,q++;o=o.substring(p[q-1]||0,o.length)}return{row:e,column:this.$getStringScreenWidth(o)[0]}},this.documentToScreenColumn=function(a,b){return this.documentToScreenPosition(a,b).column},this.documentToScreenRow=function(a,b){return this.documentToScreenPosition(a,b).row},this.getScreenLength=function(){var a=0,b=null;if(!this.$useWrapMode){a=this.getLength();var c=this.$foldData;for(var d=0;dg&&(f=b.end.row+1,b=this.$foldData[d++],g=b?b.start.row:Infinity)}return a}}).call(n.prototype),a("./edit_session/folding").Folding.call(n.prototype),a("./edit_session/bracket_match").BracketMatch.call(n.prototype),b.EditSession=n}),ace.define("ace/config",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}"no use strict";var d=a("./lib/lang"),e=function(){return this}(),f={packaged:!1,workerPath:"",modePath:"",themePath:"",suffix:".js"};b.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);return f[a]},b.set=function(a,b){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);f[a]=b},b.all=function(){return d.copyObject(f)},b.init=function(){f.packaged=a.packaged||c.packaged||e.define&&define.packaged;if(!e.document)return"";var d={},h="",i,j=document.getElementsByTagName("script");for(var k=0;kb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor,b=this.selectionLead;return this.isEmpty()?g.fromPoints(b,b):this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.moveCursorTo(0,0)},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column)),this.$desiredColumn=null},this.$moveSelection=function(a){var b=this.selectionLead;this.$isEmpty&&this.setSelectionAnchor(b.row,b.column),a.call(this)},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.getCursor(),b=this.session.getWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectAWord=function(){var a=this.getCursor(),b=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectLine=function(){var a=this.selectionLead.row,b,c=this.session.getFoldLine(a);c?(a=c.start.row,b=c.end.row):b=a,this.setSelectionAnchor(a,0),this.$moveSelection(function(){this.moveCursorTo(b+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(b.start.row,b.start.column);else if(a.column==0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var c=this.session.getTabSize();this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(a.column-c,a.column).split(" ").length-1==c?this.moveCursorBy(0,-c):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(b.end.row,b.end.column);else if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=c.length){this.moveCursorTo(a,c.length),this.moveCursorRight(),a0&&this.moveCursorWordLeft();return}if(g=this.session.tokenRe.exec(f))b-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(a,b)},this.moveCursorBy=function(a,b){var c=this.session.documentToScreenPosition(this.selectionLead.row,this.selectionLead.column);b===0&&(this.$desiredColumn?c.column=this.$desiredColumn:this.$desiredColumn=c.column);var d=this.session.screenToDocumentPosition(c.row+a,c.column);this.moveCursorTo(d.row,d.column+b,b===0)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b,c){var d=this.session.getFoldAt(a,b,1);d&&(a=d.start.row,b=d.start.column),this.$keepDesiredColumnOnChange=!0,this.selectionLead.setPosition(a,b),this.$keepDesiredColumnOnChange=!1,c||(this.$desiredColumn=null)},this.moveCursorToScreen=function(a,b,c){var d=this.session.screenToDocumentPosition(a,b);this.moveCursorTo(d.row,d.column,c)},this.detach=function(){this.selectionLead.detach(),this.selectionAnchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(a){var b=this.getRange();return a?(a.start.column=b.start.column,a.start.row=b.start.row,a.end.column=b.end.column,a.end.row=b.end.row):a=b,a.cursor=this.isBackwards()?a.start:a.end,a.desiredColumn=this.$desiredColumn,a}}).call(h.prototype),b.Selection=h}),ace.define("ace/range",["require","exports","module"],function(a,b,c){"use strict";var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.isEqual=function(a){return this.start.row==a.start.row&&this.end.row==a.end.row&&this.start.column==a.start.column&&this.end.column==a.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;return b=this.compare(c.row,c.column),b==1?(b=this.compare(d.row,d.column),b==1?2:b==0?1:0):b==-1?-2:(b=this.compare(d.row,d.column),b==-1?-1:b==1?42:0)},this.comparePoint=function(a){return this.compare(a.row,a.column)},this.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},this.intersects=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)||this.isStart(a,b)?!1:!0:!1},this.insideStart=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)?!1:!0:!1},this.insideEnd=function(a,b){return this.compare(a,b)==0?this.isStart(a,b)?!1:!0:!1},this.compare=function(a,b){return!this.isMultiLine()&&a===this.start.row?bthis.end.column?1:0:athis.end.row?1:this.start.row===a?b>=this.start.column?0:-1:this.end.row===a?b<=this.end.column?0:1:0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0&&/^[\w\d]/.test(h)||e<=g&&/[\w\d]$/.test(h))return;h=f.substring(c.start.column,c.end.column);if(!/^[\w\d]+$/.test(h))return;var i=a.getCursorPosition(),j={wrap:!0,wholeWord:!0,caseSensitive:!0,needle:h},k=a.$search.getOptions();a.$search.set(j);var l=a.$search.findAll(b);l.forEach(function(a){if(!a.contains(i.row,i.column)){var c=b.addMarker(a,"ace_selected_word","text");b.$selectionOccurrences.push(c)}}),a.$search.set(k)},this.clearSelectionHighlight=function(a){if(!a.session.$selectionOccurrences)return;a.session.$selectionOccurrences.forEach(function(b){a.session.removeMarker(b)}),a.session.$selectionOccurrences=[]},this.createModeDelegates=function(a){if(!this.$embeds)return;this.$modes={};for(var b=0;b1&&e[i].token.length!==j-1)throw new Error("Matching groups and length of the token array don't match in rule #"+i+" of state "+c);h[g]={rule:i,len:j},g+=j,f.push(k)}this.regExps[c]=new RegExp("(?:("+f.join(")|(")+")|(.))",b)}};(function(){this.getLineTokens=function(a,b){var c=b,d=this.rules[c],e=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;var g,h=[],i=0,j={type:null,value:""};while(g=f.exec(a)){var k="text",l=null,m=[g[0]];for(var n=0;n1&&(m=g.slice(n+2,n+1+e[n].len)),typeof l.token=="function"?k=l.token.apply(this,m):k=l.token,l.next&&(c=l.next,d=this.rules[c],e=this.matchMappings[c],i=f.lastIndex,f=this.regExps[c],f.lastIndex=i);break}if(m[0]){typeof k=="string"&&(m=[m.join("")],k=[k]);for(var n=0;n=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length),a},this.insert=function(a,b){if(!b||b.length===0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];return a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c);var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};return this._emit("change",{data:e}),d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};return this._emit("change",{data:d}),c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};return this._emit("change",{data:e}),d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);return a.start},this.removeInLine=function(a,b,c){if(b==c)return;var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};return this._emit("change",{data:i}),d.start},this.removeLines=function(a,b){var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};return this._emit("change",{data:e}),d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._emit("change",{data:g})},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=b.Anchor=function(a,b,c){this.document=a,typeof c=="undefined"?this.setPosition(b.row,b.column):this.setPosition(b,c),this.$onChange=this.onChange.bind(this),a.on("change",this.$onChange)};(function(){d.implement(this,e),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&c.start.row!=this.row)return;if(c.start.row>this.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0),c}}).call(f.prototype)}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(!c.running)return;var a=new Date,b=c.currentLine,d=c.doc,e=0,f=d.getLength();while(c.currentLine20){c.fireUpdateEvent(b,c.currentLine-1),c.running=setTimeout(c.$worker,20);return}}c.running=!1,c.fireUpdateEvent(b,f-1)}};(function(){d.implement(this,e),this.setTokenizer=function(a){this.tokenizer=a,this.lines=[],this.start(0)},this.setDocument=function(a){this.doc=a,this.lines=[],this.stop()},this.fireUpdateEvent=function(a,b){var c={first:a,last:b};this._emit("update",{data:c})},this.start=function(a){this.currentLine=Math.min(a||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(a,b){return this.$tokenizeRows(a,b)},this.getState=function(a){return this.$tokenizeRows(a,a)[0].state},this.$tokenizeRows=function(a,b){if(!this.doc||isNaN(a)||isNaN(b))return[{state:"start",tokens:[]}];var c=[],d="start",e=!1;a>0&&this.lines[a-1]?(d=this.lines[a-1].state,e=!0):a==0?(d="start",e=!0):this.lines.length>0&&(d=this.lines[this.lines.length-1].state);var f=this.doc.getLines(a,b);for(var g=a;g<=b;g++)if(!this.lines[g]){var h=this.tokenizer.getLineTokens(f[g-a]||"",d),d=h.state;c.push(h),e&&(this.lines[g]=h)}else{var h=this.lines[g];d=h.state,c.push(h)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(a,b,c){function h(){this.getFoldAt=function(a,b,c){var d=this.getFoldLine(a);if(!d)return null;var e=d.folds;for(var f=0;f=a)return e;if(e.end.row>a)return null}return null},this.getNextFoldLine=function(a,b){var c=this.$foldData,d=0;b&&(d=c.indexOf(b)),d==-1&&(d=0);for(d;d=a)return e}return null},this.getFoldedRowCount=function(a,b){var c=this.$foldData,d=b-a+1;for(var e=0;e=b){h=a?d-=b-h:d=0);break}g>=a&&(h>=a?d-=g-h:d-=g-a+1)}return d},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(a,b){return a.start.row-b.start.row}),a},this.addFold=function(a,b){var c=this.$foldData,d=!1,g;a instanceof f?g=a:g=new f(b,a),this.$clipRangeToDocument(g.range);var h=g.start.row,i=g.start.column,j=g.end.row,k=g.end.column;if(g.placeholder.length<2)throw"Placeholder has to be at least 2 characters";if(h==j&&k-i<2)throw"The range has to be at least 2 characters width";var l=this.getFoldAt(h,i,1),m=this.getFoldAt(j,k,-1);if(l&&m==l)return l.addSubFold(g);if(l&&!l.range.isStart(h,i)||m&&!m.range.isEnd(j,k))throw"A fold can't intersect already existing fold"+g.range+l.range;var n=this.getFoldsInRange(g.range);n.length>0&&(this.removeFolds(n),g.subFolds=n);for(var o=0;othis.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(a),this.folds.sort(function(a,b){return-a.range.compareEnd(b.start.row,b.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else{if(a.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column}a.foldLine=this},this.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},this.walk=function(a,b,c){var d=0,e=this.folds,f,g,h,i=!0;b==null&&(b=this.end.row,c=this.end.column);for(var j=0;j=this.$rowTokens.length){this.$row+=1;if(this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row,this.$row)[0].tokens,this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,b=this.$tokenIndex,c=a[b].start;if(c!==undefined)return c;c=0;while(b>0)b-=1,c+=a[b].value.length;return c}}).call(d.prototype),b.TokenIterator=d}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator"],function(a,b,c){function e(){this.findMatchingBracket=function(a){if(a.column==0)return null;var b=this.getLine(a.row).charAt(a.column-1);if(b=="")return null;var c=b.match(/([\(\[\{])|([\)\]\}])/);return c?c[1]?this.$findClosingBracket(c[1],a):this.$findOpeningBracket(c[2],a):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("rparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn()-2,j=g.value;for(;;){while(i>=0){var k=j.charAt(i);if(k==c){e-=1;if(e==0)return{row:f.getCurrentTokenRow(),column:i+f.getCurrentTokenColumn()}}else k==a&&(e+=1);i-=1}do g=f.stepBackward();while(g&&!h.test(g.type));if(g==null)break;j=g.value,i=j.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("lparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn();for(;;){var j=g.value,k=j.length;while(i=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function k(e){var f=a.getLine(e);return b&&e==c.end.row&&(f=f.substring(0,c.end.column)),j&&e==d.row&&(f=f.substring(0,d.column)),f}var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"start":"end"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap,j=!1;return{forEach:function(a){var b=d.row,c=k(b),g=d.column,l=!1;j=!1;while(!a(c,g,b)){if(l)return;b++,g=0;if(b>h){if(!i)return;b=e,g=f,j=!0}b==d.row&&(l=!0),c=k(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"end":"start"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1,n=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(j0},this.hasRedo=function(){return this.$redoStack.length>0}}).call(d.prototype),b.UndoManager=d}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/config","ace/lib/net","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter","text!ace/css/editor.css"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/useragent"),h=a("./config"),i=a("./lib/net"),j=a("./layer/gutter").Gutter,k=a("./layer/marker").Marker,l=a("./layer/text").Text,m=a("./layer/cursor").Cursor,n=a("./scrollbar").ScrollBar,o=a("./renderloop").RenderLoop,p=a("./lib/event_emitter").EventEmitter,q=a("text!./css/editor.css");e.importCssString(q,"ace_editor");var r=function(a,b){var c=this;this.container=a,e.addCssClass(a,"ace_editor"),this.setTheme(b),this.$gutter=e.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=e.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=e.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new j(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onResize.bind(this,!0)),this.$markerBack=new k(this.content);var d=this.$textLayer=new l(this.content);this.canvas=d.element,this.$markerFront=new k(this.content),this.characterWidth=d.getCharacterWidth(),this.lineHeight=d.getLineHeight(),this.$cursorLayer=new m(this.content),this.$cursorPadding=8,this.$horizScroll=!0,this.$horizScrollAlwaysVisible=!0,this.$animatedScroll=!1,this.scrollBar=new n(a),this.scrollBar.addEventListener("scroll",function(a){c.session.setScrollTop(a.data)}),this.scrollTop=0,this.scrollLeft=0,f.addListener(this.scroller,"scroll",function(){var a=c.scroller.scrollLeft;c.scrollLeft=a,c.session.setScrollLeft(a),a==0?c.$gutter.className="ace_gutter":c.$gutter.className="ace_gutter horscroll"}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){c.characterWidth=d.getCharacterWidth(),c.lineHeight=d.getLineHeight(),c.$updatePrintMargin(),c.onResize(!0),c.$loop.schedule(c.CHANGE_FULL)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.setPadding(4),this.$updatePrintMargin()};(function(){this.showGutter=!0,this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,d.implement(this,p),this.setSession=function(a){this.session=a,this.$cursorLayer.setSession(a),this.$markerBack.setSession(a),this.$markerFront.setSession(a),this.$gutterLayer.setSession(a),this.$textLayer.setSession(a),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(a,b){b===undefined&&(b=Infinity),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)return;if(bd&&this.session.setScrollTop(d),this.scrollTop+this.$size.scrollerHeightc&&(c0)return!0;if(b>0&&this.session.getScrollTop()+this.$size.scrollerHeighth&&(e=g.end.row+1,g=this.session.getNextFoldLine(e,g),h=g?g.start.row:Infinity);if(e>f)break;var j=this.$annotations[e]||b;c.push("
",e+1);if(i){var k=i[e];k==null&&(k=i[e]=this.session.getFoldWidget(e)),k&&c.push("")}var l=this.session.getRowLength(e)-1;while(l--)c.push("
¦");c.push("
"),e++}this.element=d.setInnerHtml(this.element,c.join("")),this.element.style.height=a.minHeight+"px";var m=this.element.offsetWidth;m!==this.gutterWidth&&(this.gutterWidth=m,this._emit("changeGutterWidth",m))},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(a){a?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=a},this.getShowFoldWidgets=function(){return this.$showFoldWidgets}}).call(g.prototype),b.Gutter=g}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../range").Range,e=a("../lib/dom"),f=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.update=function(a){var a=a||this.config;if(!a)return;this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],f=d.range.clipRows(a.firstRow,a.lastRow);if(f.isEmpty())continue;f=f.toScreenRange(this.session);if(d.renderer){var g=this.$getTop(f.start.row,a),h=Math.round(this.$padding+f.start.column*a.characterWidth);d.renderer(b,f,h,g,a)}else f.isMultiLine()?d.type=="text"?this.drawTextMarker(b,f,d.clazz,a):this.drawMultiLineMarker(b,f,d.clazz,a,d.type):this.drawSingleLineMarker(b,f,d.clazz+" start",a,null,d.type)}this.element=e.setInnerHtml(this.element,b.join(""))},this.$getTop=function(a,b){return(a-b.firstRowScreen)*b.lineHeight},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.session.getScreenLastRowColumn(f));this.drawSingleLineMarker(a,g,c+" start",e,1,"text"),f=b.end.row,g=new d(f,0,f,b.end.column),this.drawSingleLineMarker(a,g,c,e,0,"text");for(f=b.start.row+1;f
"),j=this.$getTop(b.end.row,d),i=Math.round(b.end.column*d.characterWidth),a.push("
"),h=(b.end.row-b.start.row-1)*d.lineHeight;if(h<0)return;j=this.$getTop(b.start.row+1,d),a.push("
")},this.drawSingleLineMarker=function(a,b,c,d,e,f){var g=f==="background"?0:this.$padding,h=d.lineHeight;if(f==="background")var i=d.width;else i=Math.round((b.end.column+(e||0)-b.start.column)*d.characterWidth);var j=this.$getTop(b.start.row,d),k=Math.round(g+b.start.column*d.characterWidth);a.push("
")}}).call(f.prototype),b.Marker=f}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/dom"),f=a("../lib/lang"),g=a("../lib/useragent"),h=a("../lib/event_emitter").EventEmitter,i=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes()||{width:0,height:0},this.$pollSizeChanges()};(function(){d.implement(this,h),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.$padding=0,this.setPadding=function(a){this.$padding=a,this.element.style.padding="0 "+a+"px"},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.checkForSizeChanges=function(){var a=this.$measureSizes();a&&(this.$characterSize.width!==a.width||this.$characterSize.height!==a.height)&&(this.$characterSize=a,this._emit("changeCharacterSize",{data:a}))},this.$pollSizeChanges=function(){var a=this;this.$pollSizeChangesTimer=setInterval(function(){a.checkForSizeChanges()},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=g.isIE||g.isOldGecko?function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=e.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top=-a*40+"px",c.visibility="hidden",c.position="fixed",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a);if(this.element.ownerDocument.body)this.element.ownerDocument.body.appendChild(b);else{var d=this.element.parentNode;while(!e.hasCssClass(d,"ace_editor"))d=d.parentNode;d.appendChild(b)}}if(!this.element.offsetWidth)return null;var c=this.$measureNode.style,g=e.computedStyle(this.element);for(var h in this.$fontStyles)c[h]=g[h];var i={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return i.width==0||i.height==0?null:i}:function(){if(!this.$measureNode){var a=this.$measureNode=e.createElement("div"),b=a.style;b.width=b.height="auto",b.left=b.top="-100px",b.visibility="hidden",b.position="fixed",b.overflow="visible",b.whiteSpace="nowrap",a.innerHTML="X";var c=this.element.parentNode;while(c&&!e.hasCssClass(c,"ace_editor"))c=c.parentNode;if(!c)return this.$measureNode=null;c.appendChild(a)}var d=this.$measureNode.getBoundingClientRect(),f={height:d.height,width:d.width};return f.width==0||f.height==0?null:f},this.setSession=function(a){this.session=a},this.showInvisibles=!1,this.setShowInvisibles=function(a){return this.showInvisibles==a?!1:(this.showInvisibles=a,!0)},this.$tabStrings=[],this.$computeTabString=function(){var a=this.session.getTabSize(),b=this.$tabStrings=[0];for(var c=1;c"+this.TAB_CHAR+(new Array(c)).join(" ")+"
"):b.push((new Array(c+1)).join(" "))},this.updateLines=function(a,b,c){this.$computeTabString(),(this.config.lastRow!=a.lastRow||this.config.firstRow!=a.firstRow)&&this.scrollLines(a),this.config=a;var d=Math.max(b,a.firstRow),f=Math.min(c,a.lastRow),g=this.element.childNodes,h=0;for(var i=a.firstRow;i0;d--)c.removeChild(c.firstChild);if(b.lastRow>a.lastRow)for(var d=this.session.getFoldedRowCount(a.lastRow+1,b.lastRow);d>0;d--)c.removeChild(c.lastChild);if(a.firstRowb.lastRow){var e=this.$renderLinesFragment(a,b.lastRow+1,a.lastRow);c.appendChild(e)}},this.$renderLinesFragment=function(a,b,c){var d=this.element.ownerDocument.createDocumentFragment(),f=b,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>c)break;var i=e.createElement("div"),j=[],k=this.session.getTokens(f,f);k.length==1&&this.$renderLine(j,f,k[0].tokens,!1),i.innerHTML=j.join("");if(this.$useLineGroups())i.className="ace_line_group",d.appendChild(i);else{var l=i.childNodes;while(l.length)d.appendChild(l[0])}f++}return d},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=a.firstRow,d=a.lastRow,f=c,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>d)break;this.$useLineGroups()&&b.push("
");var i=this.session.getTokens(f,f);i.length==1&&this.$renderLine(b,f,i[0].tokens,!1),this.$useLineGroups()&&b.push("
"),f++}this.element=e.setInnerHtml(this.element,b.join(""))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(a,b,c,d){var e=this,f=/\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g,h=function(a,c,d,f,h){if(a.charCodeAt(0)==32)return(new Array(a.length+1)).join(" ");if(a==" "){var i=e.session.getScreenTabSize(b+f);return b+=i-1,e.$tabStrings[i]}if(a=="&")return g.isOldGecko?"&":"&";if(a=="<")return"<";if(a==" "){var j=e.showInvisibles?"ace_cjk ace_invisible":"ace_cjk",k=e.showInvisibles?e.SPACE_CHAR:"";return b+=1,""+k+""}if(a.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)){if(e.showInvisibles){var k=(new Array(a.length+1)).join(e.SPACE_CHAR);return""+k+""}return" "}return b+=1,""+a+""},i=d.replace(f,h);if(!this.$textToken[c.type]){var j="ace_"+c.type.replace(/\./g," ace_"),k="";c.type=="fold"&&(k=" style='width:"+c.value.length*this.config.characterWidth+"px;' "),a.push("",i,"")}else a.push(i);return b+d.length},this.$renderLineCore=function(a,b,c,d,e){var f=0,g=0,h,i=0,j=this;!d||d.length==0?h=Number.MAX_VALUE:h=d[0],e||a.push("
");for(var k=0;k=h)i=j.$renderToken(a,i,l,m.substring(0,h-f)),m=m.substring(h-f),f=h,e||a.push("
","
"),g++,i=0,h=d[g]||Number.MAX_VALUE;m.length!=0&&(f+=m.length,i=j.$renderToken(a,i,l,m))}}this.showInvisibles&&(b!==this.session.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+"")),e||a.push("
")},this.$renderLine=function(a,b,c,d){if(!this.session.isRowFolded(b)){var e=this.session.getRowSplitData(b);this.$renderLineCore(a,b,c,e,d)}else this.$renderFoldLine(a,b,c,d)},this.$renderFoldLine=function(a,b,c,d){function h(a,b,c){var d=0,e=0;while(e+a[d].value.lengthc-b&&(f=f.substring(0,c-b)),g.push({type:a[d].type,value:f}),e=b+f.length,d+=1}while(ec&&(f=f.substring(0,c-e)),g.push({type:a[d].type,value:f}),e+=f.length,d+=1}}var e=this.session,f=e.getFoldLine(b),g=[];f.walk(function(a,b,d,e,f){a?g.push({type:"fold",value:a}):(f&&(c=this.session.getTokens(b,b)[0].tokens),c.length!=0&&h(c,e,d))}.bind(this),f.end.row,this.session.getLine(f.end.row).length);var i=this.session.$useWrapMode?this.session.$wrapData[b]:null;this.$renderLineCore(a,b,g,i,d)},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(i.prototype),b.Text=i}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../lib/dom"),e=function(a){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.cursors=[],this.cursor=this.addCursor()};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.addCursor=function(){var a=d.createElement("div"),b="ace_cursor";return this.isVisible||(b+=" ace_hidden"),this.overwrite&&(b+=" ace_overwrite"),a.className=b,this.element.appendChild(a),this.cursors.push(a),a},this.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},this.hideCursor=function(){this.isVisible=!1;for(var a=this.cursors.length;a--;)d.addCssClass(this.cursors[a],"ace_hidden");clearInterval(this.blinkId)},this.showCursor=function(){this.isVisible=!0;for(var a=this.cursors.length;a--;)d.removeCssClass(this.cursors[a],"ace_hidden");this.element.style.visibility="",this.restartTimer()},this.restartTimer=function(){clearInterval(this.blinkId);if(!this.isVisible)return;var a=this.cursors.length==1?this.cursor:this.element;this.blinkId=setInterval(function(){a.style.visibility="hidden",setTimeout(function(){a.style.visibility=""},400)},1e3)},this.getPixelPosition=function(a,b){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var c=this.session.documentToScreenPosition(a),d=Math.round(this.$padding+c.column*this.config.characterWidth),e=(c.row-(b?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:d,top:e}},this.update=function(a){this.config=a;if(this.session.selectionMarkerCount>0){var b=this.session.$selectionMarkers,c=0,d,e=0;for(var c=b.length;c--;){d=b[c];var f=this.getPixelPosition(d.cursor,!0),g=(this.cursors[e++]||this.addCursor()).style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px"}if(e>1)while(this.cursors.length>e)this.removeCursor()}else{var f=this.getPixelPosition(null,!0),g=this.cursor.style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px";while(this.cursors.length>1)this.removeCursor()}var h=this.session.getOverwrite();h!=this.overwrite&&this.$setOverite(h),this.restartTimer()},this.$setOverite=function(a){this.overwrite=a;for(var b=this.cursors.length;b--;)a?d.addCssClass(this.cursors[b],"ace_overwrite"):d.removeCssClass(this.cursors[b],"ace_overwrite")},this.destroy=function(){clearInterval(this.blinkId)}}).call(e.prototype),b.Cursor=e}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/event_emitter").EventEmitter,h=function(a){this.element=e.createElement("div"),this.element.className="ace_sb",this.inner=e.createElement("div"),this.element.appendChild(this.inner),a.appendChild(this.element),this.width=e.scrollbarWidth(a.ownerDocument),this.element.style.width=(this.width||15)+5+"px",f.addListener(this.element,"scroll",this.onScroll.bind(this))};(function(){d.implement(this,g),this.onScroll=function(){this._emit("scroll",{data:this.element.scrollTop})},this.getWidth=function(){return this.width},this.setHeight=function(a){this.element.style.height=a+"px"},this.setInnerHeight=function(a){this.inner.style.height=a+"px"},this.setScrollTop=function(a){this.element.scrollTop=a}}).call(h.prototype),b.ScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(a,b,c){"use strict";var d=a("./lib/event"),e=function(a,b){this.onRender=a,this.pending=!1,this.changes=0,this.window=b||window};(function(){this.schedule=function(a){this.changes=this.changes|a;if(!this.pending){this.pending=!0;var b=this;d.nextTick(function(){b.pending=!1;var a;while(a=b.changes)b.changes=0,b.onRender(a)},this.window)}}}).call(e.prototype),b.RenderLoop=e}),ace.define("text!ace/css/editor.css",[],"@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);\n\n.ace_editor {\n position: absolute;\n overflow: hidden;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace;\n font-size: 12px;\n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n cursor: text;\n}\n\n.ace_composition {\n position: absolute;\n background: #555;\n color: #DDD;\n z-index: 4;\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n height: 100%;\n width: auto;\n cursor: default;\n z-index: 1000;\n}\n\n.ace_gutter.horscroll {\n box-shadow: 0px 0px 20px rgba(0,0,0,0.4);\n}\n\n.ace_gutter-cell {\n padding-left: 19px;\n padding-right: 6px;\n}\n\n.ace_gutter-cell.ace_error {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info {\n background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0;\n}\n\n.ace_editor .ace_print_margin_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden;\n margin: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n.ace_editor .ace_print_margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_editor textarea {\n position: fixed;\n z-index: 0;\n width: 10px;\n height: 30px;\n opacity: 0;\n background: transparent;\n appearance: none;\n -moz-appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n white-space: nowrap;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter .ace_layer {\n position: relative;\n min-width: 40px;\n text-align: right;\n pointer-events: auto;\n}\n\n.ace_text-layer {\n color: black;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n}\n\n.ace_cursor.ace_hidden {\n opacity: 0.2;\n}\n\n.ace_editor.multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_gutter .ace_gutter_active_line{\n background-color : #dcdcdc;\n}\n\n.ace_marker-layer .ace_selected_word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n \n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n border-radius: 2px;\n \n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n}\n\n.ace_dragging .ace_content {\n cursor: move;\n}\n\n.ace_folding-enabled > .ace_gutter-cell {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n\n margin: 0 -12px 1px 1px;\n display: inline-block;\n height: 14px;\n width: 11px;\n vertical-align: text-bottom;\n \n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat;\n background-position: center 5px;\n\n border-radius: 3px;\n}\n\n.ace_fold-widget.end {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget.closed {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n background-position: center 4px;\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n\n.ace_fold-widget.invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n"),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor"],function(a,b,c){function j(a,b,c){return i.$options.wrap=!0,i.$options.needle=b,i.$options.backwards=c==-1,i.find(a)}function m(a,b){return a.row==b.row&&a.column==b.column}function n(a){a.$onAddRange=a.$onAddRange.bind(a),a.$onRemoveRange=a.$onRemoveRange.bind(a),a.$onMultiSelect=a.$onMultiSelect.bind(a),a.$onSingleSelect=a.$onSingleSelect.bind(a),b.onSessionChange.call(a,a),a.on("changeSession",b.onSessionChange.bind(a)),a.on("mousedown",g),a.commands.addCommands(b.commands.defaultCommands),o(a)}function o(a){function e(){c&&(d.style.cursor="",c=!1)}var b=a.textInput.getElement(),c=!1,d=a.renderer.content;b.addEventListener("keydown",function(a){a.keyCode==18&&!(a.ctrlKey||a.shiftKey||a.metaKey)?c||(d.style.cursor="crosshair",c=!0):c&&(d.style.cursor="")}),b.addEventListener("keyup",e),b.addEventListener("blur",e)}var d=a("./range_list").RangeList,e=a("./range").Range,f=a("./selection").Selection,g=a("./mouse/multi_select_handler").onMouseDown;b.commands=a("./commands/multi_select_commands");var h=a("./search").Search,i=new h,k=a("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(k.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(a,b){if(!a)return;if(!this.inMultiSelectMode&&this.rangeCount==0){var c=this.toOrientedRange();if(a.intersects(c))return b||this.fromOrientedRange(a);this.rangeList.add(c),this.$onAddRange(c)}a.cursor||(a.cursor=a.end);var d=this.rangeList.add(a);return this.$onAddRange(a),d.length&&this.$onRemoveRange(d),this.rangeCount>1&&!this.inMultiSelectMode&&(this._emit("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),b||this.fromOrientedRange(a)},this.toSingleRange=function(a){a=a||this.ranges[0];var b=this.rangeList.removeAll();b.length&&this.$onRemoveRange(b),a&&this.fromOrientedRange(a)},this.substractPoint=function(a){var b=this.rangeList.substractPoint(a);if(b)return this.$onRemoveRange(b),b[0]},this.mergeOverlappingRanges=function(){var a=this.rangeList.merge();a.length?this.$onRemoveRange(a):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(a){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(a),this._emit("addRange",{range:a})},this.$onRemoveRange=function(a){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var b=this.rangeList.ranges.pop();a.push(b),this.rangeCount=0}for(var c=a.length;c--;){var d=this.ranges.indexOf(a[c]);this.ranges.splice(d,1)}this._emit("removeRange",{ranges:a}),this.rangeCount==0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._emit("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),b=b||this.ranges[0],b&&!b.isEqual(this.getRange())&&this.fromOrientedRange(b)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new d,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeList.ranges.concat()},this.splitIntoLines=function(){if(this.rangeCount>1){var a=this.rangeList.ranges,b=a[a.length-1],c=e.fromPoints(a[0].start,b.end);this.toSingleRange(),this.setSelectionRange(c,b.cursor==b.start)}else{var d=this.session.documentToScreenPosition(this.selectionLead),f=this.session.documentToScreenPosition(this.selectionAnchor),g=this.rectangularRangeBlock(d,f);g.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(a,b,c){var d=[],f=a.column0)p--;if(p>0){var q=0;while(d[q].isEmpty())q++}for(var r=p;r>=q;r--)d[r].isEmpty()&&d.splice(r,1)}return d}}.call(f.prototype);var l=a("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(a){a.cursor||(a.cursor=a.end);var b=this.getSelectionStyle();return a.marker=this.session.addMarker(a,"ace_selection",b),this.session.$selectionMarkers.push(a),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,a},this.removeSelectionMarker=function(a){if(!a.marker)return;this.session.removeMarker(a.marker);var b=this.session.$selectionMarkers.indexOf(a);b!=-1&&this.session.$selectionMarkers.splice(b,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(a){var b=this.session.$selectionMarkers;for(var c=a.length;c--;){var d=a[c];if(!d.marker)continue;this.session.removeMarker(d.marker);var e=b.indexOf(d);e!=-1&&b.splice(e,1)}this.session.selectionMarkerCount=b.length},this.$onAddRange=function(a){this.addSelectionMarker(a.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(a){this.removeSelectionMarkers(a.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(a){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("multiselect"),this.keyBinding.addKeyboardHandler(b.commands.keyboardHandler),this.commands.on("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(a){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("multiselect"),this.keyBinding.removeKeyboardHandler(b.commands.keyboardHandler),this.commands.removeEventListener("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelectExec=function(a){var b=a.command,c=a.editor;b.multiSelectAction?b.multiSelectAction=="forEach"?c.forEachSelection(b,a.args):b.multiSelectAction=="single"?(c.exitMultiSelectMode(),b.exec(c,a.args||{})):b.multiSelectAction(c,a.args||{}):(b.exec(c,a.args||{}),c.multiSelect.addRange(c.multiSelect.toOrientedRange()),c.multiSelect.mergeOverlappingRanges()),a.preventDefault()},this.forEachSelection=function(a,b){if(this.inVirtualSelectionMode)return;var c=this.session,d=this.selection,e=d.rangeList,g=d._eventRegistry;d._eventRegistry={};var h=new f(c);this.inVirtualSelectionMode=!0;for(var i=e.ranges.length;i--;)h.fromOrientedRange(e.ranges[i]),this.selection=c.selection=h,a.exec(this,b||{}),h.toOrientedRange(e.ranges[i]);h.detach(),this.selection=c.selection=d,this.inVirtualSelectionMode=!1,d._eventRegistry=g,d.mergeOverlappingRanges(),this.onCursorChange(),this.onSelectionChange()},this.exitMultiSelectMode=function(){if(this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getCopyText=function(){var a="";if(this.inMultiSelectMode){var b=this.multiSelect.rangeList.ranges;a=[];for(var c=0;c0)continue;return f==0?d:(f=this.comparePoints(a,e.start),f>=0?d:-d-1)}return-d-1},this.add=function(a){var b=this.pointIndex(a.start);b<0&&(b=-b-1);var c=this.pointIndex(a.end,b);return c<0?c=-c-1:c++,this.ranges.splice(b,c-b,a)},this.addList=function(a){var b=[];for(var c=a.length;c--;)b.push.call(b,this.add(a[c]));return b},this.substractPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges.splice(b,1)},this.merge=function(){var a=[],b=this.ranges,c=b[0],d;for(var e=1;e=0},this.containsPoint=function(a){return this.pointIndex(a)>=0},this.rangeAtPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges[b]},this.clipRows=function(a,b){var c=this.ranges;if(c[0].start.row>b||c[c.length-1].start.rowe)break;l.start.row==e&&l.start.column>=c.column&&(l.start.column+=h,l.start.row+=g),l.end.row==e&&l.end.column>=c.column&&(l.end.column+=h,l.end.row+=g)}if(g!=0&&j=this.pos.column&&c.start.column<=this.pos.column+this.length+1){var f=c.start.column-this.pos.column;this.length+=e;if(!this.session.$fromUndo){if(b.action==="insertText")for(var g=this.others.length-1;g>=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=this.pos.column&&b.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var a=0;a1&&h(b,"")>-1&&(i=RegExp(this.source,d.replace.call(g(this),"g","")),d.replace.call(a.slice(b.index),i,function(){for(var a=1;ab.index&&this.lastIndex--}return b},f||(RegExp.prototype.test=function(a){var b=d.exec.call(this,a);return b&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--,!!b})}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(a,b,c){function p(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=g.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,h=c.apply(f,d.concat(g.call(arguments)));return h!==null&&Object(h)===h?h:f}return c.apply(b,d.concat(g.call(arguments)))};return e});var d=Function.prototype.call,e=Array.prototype,f=Object.prototype,g=e.slice,h=d.bind(f.toString),i=d.bind(f.hasOwnProperty),j,k,l,m,n;if(n=i(f,"__defineGetter__"))j=d.bind(f.__defineGetter__),k=d.bind(f.__defineSetter__),l=d.bind(f.__lookupGetter__),m=d.bind(f.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return h(b)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b){var c=G(this),d=arguments[1],e=0,f=c.length>>>0;if(h(b)!="[object Function]")throw new TypeError;while(e>>0,e=Array(d),f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=[],f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e=0,f;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);for(;e>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e,f=d-1;if(arguments.length>=2)e=arguments[1];else do{if(f in c){e=c[f--];break}if(--f<0)throw new TypeError}while(!0);do f in this&&(e=b.call(void 0,e,c[f],f,c));while(f--);return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=G(this),d=c.length>>>0;if(!d)return-1;var e=0;arguments.length>1&&(e=E(arguments[1])),e=e>=0?e:Math.max(0,d+e);for(;e>>0;if(!d)return-1;var e=d-1;arguments.length>1&&(e=Math.min(e,E(arguments[1]))),e=e>=0?e:d-Math.abs(e);for(;e>=0;e--)if(e in c&&b===c[e])return e;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||(b.constructor?b.constructor.prototype:f)});if(!Object.getOwnPropertyDescriptor){var o="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(o+b);if(!i(b,c))return;var d,e,g;d={enumerable:!0,configurable:!0};if(n){var h=b.__proto__;b.__proto__=f;var e=l(b,c),g=m(b,c);b.__proto__=h;if(e||g)return e&&(d.get=e),g&&(d.set=g),d}return d.value=b[c],d}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={__proto__:null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}return c!==void 0&&Object.defineProperties(d,c),d});if(Object.defineProperty){var q=p({}),r=typeof document=="undefined"||p(document.createElement("div"));if(!q||!r)var s=Object.defineProperty}if(!Object.defineProperty||s){var t="Property description must be an object: ",u="Object.defineProperty called on non-object: ",v="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(u+b);if(typeof d!="object"&&typeof d!="function"||d===null)throw new TypeError(t+d);if(s)try{return s.call(Object,b,c,d)}catch(e){}if(i(d,"value"))if(n&&(l(b,c)||m(b,c))){var g=b.__proto__;b.__proto__=f,delete b[c],b[c]=d.value,b.__proto__=g}else b[c]=d.value;else{if(!n)throw new TypeError(v);i(d,"get")&&j(b,c,d.get),i(d,"set")&&k(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)i(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(w){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){if(Object(b)===b)throw new TypeError;var c="";while(i(b,c))c+="?";b[c]=!0;var d=i(b,c);return delete b[c],d});if(!Object.keys){var x=!0,y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],z=y.length;for(var A in{toString:null})x=!1;Object.keys=function H(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)i(a,b)&&H.push(b);if(x)for(var c=0,d=z;c9999?"+":"")+("00000"+Math.abs(e)).slice(0<=e&&e<=9999?-4:-6),c=b.length;while(c--)d=b[c],d<10&&(b[c]="0"+d);return e+"-"+b.slice(0,2).join("-")+"T"+b.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(b){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(a){var b=function e(b,c,d,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=j==1&&String(b)===b?new a(e.parse(b)):j>=7?new a(b,c,d,f,g,h,i):j>=6?new a(b,c,d,f,g,h):j>=5?new a(b,c,d,f,g):j>=4?new a(b,c,d,f):j>=3?new a(b,c,d):j>=2?new a(b,c):j>=1?new a(b):new a;return k.constructor=e,k}return a.apply(this,arguments)},c=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var d in a)b[d]=a[d];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;var g=+e.pop(),h=+e.pop(),i=e.pop(),j=0;if(i){if(h>23||g>59)return NaN;j=(h*60+g)*6e4*(i=="+"?-1:1)}var k=+e[0];return 0<=k&&k<=99?(e[0]=k+400,a.UTC.apply(this,e)+j-126227808e5):a.UTC.apply(this,e)+j}return a.parse.apply(this,arguments)},b}(Date));var B=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||B.trim()){B="["+B+"]";var C=new RegExp("^"+B+B+"*"),D=new RegExp(B+B+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(D,"")}}var E=function(a){return a=+a,a!==a?a=0:a!==0&&a!==1/0&&a!==-Infinity&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a},F="a"[0]!="a",G=function(a){if(a==null)throw new TypeError;return F&&typeof a=="string"&&a?a.split(""):Object(a)}}),ace.define("ace/lib/dom",["require","exports","module"],function(a,b,c){"use strict";var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}return d&&c.push(b),a.className=c.join(" "),d},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.hasCssString=function(a,b){var c=0,d;b=b||document;if(b.createStyleSheet&&(d=b.styleSheets)){while(c5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isOldIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko||e.isOpera){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){return h=a.keyIdentifier||a.keyCode,g(c,a,a.keyCode)})}};if(window.postMessage){var h=1;b.nextTick=function(a,c){c=c||window;var d="zero-timeout-message-"+h;b.addListener(c,"message",function e(f){f.data==d&&(b.stopPropagation(f),b.removeListener(c,"message",e),a())}),c.postMessage(d,"*")}}else b.nextTick=function(a,b){b=b||window,window.setTimeout(a,0)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(a,b,c){"use strict";var d=a("./oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(var b in a.FUNCTION_KEYS){var c=a.FUNCTION_KEYS[b].toUpperCase();a[c]=parseInt(b,10)}return d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS),a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),ace.define("ace/lib/oop",["require","exports","module"],function(a,b,c){"use strict",b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(a,b,c){"use strict";var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),b.isOldIE=b.isIE&&b.isIE<9,b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOldGecko=b.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isChrome=parseFloat(e.split(" Chrome/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.isIPad=e.indexOf("iPad")>=0,b.isTouchPad=e.indexOf("TouchPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands"],function(a,b,c){"use strict",a("./lib/fixoldbrowsers");var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/useragent"),g=a("./keyboard/textinput").TextInput,h=a("./mouse/mouse_handler").MouseHandler,i=a("./mouse/fold_handler").FoldHandler,j=a("./keyboard/keybinding").KeyBinding,k=a("./edit_session").EditSession,l=a("./search").Search,m=a("./range").Range,n=a("./lib/event_emitter").EventEmitter,o=a("./commands/command_manager").CommandManager,p=a("./commands/default_commands").commands,q=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.commands=new o(f.isMac?"mac":"win",p),this.textInput=new g(a.getTextAreaContainer(),this),this.keyBinding=new j(this),f.isIPad||(this.$mouseHandler=new h(this),new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.setSession(b||new k(""))};(function(){d.implement(this,n),this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session==a)return;if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:a,oldSession:b})},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.setFontSize=function(a){this.container.style.fontSize=a,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket","text")}},10)},this.focus=function(){var a=this;setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.$cursorChange=function(){this.renderer.updateCursor(),this.renderer.moveTextAreaToCursor(this.textInput.getElement())},this.onDocumentChange=function(a){var b=a.data,c=b.range,d;c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines"?d=c.end.row:d=Infinity,this.renderer.updateLines(c.start.row,d),this._emit("change",a),this.$cursorChange()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$updateHighlightActiveLine(),this.$updateHighlightGutterLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),a.$highlightLineMarker=null;if(this.$highlightActiveLine){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row);if(this.getSelectionStyle()!="line"||!this.selection.isMultiLine()){var d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","background")}}},this.$updateHighlightGutterLine=function(){typeof this.$lastrow=="number"&&this.renderer.removeGutterDecoration(this.$lastrow,"ace_gutter_active_line"),this.$lastrow=null,this.$highlightGutterLine&&this.renderer.addGutterDecoration(this.$lastrow=this.getCursorPosition().row,"ace_gutter_active_line")},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine(),this.$updateHighlightGutterLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.$updateHighlightGutterLine(),this.renderer.updateFull()},this.getCopyText=function(){var a="";return this.selection.isEmpty()||(a=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",a),a},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(a){this._emit("paste",a),this.insert(a)},this.insert=function(a){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace(" ",this.session.getTabString());if(!this.selection.isEmpty())d=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)==" "?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}i&&c.autoOutdent(h,b,d.row)},this.onTextInput=function(a){this.keyBinding.onTextInput(a)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(a){this.$mouseHandler.setDragDelay(a)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(a){if(this.$selectionStyle==a)return;this.$selectionStyle=a,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:a})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){if(this.$highlightActiveLine==a)return;this.$highlightActiveLine=a,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightGutterLine=!0,this.setHighlightGutterLine=function(a){if(this.$highlightGutterLine==a)return;this.$highlightGutterLine=a,this.$updateHighlightGutterLine()},this.getHighlightGutterLine=function(){return this.$highlightGutterLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){if(this.$highlightSelectedWord==a)return;this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setShowInvisibles=function(a){if(this.getShowInvisibles()==a)return;this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.setShowFoldWidgets=function(a){var b=this.renderer.$gutterLayer;if(b.getShowFoldWidgets()==a)return;this.renderer.$gutterLayer.setShowFoldWidgets(a),this.$showFoldWidgets=a,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.setFadeFoldWidgets=function(a){this.renderer.setFadeFoldWidgets(a)},this.getFadeFoldWidgets=function(){return this.renderer.getFadeFoldWidgets()},this.remove=function(a){this.selection.isEmpty()&&(a=="left"?this.selection.selectLeft():this.selection.selectRight());var b=this.getSelectionRange();if(this.getBehavioursEnabled()){var c=this.session,d=c.getState(b.start.row),e=c.getMode().transformAction(d,"deletion",this,c,b);e&&(b=e)}this.session.remove(b),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b===0)return;var c=this.session.getLine(a.row),d,e;b=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.isRowFullyVisible=function(a){return a>=this.renderer.getFirstFullyVisibleRow()&&a<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(a,b){var c=this.renderer,d=this.renderer.layerConfig,e=a*Math.floor(d.height/d.lineHeight);this.$blockScrolling++,b==1?this.selection.$moveSelection(function(){this.moveCursorBy(e,0)}):b==0&&(this.selection.moveCursorBy(e,0),this.selection.clearSelection()),this.$blockScrolling--;var f=c.scrollTop;c.scrollBy(0,e*d.lineHeight),b!=null&&c.scrollCursorIntoView(null,.5),c.animateScrolling(f)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.scrollToLine=function(a,b,c,d){this.renderer.scrollToLine(a,b,c,d)},this.centerSelection=function(){var a=this.getSelectionRange(),b=Math.floor(a.start.row+(a.end.row-a.start.row)/2);this.renderer.scrollToLine(b,!0)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b)},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a)},this.jumpToMatching=function(){var a=this.getCursorPosition(),b=this.session.findMatchingBracket(a);b||(a.column+=1,b=this.session.findMatchingBracket(a)),b||(a.column-=2,b=this.session.findMatchingBracket(a)),b&&(this.clearSelection(),this.moveCursorTo(b.row,b.column))},this.gotoLine=function(a,b,c){this.selection.clearSelection(),this.session.unfold({row:a-1,column:b||0}),this.$blockScrolling+=1,this.moveCursorTo(a-1,b||0),this.$blockScrolling-=1,this.isRowFullyVisible(a-1)||this.scrollToLine(a-1,!0,c)},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b)},this.navigateUp=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(-a,0)},this.navigateDown=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(a,0)},this.navigateLeft=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().start;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().end;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){var a=this.renderer.scrollTop;this.selection.moveCursorFileEnd(),this.clearSelection(),this.renderer.animateScrolling(a)},this.navigateFileStart=function(){var a=this.renderer.scrollTop;this.selection.moveCursorFileStart(),this.clearSelection(),this.renderer.animateScrolling(a)},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.session),d=0;return c?(this.$tryReplace(c,a)&&(d=1),c!==null&&(this.selection.setSelectionRange(c),this.renderer.scrollSelectionIntoView(c.start,c.end)),d):d},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.session),d=0;if(!c.length)return d;this.$blockScrolling+=1;var e=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var f=c.length-1;f>=0;--f)this.$tryReplace(c[f],a)&&d++;return this.selection.setSelectionRange(e),this.$blockScrolling-=1,d},this.$tryReplace=function(a,b){var c=this.session.getTextRange(a);return b=this.$search.replace(c,b),b!==null?(a.end=this.session.replace(a,b),a):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b,c){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find(!1,c)},this.findNext=function(a,b){a=a||{},this.$search.set(a),this.$find(!1,b)},this.findPrevious=function(a,b){a=a||{},this.$search.set(a),this.$find(!0,b)},this.$find=function(a,b){this.selection.isEmpty()||this.$search.set({needle:this.session.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var c=this.$search.find(this.session);if(c){this.$blockScrolling+=1,this.session.unfold(c),this.selection.setSelectionRange(c),this.$blockScrolling-=1;var d=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(c.start,c.end,.5),this.renderer.animateScrolling(d)}},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy()}}).call(q.prototype),b.Editor=q}),ace.define("ace/lib/lang",["require","exports","module"],function(a,b,c){"use strict",b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(var c=0,d=a.length;c1&&(d.charAt(0)==g?d=d.substr(1):d.charAt(d.length-1)==g&&(d=d.slice(0,-1))),d&&d!=g&&(j?b.onPaste(d):b.onTextInput(d));if(!v())return!1}}i=!1,j=!1,c.value=g,l()}function v(){return document.activeElement===c}var c=f.createElement("textarea");e.isTouchPad&&c.setAttribute("x-palm-disable-auto-cap",!0),c.style.left="-10000px",c.style.position="fixed",a.insertBefore(c,a.firstChild);var g=String.fromCharCode(0);m();var h=!1,i=!1,j=!1,k="",n=function(a){setTimeout(function(){h||m(a.data)},0)},o=function(a){if(e.isOldIE&&c.value.charCodeAt(0)>128)return;setTimeout(function(){h||m()},0)},p=function(a){h=!0,b.onCompositionStart(),e.isGecko||setTimeout(q,0)},q=function(){if(!h)return;b.onCompositionUpdate(c.value)},r=function(a){h=!1,b.onCompositionEnd()},s=function(a){i=!0;var d=b.getCopyText();d?c.value=d:a.preventDefault(),l(),setTimeout(function(){m()},0)},t=function(a){i=!0;var d=b.getCopyText();d?(c.value=d,b.onCut()):a.preventDefault(),l(),setTimeout(function(){m()},0)};d.addCommandKeyListener(c,b.onCommandKey.bind(b));if(e.isOldIE){var u={13:1,27:1};d.addListener(c,"keyup",function(a){h&&(!c.value||u[a.keyCode])&&setTimeout(r,0);if((c.value.charCodeAt(0)|0)<129)return;h?q():p()})}"onpropertychange"in c&&!("oninput"in c)?d.addListener(c,"propertychange",o):d.addListener(c,"input",n),d.addListener(c,"paste",function(a){j=!0,a.clipboardData&&a.clipboardData.getData?(m(a.clipboardData.getData("text/plain")),a.preventDefault()):o()}),"onbeforecopy"in c&&typeof clipboardData!="undefined"?(d.addListener(c,"beforecopy",function(a){var c=b.getCopyText();c?clipboardData.setData("Text",c):a.preventDefault()}),d.addListener(a,"keydown",function(a){if(a.ctrlKey&&a.keyCode==88){var c=b.getCopyText();c&&(clipboardData.setData("Text",c),b.onCut()),d.preventDefault(a)}})):(d.addListener(c,"copy",s),d.addListener(c,"cut",t)),d.addListener(c,"compositionstart",p),e.isGecko&&d.addListener(c,"text",q),e.isWebKit&&d.addListener(c,"keyup",q),d.addListener(c,"compositionend",r),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),l()}),this.focus=function(){b.onFocus(),l(),c.focus()},this.blur=function(){c.blur()},this.isFocused=v,this.getElement=function(){return c},this.onContextMenu=function(a,b){a&&(k||(k=c.style.cssText),c.style.cssText="position:fixed; z-index:1000;left:"+(a.x-2)+"px; top:"+(a.y-2)+"px;"),b&&(c.value="")},this.onContextMenuClose=function(){setTimeout(function(){k&&(c.style.cssText=k,k=""),m()},0)}};b.TextInput=g}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event"],function(a,b,c){"use strict";var d=a("../lib/event"),e=a("./default_handlers").DefaultHandlers,f=a("./default_gutter_handler").GutterHandler,g=a("./mouse_event").MouseEvent,h=function(a){this.editor=a,new e(a),new f(a),d.addListener(a.container,"mousedown",function(b){return a.focus(),d.preventDefault(b)}),d.addListener(a.container,"selectstart",function(a){return d.preventDefault(a)});var b=a.renderer.getMouseEventTarget();d.addListener(b,"mousedown",this.onMouseEvent.bind(this,"mousedown")),d.addListener(b,"click",this.onMouseEvent.bind(this,"click")),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove")),d.addMultiMouseDownListener(b,0,2,500,this.onMouseEvent.bind(this,"dblclick")),d.addMultiMouseDownListener(b,0,3,600,this.onMouseEvent.bind(this,"tripleclick")),d.addMultiMouseDownListener(b,0,4,600,this.onMouseEvent.bind(this,"quadclick")),d.addMouseWheelListener(a.container,this.onMouseWheel.bind(this,"mousewheel"));var c=a.renderer.$gutter;d.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),d.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),d.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),d.addListener(c,"mousemove",this.onMouseMove.bind(this,"gutter"))};(function(){this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(a,b){this.editor._emit(a,new g(b,this.editor))},this.$dragDelay=250,this.setDragDelay=function(a){this.$dragDelay=a},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(a,b){var c=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!c||!c.length)return;this.editor._emit(a,new g(b,this.editor))},this.onMouseWheel=function(a,b){var c=new g(b,this.editor);c.speed=this.$scrollSpeed*2,c.wheelX=b.wheelX,c.wheelY=b.wheelY,this.editor._emit(a,c)}}).call(h.prototype),b.MouseHandler=h}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/event","ace/lib/dom","ace/lib/browser_focus"],function(a,b,c){function k(a){this.editor=a,this.$clickSelection=null,this.browserFocus=new f,a.setDefaultHandler("mousedown",this.onMouseDown.bind(this)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(this)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(this)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(this)),a.setDefaultHandler("mousewheel",this.onScroll.bind(this))}function l(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))}"use strict";var d=a("../lib/event"),e=a("../lib/dom"),f=a("../lib/browser_focus").BrowserFocus,g=0,h=1,i=2,j=5;(function(){this.onMouseDown=function(a){function C(b){a.getShiftKey()?m.selection.selectToPosition(b):n.$clickSelection||(m.moveCursorToPosition(b),m.selection.clearSelection()),q=h}var b=a.inSelection(),c=a.pageX,f=a.pageY,k=a.getDocumentPosition(),m=this.editor,n=this,o=m.getSelectionRange(),p=o.isEmpty(),q=g,r=a.getButton();if(r!==0){p&&(m.moveCursorToPosition(k),m.selection.clearSelection()),r==2&&(m.textInput.onContextMenu({x:a.clientX,y:a.clientY},p),d.capture(m.container,function(){},m.textInput.onContextMenuClose));return}if(b&&(!this.browserFocus.isFocused()||(new Date).getTime()-this.browserFocus.lastFocus<20||!m.isFocused())){m.focus();return}b||C(k);var s=c,t=f,u=(new Date).getTime(),v,w,x,y=function(a){s=d.getDocumentX(a),t=d.getDocumentY(a)},z=function(a){clearInterval(F),q==g?C(k):q==i&&A(a),n.$clickSelection=null,q=g},A=function(a){e.removeCssClass(m.container,"ace_dragging"),m.session.removeMarker(x),m.$mouseHandler.$clickSelection||v||(m.moveCursorToPosition(k),m.selection.clearSelection());if(!v)return;if(w.contains(v.row,v.column)){v=null;return}m.clearSelection();if(a&&(a.ctrlKey||a.altKey))var b=m.session,c=b.insert(v,b.getTextRange(w));else var c=m.moveText(w,v);if(!c){v=null;return}m.selection.setSelectionRange(c)},B=function(){if(q==g){var a=l(c,f,s,t),b=(new Date).getTime();if(a>j){q=h;var d=m.renderer.screenToTextCoordinates(s,t);C(d)}else if(b-u>m.getDragDelay()){q=i,w=m.getSelectionRange();var k=m.getSelectionStyle();x=m.session.addMarker(w,"ace_selection",k),m.clearSelection(),e.addCssClass(m.container,"ace_dragging")}}q==i?E():q==h&&D()},D=function(){var a,b=m.renderer.screenToTextCoordinates(s,t);n.$clickSelection?n.$clickSelection.contains(b.row,b.column)?m.selection.setSelectionRange(n.$clickSelection):(n.$clickSelection.compare(b.row,b.column)==-1?a=n.$clickSelection.end:a=n.$clickSelection.start,m.selection.setSelectionAnchor(a.row,a.column),m.selection.selectToPosition(b)):m.selection.selectToPosition(b),m.renderer.scrollCursorIntoView()},E=function(){v=m.renderer.screenToTextCoordinates(s,t),m.moveCursorToPosition(v)};d.capture(m.container,y,z);var F=setInterval(B,20);return a.preventDefault()},this.onDoubleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectWord(),this.$clickSelection=c.getSelectionRange()},this.onTripleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectLine(),this.$clickSelection=c.getSelectionRange()},this.onQuadClick=function(a){var b=this.editor;b.selectAll(),this.$clickSelection=b.getSelectionRange()},this.onScroll=function(a){var b=this.editor;b.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed);if(b.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed))return a.preventDefault()}}).call(k.prototype),b.DefaultHandlers=k}),ace.define("ace/lib/browser_focus",["require","exports","module","ace/lib/oop","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./oop"),e=a("./event"),f=a("./event_emitter").EventEmitter,g=function(a){a=a||window,this.lastFocus=(new Date).getTime(),this._isFocused=!0;var b=this;"onfocusin"in a.document?(e.addListener(a.document,"focusin",function(a){b._setFocused(!0)}),e.addListener(a.document,"focusout",function(a){b._setFocused(!!a.toElement)})):(e.addListener(a,"blur",function(a){b._setFocused(!1)}),e.addListener(a,"focus",function(a){b._setFocused(!0)}))};(function(){d.implement(this,f),this.isFocused=function(){return this._isFocused},this._setFocused=function(a){if(this._isFocused==a)return;a&&(this.lastFocus=(new Date).getTime()),this._isFocused=a,this._emit("changeFocus")}}).call(g.prototype),b.BrowserFocus=g}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(a,b,c){"use strict";var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var c=this._eventRegistry[a]||[],d=this._defaultHandlers[a];if(!c.length&&!d)return;b=b||{},b.type=a,b.stopPropagation||(b.stopPropagation=function(){this.propagationStopped=!0}),b.preventDefault||(b.preventDefault=function(){this.defaultPrevented=!0});for(var e=0;e=4352&&a<=4447||a>=4515&&a<=4519||a>=4602&&a<=4607||a>=9001&&a<=9002||a>=11904&&a<=11929||a>=11931&&a<=12019||a>=12032&&a<=12245||a>=12272&&a<=12283||a>=12288&&a<=12350||a>=12353&&a<=12438||a>=12441&&a<=12543||a>=12549&&a<=12589||a>=12593&&a<=12686||a>=12688&&a<=12730||a>=12736&&a<=12771||a>=12784&&a<=12830||a>=12832&&a<=12871||a>=12880&&a<=13054||a>=13056&&a<=19903||a>=19968&&a<=42124||a>=42128&&a<=42182||a>=43360&&a<=43388||a>=44032&&a<=55203||a>=55216&&a<=55238||a>=55243&&a<=55291||a>=63744&&a<=64255||a>=65040&&a<=65049||a>=65072&&a<=65106||a>=65108&&a<=65126||a>=65128&&a<=65131||a>=65281&&a<=65376||a>=65504&&a<=65510}e.implement(this,h),this.setDocument=function(a){if(this.doc)throw new Error("Document is already set");this.doc=a,a.on("change",this.onChange.bind(this)),this.on("changeFold",this.onChangeFold.bind(this)),this.bgTokenizer&&(this.bgTokenizer.setDocument(this.getDocument()),this.bgTokenizer.start(0))},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(a==0){this.$rowCache=[];return}var b=this.$rowCache;for(var c=0;c=a){b.splice(c,b.length);return}},this.onChangeFold=function(a){var b=a.data;this.$resetRowCache(b.start.row)},this.onChange=function(a){var b=a.data;this.$modified=!0,this.$resetRowCache(b.range.start.row);var c=this.$updateInternalDataOnChange(a);!this.$fromUndo&&this.$undoManager&&!b.ignore&&(this.$deltasDoc.push(b),c&&c.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:c}),this.$informUndoManager.schedule()),this.bgTokenizer.start(b.range.start.row),this._emit("change",a)},this.setValue=function(a){this.doc.setValue(a),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(a){return this.bgTokenizer.getState(a)},this.getTokens=function(a,b){return this.bgTokenizer.getTokens(a,b)},this.getTokenAt=function(a,b){var c=this.bgTokenizer.getTokens(a,a)[0].tokens,d,e=0;if(b==null)f=c.length-1,e=this.getLine(a).length;else for(var f=0;f=b)break}return d=c[f],d?(d.index=f,d.start=e-d.value.length,d):null},this.setUndoManager=function(a){this.$undoManager=a,this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.$deltasFold.length&&(b.$deltas.push({group:"fold",deltas:b.$deltasFold}),b.$deltasFold=[]),b.$deltasDoc.length&&(b.$deltas.push({group:"doc",deltas:b.$deltasDoc}),b.$deltasDoc=[]),b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]},this.$informUndoManager=f.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?f.stringRepeat(" ",this.getTabSize()):" "},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){if(this.$useSoftTabs===a)return;this.$useSoftTabs=a},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){if(isNaN(a)||this.$tabSize===a)return;this.$modified=!0,this.$tabSize=a,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(a){if(this.$overwrite==a)return;this.$overwrite=a,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=this.doc.getLength()-1)return 0;var c=this.doc.removeLines(a,b);return this.doc.insertLines(a+1,c),1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.doc.insertLines(a,c);var d=b-a+1;return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},this.$clipColumnToRow=function(a,b){return b<0?0:Math.min(this.doc.getLine(a).length,b)},this.$clipPositionToDocument=function(a,b){b=Math.max(0,b);if(a<0)a=0,b=0;else{var c=this.doc.getLength();a>=c?(a=c-1,b=this.doc.getLine(c-1).length):b=Math.min(this.doc.getLine(a).length,b)}return{row:a,column:b}},this.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var b=this.doc.getLength()-1;return a.end.row>b?(a.end.row=b,a.end.column=this.doc.getLine(b).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(a){if(a!=this.$useWrapMode){this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0);if(a){var b=this.getLength();this.$wrapData=[];for(var c=0;c0?(this.$wrapLimit=b,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(a){var b=this.$wrapLimitRange.min;b&&(a=Math.max(b,a));var c=this.$wrapLimitRange.max;return c&&(a=Math.min(c,a)),Math.max(1,a)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(a){var b=this.$useWrapMode,c,d=a.data.action,e=a.data.range.start.row,f=a.data.range.end.row,g=a.data.range.start,h=a.data.range.end,i=null;d.indexOf("Lines")!=-1?(d=="insertLines"?f=e+a.data.lines.length:f=e,c=a.data.lines?a.data.lines.length:f-e):c=f-e;if(c!=0)if(d.indexOf("remove")!=-1){b&&this.$wrapData.splice(e,c);var j=this.$foldData;i=this.getFoldsInRange(a.data.range),this.removeFolds(i);var k=this.getFoldLine(h.row),l=0;if(k){k.addRemoveChars(h.row,h.column,g.column-h.column),k.shiftRow(-c);var m=this.getFoldLine(e);m&&m!==k&&(m.merge(k),k=m),l=j.indexOf(k)+1}for(l;l=h.row&&k.shiftRow(-c)}f=e}else{var n;if(b){n=[e,0];for(var o=0;o=e&&k.shiftRow(c)}}else{c=Math.abs(a.data.range.start.column-a.data.range.end.column),d.indexOf("remove")!=-1&&(i=this.getFoldsInRange(a.data.range),this.removeFolds(i),c=-c);var k=this.getFoldLine(e);k&&k.addRemoveChars(e,g.column,c)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),b&&this.$updateWrapData(e,f),i},this.$updateWrapData=function(a,b){var c=this.doc.getAllLines(),d=this.getTabSize(),e=this.$wrapData,g=this.$wrapLimit,h,j,k=a;b=Math.min(b,c.length-1);while(k<=b){j=this.getFoldLine(k,j);if(!j)h=this.$getDisplayTokens(f.stringTrimRight(c[k])),e[k]=this.$computeWrapSplits(h,g,d),k++;else{h=[],j.walk(function(a,b,d,e){var f;if(a){f=this.$getDisplayTokens(a,h.length),f[0]=i;for(var g=1;g=o)h.pop();e[j.start.row]=this.$computeWrapSplits(h,g,d),k=j.end.row+1}}};var b=1,c=2,i=3,l=4,n=9,o=10,p=11,q=12;this.$computeWrapSplits=function(a,b){function g(b){var d=a.slice(e,b),g=d.length;d.join("").replace(/12/g,function(){g-=1}).replace(/2/g,function(){g-=1}),f+=g,c.push(f),e=b}if(a.length==0)return[];var c=[],d=a.length,e=0,f=0;while(d-e>b){var h=e+b;if(a[h]>=o){while(a[h]>=o)h++;g(h);continue}if(a[h]==i||a[h]==l){for(h;h!=e-1;h--)if(a[h]==i)break;if(h>e){g(h);continue}h=e+b;for(h;hj&&a[h]j&&a[h]==n)h--;if(h>j){g(++h);continue}h=e+b,g(h)}return c},this.$getDisplayTokens=function(a,d){var e=[],f;d=d||0;for(var g=0;g39&&h<48||h>57&&h<64?e.push(n):h>=4352&&r(h)?e.push(b,c):e.push(b)}return e},this.$getStringScreenWidth=function(a,b,c){if(b==0)return[0,0];b==null&&(b=c+a.length*Math.max(this.getTabSize(),2)),c=c||0;var d,e;for(e=0;e=4352&&r(d)?c+=2:c+=1;if(c>b)break}return[c,e]},this.getRowLength=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},this.getRowHeight=function(a,b){return this.getRowLength(b)*a.lineHeight},this.getScreenLastRowColumn=function(a){var b=this.screenToDocumentPosition(a,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},this.getDocumentLastRowColumn=function(a,b){var c=this.documentToScreenRow(a,b);return this.getScreenLastRowColumn(c)},this.getDocumentLastRowColumnPosition=function(a,b){var c=this.documentToScreenRow(a,b);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},this.getRowSplitData=function(a){return this.$useWrapMode?this.$wrapData[a]:undefined},this.getScreenTabSize=function(a){return this.$tabSize-a%this.$tabSize},this.screenToDocumentRow=function(a,b){return this.screenToDocumentPosition(a,b).row},this.screenToDocumentColumn=function(a,b){return this.screenToDocumentPosition(a,b).column},this.screenToDocumentPosition=function(a,b){if(a<0)return{row:0,column:0};var c,d=0,e=0,f,g=0,h=0,i=this.$rowCache;for(var j=0;j=a||d>=l)break;g+=h,d++,d>n&&(d=m.end.row+1,m=this.getNextFoldLine(d,m),n=m?m.start.row:Infinity),k&&i.push({docRow:d,screenRow:g})}if(m&&m.start.row<=d)c=this.getFoldDisplayLine(m),d=m.start.row;else{if(g+h<=a||d>l)return{row:l,column:this.getLine(l).length};c=this.getLine(d),m=null}if(this.$useWrapMode){var o=this.$wrapData[d];o&&(f=o[a-g],a>g&&o.length&&(e=o[a-g-1]||o[o.length-1],c=c.substring(e)))}return e+=this.$getStringScreenWidth(c,b)[1],this.$useWrapMode&&e>=f&&(e=f-1),m?m.idxToPosition(e):{row:d,column:e}},this.documentToScreenPosition=function(a,b){if(typeof b=="undefined")var c=this.$clipPositionToDocument(a.row,a.column);else c=this.$clipPositionToDocument(a,b);a=c.row,b=c.column;var d;if(this.$useWrapMode){d=this.$wrapData;if(a>d.length-1)return{row:this.getScreenLength(),column:d.length==0?0:d[d.length-1].length-1}}var e=0,f=null,g=null;g=this.getFoldAt(a,b,1),g&&(a=g.start.row,b=g.start.column);var h,i=0,j=this.$rowCache;for(var k=0;k=n){h=m.end.row+1;if(h>a)break;m=this.getNextFoldLine(h,m),n=m?m.start.row:Infinity}else h=i+1;e+=this.getRowLength(i),i=h,l&&j.push({docRow:i,screenRow:e})}var o="";m&&i>=n?(o=this.getFoldDisplayLine(m,a,b),f=m.start.row):(o=this.getLine(a).substring(0,b),f=a);if(this.$useWrapMode){var p=d[f],q=0;while(o.length>=p[q])e++,q++;o=o.substring(p[q-1]||0,o.length)}return{row:e,column:this.$getStringScreenWidth(o)[0]}},this.documentToScreenColumn=function(a,b){return this.documentToScreenPosition(a,b).column},this.documentToScreenRow=function(a,b){return this.documentToScreenPosition(a,b).row},this.getScreenLength=function(){var a=0,b=null;if(!this.$useWrapMode){a=this.getLength();var c=this.$foldData;for(var d=0;dg&&(f=b.end.row+1,b=this.$foldData[d++],g=b?b.start.row:Infinity)}return a}}).call(n.prototype),a("./edit_session/folding").Folding.call(n.prototype),a("./edit_session/bracket_match").BracketMatch.call(n.prototype),b.EditSession=n}),ace.define("ace/config",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}"no use strict";var d=a("./lib/lang"),e=function(){return this}(),f={packaged:!1,workerPath:"",modePath:"",themePath:"",suffix:".js"};b.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);return f[a]},b.set=function(a,b){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);f[a]=b},b.all=function(){return d.copyObject(f)},b.init=function(){f.packaged=a.packaged||c.packaged||e.define&&define.packaged;if(!e.document)return"";var d={},h="",i,j=document.getElementsByTagName("script");for(var k=0;kb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor,b=this.selectionLead;return this.isEmpty()?g.fromPoints(b,b):this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.moveCursorTo(0,0)},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column)),this.$desiredColumn=null},this.$moveSelection=function(a){var b=this.selectionLead;this.$isEmpty&&this.setSelectionAnchor(b.row,b.column),a.call(this)},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(a,b){if(typeof b=="undefined"){var c=a||this.selectionLead;a=c.row,b=c.column}return this.session.getWordRange(a,b)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var a=this.getCursor(),b=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(b)},this.getLineRange=function(a,b){var c=typeof a=="number"?a:this.selectionLead.row,d,e=this.session.getFoldLine(c);return e?(c=e.start.row,d=e.end.row):d=c,b?new g(c,0,d,this.session.getLine(d).length):new g(c,0,d+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(b.start.row,b.start.column);else if(a.column==0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var c=this.session.getTabSize();this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(a.column-c,a.column).split(" ").length-1==c?this.moveCursorBy(0,-c):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(b.end.row,b.end.column);else if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=c.length){this.moveCursorTo(a,c.length),this.moveCursorRight(),a0&&this.moveCursorWordLeft();return}if(g=this.session.tokenRe.exec(f))b-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(a,b)},this.$shortWordEndIndex=function(a){var b,c=0,d,e=/\s/,f=this.session.tokenRe;f.lastIndex=0;if(b=this.session.tokenRe.exec(a))c=this.session.tokenRe.lastIndex;else{while((d=a[c])&&e.test(d))c++;if(c<=1){f.lastIndex=0;while((d=a[c])&&!f.test(d)){f.lastIndex=0,c++;if(e.test(d)){if(c>2){c--;break}while((d=a[c])&&e.test(d))c++;if(c>2)break}}}}return f.lastIndex=0,c},this.moveCursorShortWordRight=function(){var a=this.selectionLead.row,b=this.selectionLead.column,c=this.doc.getLine(a),d=c.substring(b),e=this.session.getFoldAt(a,b,1);if(e)return this.moveCursorTo(e.end.row,e.end.column);if(b==c.length)return this.moveCursorRight();var f=this.$shortWordEndIndex(d);this.moveCursorTo(a,b+f)},this.moveCursorShortWordLeft=function(){var a=this.selectionLead.row,b=this.selectionLead.column,c;if(c=this.session.getFoldAt(a,b,-1))return this.moveCursorTo(c.start.row,c.start.column);if(b==0)return this.moveCursorLeft();var d=this.session.getLine(a).substring(0,b),f=e.stringReverse(d),g=this.$shortWordEndIndex(f);return this.moveCursorTo(a,b-g)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(a,b){var c=this.session.documentToScreenPosition(this.selectionLead.row,this.selectionLead.column);b===0&&(this.$desiredColumn?c.column=this.$desiredColumn:this.$desiredColumn=c.column);var d=this.session.screenToDocumentPosition(c.row+a,c.column);this.moveCursorTo(d.row,d.column+b,b===0)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b,c){var d=this.session.getFoldAt(a,b,1);d&&(a=d.start.row,b=d.start.column),this.$keepDesiredColumnOnChange=!0,this.selectionLead.setPosition(a,b),this.$keepDesiredColumnOnChange=!1,c||(this.$desiredColumn=null)},this.moveCursorToScreen=function(a,b,c){var d=this.session.screenToDocumentPosition(a,b);this.moveCursorTo(d.row,d.column,c)},this.detach=function(){this.selectionLead.detach(),this.selectionAnchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(a){var b=this.getRange();return a?(a.start.column=b.start.column,a.start.row=b.start.row,a.end.column=b.end.column,a.end.row=b.end.row):a=b,a.cursor=this.isBackwards()?a.start:a.end,a.desiredColumn=this.$desiredColumn,a}}).call(h.prototype),b.Selection=h}),ace.define("ace/range",["require","exports","module"],function(a,b,c){"use strict";var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.isEqual=function(a){return this.start.row==a.start.row&&this.end.row==a.end.row&&this.start.column==a.start.column&&this.end.column==a.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;return b=this.compare(c.row,c.column),b==1?(b=this.compare(d.row,d.column),b==1?2:b==0?1:0):b==-1?-2:(b=this.compare(d.row,d.column),b==-1?-1:b==1?42:0)},this.comparePoint=function(a){return this.compare(a.row,a.column)},this.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},this.intersects=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)||this.isStart(a,b)?!1:!0:!1},this.insideStart=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)?!1:!0:!1},this.insideEnd=function(a,b){return this.compare(a,b)==0?this.isStart(a,b)?!1:!0:!1},this.compare=function(a,b){return!this.isMultiLine()&&a===this.start.row?bthis.end.column?1:0:athis.end.row?1:this.start.row===a?b>=this.start.column?0:-1:this.end.row===a?b<=this.end.column?0:1:0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0&&/^[\w\d]/.test(h)||e<=g&&/[\w\d]$/.test(h))return;h=f.substring(c.start.column,c.end.column);if(!/^[\w\d]+$/.test(h))return;var i=a.getCursorPosition(),j={wrap:!0,wholeWord:!0,caseSensitive:!0,needle:h},k=a.$search.getOptions();a.$search.set(j);var l=a.$search.findAll(b);l.forEach(function(a){if(!a.contains(i.row,i.column)){var c=b.addMarker(a,"ace_selected_word","text");b.$selectionOccurrences.push(c)}}),a.$search.set(k)},this.clearSelectionHighlight=function(a){if(!a.session.$selectionOccurrences)return;a.session.$selectionOccurrences.forEach(function(b){a.session.removeMarker(b)}),a.session.$selectionOccurrences=[]},this.createModeDelegates=function(a){if(!this.$embeds)return;this.$modes={};for(var b=0;b1&&e[i].token.length!==j-1)throw new Error("Matching groups and length of the token array don't match in rule #"+i+" of state "+c);h[g]={rule:i,len:j},g+=j,f.push(k)}this.regExps[c]=new RegExp("(?:("+f.join(")|(")+")|(.))",b)}};(function(){this.getLineTokens=function(a,b){var c=b,d=this.rules[c],e=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;var g,h=[],i=0,j={type:null,value:""};while(g=f.exec(a)){var k="text",l=null,m=[g[0]];for(var n=0;n1&&(m=g.slice(n+2,n+1+e[n].len)),typeof l.token=="function"?k=l.token.apply(this,m):k=l.token,l.next&&(c=l.next,d=this.rules[c],e=this.matchMappings[c],i=f.lastIndex,f=this.regExps[c],f.lastIndex=i);break}if(m[0]){typeof k=="string"&&(m=[m.join("")],k=[k]);for(var n=0;n=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length),a},this.insert=function(a,b){if(!b||b.length===0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];return a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c);var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};return this._emit("change",{data:e}),d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};return this._emit("change",{data:d}),c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};return this._emit("change",{data:e}),d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);return a.start},this.removeInLine=function(a,b,c){if(b==c)return;var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};return this._emit("change",{data:i}),d.start},this.removeLines=function(a,b){var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};return this._emit("change",{data:e}),d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._emit("change",{data:g})},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=b.Anchor=function(a,b,c){this.document=a,typeof c=="undefined"?this.setPosition(b.row,b.column):this.setPosition(b,c),this.$onChange=this.onChange.bind(this),a.on("change",this.$onChange)};(function(){d.implement(this,e),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&c.start.row!=this.row)return;if(c.start.row>this.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0),c}}).call(f.prototype)}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(!c.running)return;var a=new Date,b=c.currentLine,d=c.doc,e=0,f=d.getLength();while(c.currentLine20){c.fireUpdateEvent(b,c.currentLine-1),c.running=setTimeout(c.$worker,20);return}}c.running=!1,c.fireUpdateEvent(b,f-1)}};(function(){d.implement(this,e),this.setTokenizer=function(a){this.tokenizer=a,this.lines=[],this.start(0)},this.setDocument=function(a){this.doc=a,this.lines=[],this.stop()},this.fireUpdateEvent=function(a,b){var c={first:a,last:b};this._emit("update",{data:c})},this.start=function(a){this.currentLine=Math.min(a||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(a,b){return this.$tokenizeRows(a,b)},this.getState=function(a){return this.$tokenizeRows(a,a)[0].state},this.$tokenizeRows=function(a,b){if(!this.doc||isNaN(a)||isNaN(b))return[{state:"start",tokens:[]}];var c=[],d="start",e=!1;a>0&&this.lines[a-1]?(d=this.lines[a-1].state,e=!0):a==0?(d="start",e=!0):this.lines.length>0&&(d=this.lines[this.lines.length-1].state);var f=this.doc.getLines(a,b);for(var g=a;g<=b;g++)if(!this.lines[g]){var h=this.tokenizer.getLineTokens(f[g-a]||"",d),d=h.state;c.push(h),e&&(this.lines[g]=h)}else{var h=this.lines[g];d=h.state,c.push(h)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(a,b,c){function h(){this.getFoldAt=function(a,b,c){var d=this.getFoldLine(a);if(!d)return null;var e=d.folds;for(var f=0;f=a)return e;if(e.end.row>a)return null}return null},this.getNextFoldLine=function(a,b){var c=this.$foldData,d=0;b&&(d=c.indexOf(b)),d==-1&&(d=0);for(d;d=a)return e}return null},this.getFoldedRowCount=function(a,b){var c=this.$foldData,d=b-a+1;for(var e=0;e=b){h=a?d-=b-h:d=0);break}g>=a&&(h>=a?d-=g-h:d-=g-a+1)}return d},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(a,b){return a.start.row-b.start.row}),a},this.addFold=function(a,b){var c=this.$foldData,d=!1,g;a instanceof f?g=a:g=new f(b,a),this.$clipRangeToDocument(g.range);var h=g.start.row,i=g.start.column,j=g.end.row,k=g.end.column;if(g.placeholder.length<2)throw"Placeholder has to be at least 2 characters";if(h==j&&k-i<2)throw"The range has to be at least 2 characters width";var l=this.getFoldAt(h,i,1),m=this.getFoldAt(j,k,-1);if(l&&m==l)return l.addSubFold(g);if(l&&!l.range.isStart(h,i)||m&&!m.range.isEnd(j,k))throw"A fold can't intersect already existing fold"+g.range+l.range;var n=this.getFoldsInRange(g.range);n.length>0&&(this.removeFolds(n),g.subFolds=n);for(var o=0;othis.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(a),this.folds.sort(function(a,b){return-a.range.compareEnd(b.start.row,b.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else{if(a.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column}a.foldLine=this},this.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},this.walk=function(a,b,c){var d=0,e=this.folds,f,g,h,i=!0;b==null&&(b=this.end.row,c=this.end.column);for(var j=0;j=this.$rowTokens.length){this.$row+=1;if(this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row,this.$row)[0].tokens,this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,b=this.$tokenIndex,c=a[b].start;if(c!==undefined)return c;c=0;while(b>0)b-=1,c+=a[b].value.length;return c}}).call(d.prototype),b.TokenIterator=d}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator"],function(a,b,c){function e(){this.findMatchingBracket=function(a){if(a.column==0)return null;var b=this.getLine(a.row).charAt(a.column-1);if(b=="")return null;var c=b.match(/([\(\[\{])|([\)\]\}])/);return c?c[1]?this.$findClosingBracket(c[1],a):this.$findOpeningBracket(c[2],a):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("rparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn()-2,j=g.value;for(;;){while(i>=0){var k=j.charAt(i);if(k==c){e-=1;if(e==0)return{row:f.getCurrentTokenRow(),column:i+f.getCurrentTokenColumn()}}else k==a&&(e+=1);i-=1}do g=f.stepBackward();while(g&&!h.test(g.type));if(g==null)break;j=g.value,i=j.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("lparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn();for(;;){var j=g.value,k=j.length;while(i=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function k(e){var f=a.getLine(e);return b&&e==c.end.row&&(f=f.substring(0,c.end.column)),j&&e==d.row&&(f=f.substring(0,d.column)),f}var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"start":"end"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap,j=!1;return{forEach:function(a){var b=d.row,c=k(b),g=d.column,l=!1;j=!1;while(!a(c,g,b)){if(l)return;b++,g=0;if(b>h){if(!i)return;b=e,g=f,j=!0}b==d.row&&(l=!0),c=k(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"end":"start"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1,n=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(j0},this.hasRedo=function(){return this.$redoStack.length>0}}).call(d.prototype),b.UndoManager=d}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/config","ace/lib/net","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter","text!ace/css/editor.css"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/useragent"),h=a("./config"),i=a("./lib/net"),j=a("./layer/gutter").Gutter,k=a("./layer/marker").Marker,l=a("./layer/text").Text,m=a("./layer/cursor").Cursor,n=a("./scrollbar").ScrollBar,o=a("./renderloop").RenderLoop,p=a("./lib/event_emitter").EventEmitter,q=a("text!./css/editor.css");e.importCssString(q,"ace_editor");var r=function(a,b){var c=this;this.container=a,e.addCssClass(a,"ace_editor"),this.setTheme(b),this.$gutter=e.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=e.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=e.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new j(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onResize.bind(this,!0)),this.setFadeFoldWidgets(!0),this.$markerBack=new k(this.content);var d=this.$textLayer=new l(this.content);this.canvas=d.element,this.$markerFront=new k(this.content),this.characterWidth=d.getCharacterWidth(),this.lineHeight=d.getLineHeight(),this.$cursorLayer=new m(this.content),this.$cursorPadding=8,this.$horizScroll=!1,this.$horizScrollAlwaysVisible=!1,this.$animatedScroll=!1,this.scrollBar=new n(a),this.scrollBar.addEventListener("scroll",function(a){c.$inScrollAnimation||c.session.setScrollTop(a.data)}),this.scrollTop=0,this.scrollLeft=0,f.addListener(this.scroller,"scroll",function(){var a=c.scroller.scrollLeft;c.scrollLeft=a,c.session.setScrollLeft(a),c.scroller.className=a==0?"ace_scroller":"ace_scroller horscroll"}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){c.characterWidth=d.getCharacterWidth(),c.lineHeight=d.getLineHeight(),c.$updatePrintMargin(),c.onResize(!0),c.$loop.schedule(c.CHANGE_FULL)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.setPadding(4),this.$updatePrintMargin()};(function(){this.showGutter=!0,this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,d.implement(this,p),this.setSession=function(a){this.session=a,this.scroller.className="ace_scroller",this.$cursorLayer.setSession(a),this.$markerBack.setSession(a),this.$markerFront.setSession(a),this.$gutterLayer.setSession(a),this.$textLayer.setSession(a),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(a,b){b===undefined&&(b=Infinity),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)return;if(be?(b&&(e-=b*this.$size.scrollerHeight),this.session.setScrollTop(e)):this.scrollTop+this.$size.scrollerHeightd?(d0)return!0;if(b>0&&this.session.getScrollTop()+this.$size.scrollerHeighth&&(e=g.end.row+1,g=this.session.getNextFoldLine(e,g),h=g?g.start.row:Infinity);if(e>f)break;var j=this.$annotations[e]||b;c.push("
",e+1);if(i){var k=i[e];k==null&&(k=i[e]=this.session.getFoldWidget(e)),k&&c.push("")}var l=this.session.getRowLength(e)-1;while(l--)c.push("
¦");c.push("
"),e++}this.element=d.setInnerHtml(this.element,c.join("")),this.element.style.height=a.minHeight+"px";var m=this.element.offsetWidth;m!==this.gutterWidth&&(this.gutterWidth=m,this._emit("changeGutterWidth",m))},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(a){a?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=a},this.getShowFoldWidgets=function(){return this.$showFoldWidgets}}).call(g.prototype),b.Gutter=g}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../range").Range,e=a("../lib/dom"),f=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.update=function(a){var a=a||this.config;if(!a)return;this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],f=d.range.clipRows(a.firstRow,a.lastRow);if(f.isEmpty())continue;f=f.toScreenRange(this.session);if(d.renderer){var g=this.$getTop(f.start.row,a),h=Math.round(this.$padding+f.start.column*a.characterWidth);d.renderer(b,f,h,g,a)}else f.isMultiLine()?d.type=="text"?this.drawTextMarker(b,f,d.clazz,a):this.drawMultiLineMarker(b,f,d.clazz,a,d.type):this.drawSingleLineMarker(b,f,d.clazz+" start",a,null,d.type)}this.element=e.setInnerHtml(this.element,b.join(""))},this.$getTop=function(a,b){return(a-b.firstRowScreen)*b.lineHeight},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.session.getScreenLastRowColumn(f));this.drawSingleLineMarker(a,g,c+" start",e,1,"text"),f=b.end.row,g=new d(f,0,f,b.end.column),this.drawSingleLineMarker(a,g,c,e,0,"text");for(f=b.start.row+1;f"),j=this.$getTop(b.end.row,d),i=Math.round(b.end.column*d.characterWidth),a.push("
"),h=(b.end.row-b.start.row-1)*d.lineHeight;if(h<0)return;j=this.$getTop(b.start.row+1,d),a.push("
")},this.drawSingleLineMarker=function(a,b,c,d,e,f){var g=f==="background"?0:this.$padding,h=d.lineHeight;if(f==="background")var i=d.width;else i=Math.round((b.end.column+(e||0)-b.start.column)*d.characterWidth);var j=this.$getTop(b.start.row,d),k=Math.round(g+b.start.column*d.characterWidth);a.push("
")}}).call(f.prototype),b.Marker=f}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/dom"),f=a("../lib/lang"),g=a("../lib/useragent"),h=a("../lib/event_emitter").EventEmitter,i=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes()||{width:0,height:0},this.$pollSizeChanges()};(function(){d.implement(this,h),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.$padding=0,this.setPadding=function(a){this.$padding=a,this.element.style.padding="0 "+a+"px"},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.checkForSizeChanges=function(){var a=this.$measureSizes();a&&(this.$characterSize.width!==a.width||this.$characterSize.height!==a.height)&&(this.$characterSize=a,this._emit("changeCharacterSize",{data:a}))},this.$pollSizeChanges=function(){var a=this;this.$pollSizeChangesTimer=setInterval(function(){a.checkForSizeChanges()},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=g.isIE||g.isOldGecko?function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=e.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top=-a*40+"px",c.visibility="hidden",c.position="fixed",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a);if(this.element.ownerDocument.body)this.element.ownerDocument.body.appendChild(b);else{var d=this.element.parentNode;while(!e.hasCssClass(d,"ace_editor"))d=d.parentNode;d.appendChild(b)}}if(!this.element.offsetWidth)return null;var c=this.$measureNode.style,g=e.computedStyle(this.element);for(var h in this.$fontStyles)c[h]=g[h];var i={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return i.width==0||i.height==0?null:i}:function(){if(!this.$measureNode){var a=this.$measureNode=e.createElement("div"),b=a.style;b.width=b.height="auto",b.left=b.top="-100px",b.visibility="hidden",b.position="fixed",b.overflow="visible",b.whiteSpace="nowrap",a.innerHTML="X";var c=this.element.parentNode;while(c&&!e.hasCssClass(c,"ace_editor"))c=c.parentNode;if(!c)return this.$measureNode=null;c.appendChild(a)}var d=this.$measureNode.getBoundingClientRect(),f={height:d.height,width:d.width};return f.width==0||f.height==0?null:f},this.setSession=function(a){this.session=a},this.showInvisibles=!1,this.setShowInvisibles=function(a){return this.showInvisibles==a?!1:(this.showInvisibles=a,!0)},this.$tabStrings=[],this.$computeTabString=function(){var a=this.session.getTabSize(),b=this.$tabStrings=[0];for(var c=1;c"+this.TAB_CHAR+(new Array(c)).join(" ")+""):b.push((new Array(c+1)).join(" "))},this.updateLines=function(a,b,c){this.$computeTabString(),(this.config.lastRow!=a.lastRow||this.config.firstRow!=a.firstRow)&&this.scrollLines(a),this.config=a;var d=Math.max(b,a.firstRow),f=Math.min(c,a.lastRow),g=this.element.childNodes,h=0;for(var i=a.firstRow;i0;d--)c.removeChild(c.firstChild);if(b.lastRow>a.lastRow)for(var d=this.session.getFoldedRowCount(a.lastRow+1,b.lastRow);d>0;d--)c.removeChild(c.lastChild);if(a.firstRowb.lastRow){var e=this.$renderLinesFragment(a,b.lastRow+1,a.lastRow);c.appendChild(e)}},this.$renderLinesFragment=function(a,b,c){var d=this.element.ownerDocument.createDocumentFragment(),f=b,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>c)break;var i=e.createElement("div"),j=[],k=this.session.getTokens(f,f);k.length==1&&this.$renderLine(j,f,k[0].tokens,!1),i.innerHTML=j.join("");if(this.$useLineGroups())i.className="ace_line_group",d.appendChild(i);else{var l=i.childNodes;while(l.length)d.appendChild(l[0])}f++}return d},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=a.firstRow,d=a.lastRow,f=c,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>d)break;this.$useLineGroups()&&b.push("
");var i=this.session.getTokens(f,f);i.length==1&&this.$renderLine(b,f,i[0].tokens,!1),this.$useLineGroups()&&b.push("
"),f++}this.element=e.setInnerHtml(this.element,b.join(""))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(a,b,c,d){var e=this,f=/\t|&|<|( +)|([\u0000-\u0019\u00a0\u2000-\u200b\u2028\u2029\u3000])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,h=function(a,c,d,f,h){if(c)return(new Array(a.length+1)).join(" ");if(a=="&")return g.isOldGecko?"&":"&";if(a=="<")return"<";if(a==" "){var i=e.session.getScreenTabSize(b+f);return b+=i-1,e.$tabStrings[i]}if(a==" "){var j=e.showInvisibles?"ace_cjk ace_invisible":"ace_cjk",k=e.showInvisibles?e.SPACE_CHAR:"";return b+=1,""+k+""}return d?e.showInvisibles?""+e.SPACE_CHAR+"":" ":(b+=1,""+a+"")},i=d.replace(f,h);if(!this.$textToken[c.type]){var j="ace_"+c.type.replace(/\./g," ace_"),k="";c.type=="fold"&&(k=" style='width:"+c.value.length*this.config.characterWidth+"px;' "),a.push("",i,"")}else a.push(i);return b+d.length},this.$renderLineCore=function(a,b,c,d,e){var f=0,g=0,h,i=0,j=this;!d||d.length==0?h=Number.MAX_VALUE:h=d[0],e||a.push("
");for(var k=0;k=h)i=j.$renderToken(a,i,l,m.substring(0,h-f)),m=m.substring(h-f),f=h,e||a.push("
","
"),g++,i=0,h=d[g]||Number.MAX_VALUE;m.length!=0&&(f+=m.length,i=j.$renderToken(a,i,l,m))}}this.showInvisibles&&(b!==this.session.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+"")),e||a.push("
")},this.$renderLine=function(a,b,c,d){if(!this.session.isRowFolded(b)){var e=this.session.getRowSplitData(b);this.$renderLineCore(a,b,c,e,d)}else this.$renderFoldLine(a,b,c,d)},this.$renderFoldLine=function(a,b,c,d){function h(a,b,c){var d=0,e=0;while(e+a[d].value.lengthc-b&&(f=f.substring(0,c-b)),g.push({type:a[d].type,value:f}),e=b+f.length,d+=1}while(ec&&(f=f.substring(0,c-e)),g.push({type:a[d].type,value:f}),e+=f.length,d+=1}}var e=this.session,f=e.getFoldLine(b),g=[];f.walk(function(a,b,d,e,f){a?g.push({type:"fold",value:a}):(f&&(c=this.session.getTokens(b,b)[0].tokens),c.length!=0&&h(c,e,d))}.bind(this),f.end.row,this.session.getLine(f.end.row).length);var i=this.session.$useWrapMode?this.session.$wrapData[b]:null;this.$renderLineCore(a,b,g,i,d)},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(i.prototype),b.Text=i}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../lib/dom"),e=function(a){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.cursors=[],this.cursor=this.addCursor()};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.addCursor=function(){var a=d.createElement("div"),b="ace_cursor";return this.isVisible||(b+=" ace_hidden"),this.overwrite&&(b+=" ace_overwrite"),a.className=b,this.element.appendChild(a),this.cursors.push(a),a},this.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},this.hideCursor=function(){this.isVisible=!1;for(var a=this.cursors.length;a--;)d.addCssClass(this.cursors[a],"ace_hidden");clearInterval(this.blinkId)},this.showCursor=function(){this.isVisible=!0;for(var a=this.cursors.length;a--;)d.removeCssClass(this.cursors[a],"ace_hidden");this.element.style.visibility="",this.restartTimer()},this.restartTimer=function(){clearInterval(this.blinkId);if(!this.isVisible)return;var a=this.cursors.length==1?this.cursor:this.element;this.blinkId=setInterval(function(){a.style.visibility="hidden",setTimeout(function(){a.style.visibility=""},400)},1e3)},this.getPixelPosition=function(a,b){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var c=this.session.documentToScreenPosition(a),d=Math.round(this.$padding+c.column*this.config.characterWidth),e=(c.row-(b?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:d,top:e}},this.update=function(a){this.config=a;if(this.session.selectionMarkerCount>0){var b=this.session.$selectionMarkers,c=0,d,e=0;for(var c=b.length;c--;){d=b[c];var f=this.getPixelPosition(d.cursor,!0),g=(this.cursors[e++]||this.addCursor()).style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px"}if(e>1)while(this.cursors.length>e)this.removeCursor()}else{var f=this.getPixelPosition(null,!0),g=this.cursor.style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px";while(this.cursors.length>1)this.removeCursor()}var h=this.session.getOverwrite();h!=this.overwrite&&this.$setOverite(h),this.restartTimer()},this.$setOverite=function(a){this.overwrite=a;for(var b=this.cursors.length;b--;)a?d.addCssClass(this.cursors[b],"ace_overwrite"):d.removeCssClass(this.cursors[b],"ace_overwrite")},this.destroy=function(){clearInterval(this.blinkId)}}).call(e.prototype),b.Cursor=e}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/event_emitter").EventEmitter,h=function(a){this.element=e.createElement("div"),this.element.className="ace_sb",this.inner=e.createElement("div"),this.element.appendChild(this.inner),a.appendChild(this.element),this.width=e.scrollbarWidth(a.ownerDocument),this.element.style.width=(this.width||15)+5+"px",f.addListener(this.element,"scroll",this.onScroll.bind(this))};(function(){d.implement(this,g),this.onScroll=function(){this._emit("scroll",{data:this.element.scrollTop})},this.getWidth=function(){return this.width},this.setHeight=function(a){this.element.style.height=a+"px"},this.setInnerHeight=function(a){this.inner.style.height=a+"px"},this.setScrollTop=function(a){this.element.scrollTop=a}}).call(h.prototype),b.ScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(a,b,c){"use strict";var d=a("./lib/event"),e=function(a,b){this.onRender=a,this.pending=!1,this.changes=0,this.window=b||window};(function(){this.schedule=function(a){this.changes=this.changes|a;if(!this.pending){this.pending=!0;var b=this;d.nextTick(function(){b.pending=!1;var a;while(a=b.changes)b.changes=0,b.onRender(a)},this.window)}}}).call(e.prototype),b.RenderLoop=e}),ace.define("text!ace/css/editor.css",[],"\n.ace_editor {\n position: absolute;\n overflow: hidden;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace;\n font-size: 12px;\n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n cursor: text;\n}\n\n.ace_composition {\n position: absolute;\n background: #555;\n color: #DDD;\n z-index: 4;\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n height: 100%;\n width: auto;\n cursor: default;\n z-index: 1000;\n}\n\n.ace_gutter.horscroll {\n box-shadow: 0px 0px 20px rgba(0,0,0,0.4);\n}\n\n.ace_gutter-cell {\n padding-left: 19px;\n padding-right: 6px;\n}\n\n.ace_gutter-cell.ace_error {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info {\n background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0;\n}\n\n.ace_editor .ace_print_margin_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden;\n margin: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n.ace_editor .ace_print_margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_editor textarea {\n position: fixed;\n z-index: 0;\n width: 10px;\n height: 30px;\n opacity: 0;\n background: transparent;\n appearance: none;\n -moz-appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n white-space: nowrap;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter .ace_layer {\n position: relative;\n min-width: 40px;\n text-align: right;\n pointer-events: auto;\n}\n\n.ace_text-layer {\n color: black;\n font: inherit !important;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n}\n\n.ace_cursor.ace_hidden {\n opacity: 0.2;\n}\n\n.ace_editor.multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected_word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n \n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n border-radius: 2px;\n \n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n}\n\n.ace_dragging .ace_content {\n cursor: move;\n}\n\n.ace_folding-enabled > .ace_gutter-cell {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n\n margin: 0 -12px 1px 1px;\n display: inline-block;\n height: 14px;\n width: 11px;\n vertical-align: text-bottom;\n \n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat;\n background-position: center 5px;\n\n border-radius: 3px;\n}\n\n.ace_fold-widget.end {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget.closed {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n background-position: center 4px;\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n\n.ace_fold-widget.invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n -moz-transition: 0.5s opacity;\n -webkit-transition: 0.5s opacity;\n -o-transition: 0.5s opacity;\n -ms-transition: 0.5s opacity;\n transition: 0.5s opacity;\n opacity: 0;\n}\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n -moz-transition-duration: 0.05s;\n -webkit-transition-duration: 0.05s;\n -o-transition-duration: 0.05s;\n -ms-transition-duration: 0.05s;\n transition-duration: 0.05s;\n -moz-transition-delay: 0.2s;\n -webkit-transition-delay: 0.2s;\n -o-transition-delay: 0.2s;\n -ms-transition-delay: 0.2s;\n transition-delay: 0.2s; \n opacity:1;\n}\n"),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor"],function(a,b,c){function k(a,b,c){return j.$options.wrap=!0,j.$options.needle=b,j.$options.backwards=c==-1,j.find(a)}function n(a,b){return a.row==b.row&&a.column==b.column}function o(a){a.$onAddRange=a.$onAddRange.bind(a),a.$onRemoveRange=a.$onRemoveRange.bind(a),a.$onMultiSelect=a.$onMultiSelect.bind(a),a.$onSingleSelect=a.$onSingleSelect.bind(a),b.onSessionChange.call(a,a),a.on("changeSession",b.onSessionChange.bind(a)),a.on("mousedown",g),a.commands.addCommands(b.commands.defaultCommands),p(a)}function p(a){function e(){c&&(d.style.cursor="",c=!1)}var b=a.textInput.getElement(),c=!1,d=a.renderer.content;h.addListener(b,"keydown",function(a){a.keyCode==18&&!(a.ctrlKey||a.shiftKey||a.metaKey)?c||(d.style.cursor="crosshair",c=!0):c&&(d.style.cursor="")}),h.addListener(b,"keyup",e),h.addListener(b,"blur",e)}var d=a("./range_list").RangeList,e=a("./range").Range,f=a("./selection").Selection,g=a("./mouse/multi_select_handler").onMouseDown,h=a("./lib/event");b.commands=a("./commands/multi_select_commands");var i=a("./search").Search,j=new i,l=a("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(a,b){if(!a)return;if(!this.inMultiSelectMode&&this.rangeCount==0){var c=this.toOrientedRange();if(a.intersects(c))return b||this.fromOrientedRange(a);this.rangeList.add(c),this.$onAddRange(c)}a.cursor||(a.cursor=a.end);var d=this.rangeList.add(a);return this.$onAddRange(a),d.length&&this.$onRemoveRange(d),this.rangeCount>1&&!this.inMultiSelectMode&&(this._emit("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),b||this.fromOrientedRange(a)},this.toSingleRange=function(a){a=a||this.ranges[0];var b=this.rangeList.removeAll();b.length&&this.$onRemoveRange(b),a&&this.fromOrientedRange(a)},this.substractPoint=function(a){var b=this.rangeList.substractPoint(a);if(b)return this.$onRemoveRange(b),b[0]},this.mergeOverlappingRanges=function(){var a=this.rangeList.merge();a.length?this.$onRemoveRange(a):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(a){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(a),this._emit("addRange",{range:a})},this.$onRemoveRange=function(a){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var b=this.rangeList.ranges.pop();a.push(b),this.rangeCount=0}for(var c=a.length;c--;){var d=this.ranges.indexOf(a[c]);this.ranges.splice(d,1)}this._emit("removeRange",{ranges:a}),this.rangeCount==0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._emit("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),b=b||this.ranges[0],b&&!b.isEqual(this.getRange())&&this.fromOrientedRange(b)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new d,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeList.ranges.concat()},this.splitIntoLines=function(){if(this.rangeCount>1){var a=this.rangeList.ranges,b=a[a.length-1],c=e.fromPoints(a[0].start,b.end);this.toSingleRange(),this.setSelectionRange(c,b.cursor==b.start)}else{var c=this.getRange(),d=c.start.row,f=c.end.row;if(d==f)return;var g=[],h=this.getLineRange(d,!0);h.start.column=c.start.column,g.push(h);for(var i=d+1;i1){var a=this.rangeList.ranges,b=a[a.length-1],c=e.fromPoints(a[0].start,b.end);this.toSingleRange(),this.setSelectionRange(c,b.cursor==b.start)}else{var d=this.session.documentToScreenPosition(this.selectionLead),f=this.session.documentToScreenPosition(this.selectionAnchor),g=this.rectangularRangeBlock(d,f);g.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(a,b,c){var d=[],f=a.column0)p--;if(p>0){var q=0;while(d[q].isEmpty())q++}for(var r=p;r>=q;r--)d[r].isEmpty()&&d.splice(r,1)}return d}}.call(f.prototype);var m=a("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(a){a.cursor||(a.cursor=a.end);var b=this.getSelectionStyle();return a.marker=this.session.addMarker(a,"ace_selection",b),this.session.$selectionMarkers.push(a),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,a},this.removeSelectionMarker=function(a){if(!a.marker)return;this.session.removeMarker(a.marker);var b=this.session.$selectionMarkers.indexOf(a);b!=-1&&this.session.$selectionMarkers.splice(b,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(a){var b=this.session.$selectionMarkers;for(var c=a.length;c--;){var d=a[c];if(!d.marker)continue;this.session.removeMarker(d.marker);var e=b.indexOf(d);e!=-1&&b.splice(e,1)}this.session.selectionMarkerCount=b.length},this.$onAddRange=function(a){this.addSelectionMarker(a.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(a){this.removeSelectionMarkers(a.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(a){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("multiselect"),this.keyBinding.addKeyboardHandler(b.commands.keyboardHandler),this.commands.on("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(a){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("multiselect"),this.keyBinding.removeKeyboardHandler(b.commands.keyboardHandler),this.commands.removeEventListener("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelectExec=function(a){var b=a.command,c=a.editor;b.multiSelectAction?b.multiSelectAction=="forEach"?c.forEachSelection(b,a.args):b.multiSelectAction=="single"?(c.exitMultiSelectMode(),b.exec(c,a.args||{})):b.multiSelectAction(c,a.args||{}):(b.exec(c,a.args||{}),c.multiSelect.addRange(c.multiSelect.toOrientedRange()),c.multiSelect.mergeOverlappingRanges()),a.preventDefault()},this.forEachSelection=function(a,b){if(this.inVirtualSelectionMode)return;var c=this.session,d=this.selection,e=d.rangeList,g=d._eventRegistry;d._eventRegistry={};var h=new f(c);this.inVirtualSelectionMode=!0;for(var i=e.ranges.length;i--;)h.fromOrientedRange(e.ranges[i]),this.selection=c.selection=h,a.exec(this,b||{}),h.toOrientedRange(e.ranges[i]);h.detach(),this.selection=c.selection=d,this.inVirtualSelectionMode=!1,d._eventRegistry=g,d.mergeOverlappingRanges(),this.onCursorChange(),this.onSelectionChange()},this.exitMultiSelectMode=function(){if(this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getCopyText=function(){var a="";if(this.inMultiSelectMode){var b=this.multiSelect.rangeList.ranges;a=[];for(var c=0;cc.length){this.commands.exec("insertstring",this,a);return}for(var d=c.length;d--;){var e=c[d];e.isEmpty()||this.session.remove(e),this.session.insert(e.start,b[d])}},this.findAll=function(a,b,c){b=b||{},b.needle=a||b.needle,this.$search.set(b);var d=this.$search.findAll(this.session);if(!d.length)return 0;this.$blockScrolling+=1;var e=this.multiSelect;c||e.toSingleRange(d[0]);for(var f=d.length;f--;)e.addRange(d[f],!0);return this.$blockScrolling-=1,d.length},this.selectMoreLines=function(a,b){var c=this.selection.toOrientedRange(),d=c.cursor==c.end,f=this.session.documentToScreenPosition(c.cursor);this.selection.$desiredColumn&&(f.column=this.selection.$desiredColumn);var g=this.session.screenToDocumentPosition(f.row+a,f.column);if(!c.isEmpty())var h=this.session.documentToScreenPosition(d?c.end:c.start),i=this.session.screenToDocumentPosition(h.row+a,h.column);else var i=g;if(d){var j=e.fromPoints(g,i);j.cursor=j.start}else{var j=e.fromPoints(i,g);j.cursor=j.end}j.desiredColumn=f.column;if(!this.selection.inMultiSelectMode)this.selection.addRange(c);else if(b)var k=c.cursor;this.selection.addRange(j),k&&this.selection.substractPoint(k)},this.transposeSelections=function(a){var b=this.session,c=b.multiSelect,d=c.ranges;for(var e=d.length;e--;){var f=d[e];if(f.isEmpty()){var g=b.getWordRange(f.start.row,f.start.column);f.start.row=g.start.row,f.start.column=g.start.column,f.end.row=g.end.row,f.end.column=g.end.column}}c.mergeOverlappingRanges();var h=[];for(var e=d.length;e--;){var f=d[e];h.unshift(b.getTextRange(f))}a<0?h.unshift(h.pop()):h.push(h.shift());for(var e=d.length;e--;){var f=d[e],g=f.clone();b.replace(f,h[e]),f.start.row=g.start.row,f.start.column=g.start.column}},this.selectMore=function(a,b){var c=this.session,d=c.multiSelect,e=d.toOrientedRange();if(e.isEmpty()){var e=c.getWordRange(e.start.row,e.start.column);e.cursor=e.end,this.multiSelect.addRange(e)}var f=c.getTextRange(e),g=k(c,f,a);g&&(g.cursor=a==-1?g.start:g.end,this.multiSelect.addRange(g)),b&&this.multiSelect.substractPoint(e.cursor)}}).call(m.prototype),b.onSessionChange=function(a){var b=a.session;b.multiSelect||(b.$selectionMarkers=[],b.selection.$initRangeList(),b.multiSelect=b.selection),this.multiSelect=b.multiSelect;var c=a.oldSession;c&&(c.multiSelect&&c.multiSelect.editor==this&&(c.multiSelect.editor=null),b.multiSelect.removeEventListener("addRange",this.$onAddRange),b.multiSelect.removeEventListener("removeRange",this.$onRemoveRange),b.multiSelect.removeEventListener("multiSelect",this.$onMultiSelect),b.multiSelect.removeEventListener("singleSelect",this.$onSingleSelect)),b.multiSelect.on("addRange",this.$onAddRange),b.multiSelect.on("removeRange",this.$onRemoveRange),b.multiSelect.on("multiSelect",this.$onMultiSelect),b.multiSelect.on("singleSelect",this.$onSingleSelect),this.inMultiSelectMode!=b.selection.inMultiSelectMode&&(b.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},b.MultiSelect=o}),ace.define("ace/range_list",["require","exports","module"],function(a,b,c){"use strict";var d=function(){this.ranges=[]};(function(){this.comparePoints=function(a,b){return a.row-b.row||a.column-b.column},this.pointIndex=function(a,b){var c=this.ranges;for(var d=b||0;d0)continue;return f==0?d:(f=this.comparePoints(a,e.start),f>=0?d:-d-1)}return-d-1},this.add=function(a){var b=this.pointIndex(a.start);b<0&&(b=-b-1);var c=this.pointIndex(a.end,b);return c<0?c=-c-1:c++,this.ranges.splice(b,c-b,a)},this.addList=function(a){var b=[];for(var c=a.length;c--;)b.push.call(b,this.add(a[c]));return b},this.substractPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges.splice(b,1)},this.merge=function(){var a=[],b=this.ranges,c=b[0],d;for(var e=1;e=0},this.containsPoint=function(a){return this.pointIndex(a)>=0},this.rangeAtPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges[b]},this.clipRows=function(a,b){var c=this.ranges;if(c[0].start.row>b||c[c.length-1].start.rowe)break;l.start.row==e&&l.start.column>=c.column&&(l.start.column+=h,l.start.row+=g),l.end.row==e&&l.end.column>=c.column&&(l.end.column+=h,l.end.row+=g)}if(g!=0&&j=this.pos.column&&c.start.column<=this.pos.column+this.length+1){var f=c.start.column-this.pos.column;this.length+=e;if(!this.session.$fromUndo){if(b.action==="insertText")for(var g=this.others.length-1;g>=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=this.pos.column&&b.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var a=0;a 1) { + if (value.charAt(0) == PLACEHOLDER) + value = value.substr(1); + else if (value.charAt(value.length - 1) == PLACEHOLDER) + value = value.slice(0, -1); } - else { - host.onTextInput(value, pasted); + + if (value && value != PLACEHOLDER) { + if (pasted) + host.onPaste(value); + else + host.onTextInput(value); } // If editor is no longer focused we quit immediately, since @@ -4662,7 +4719,7 @@ var TextInput = function(parentNode, host) { var onTextInput = function(e) { setTimeout(function () { if (!inCompostion) - sendText(e.data); + sendText(e.data); }, 0); }; @@ -4718,6 +4775,7 @@ var TextInput = function(parentNode, host) { }; event.addCommandKeyListener(text, host.onCommandKey.bind(host)); + if (useragent.isOldIE) { var keytable = { 13:1, 27:1 }; event.addListener(text, "keyup", function (e) { @@ -5040,6 +5098,19 @@ function DefaultHandlers(editor) { var selectionEmpty = selectionRange.isEmpty(); var state = STATE_UNKNOWN; + var button = ev.getButton(); + if (button !== 0) { + if (selectionEmpty) { + editor.moveCursorToPosition(pos); + editor.selection.clearSelection(); + } + if (button == 2) { + editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); + event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); + } + return; + } + // if this click caused the editor to be focused should not clear the // selection if ( @@ -5053,18 +5124,6 @@ function DefaultHandlers(editor) { return; } - var button = ev.getButton(); - if (button !== 0) { - if (selectionEmpty) { - editor.moveCursorToPosition(pos); - } - if (button == 2) { - editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); - event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); - } - return; - } - if (!inSelection) { // Directly pick STATE_SELECT, since the user is not clicking inside // a selection. @@ -5426,7 +5485,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -5469,7 +5528,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -5522,7 +5582,8 @@ function GutterHandler(editor) { exports.GutterHandler = GutterHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -5736,7 +5797,8 @@ function FoldHandler(editor) { exports.FoldHandler = FoldHandler; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -5785,15 +5847,27 @@ require("../commands/default_commands"); var KeyBinding = function(editor) { this.$editor = editor; this.$data = { }; - this.$handlers = [this]; + this.$handlers = []; + this.setDefaultHandler(editor.commands); }; (function() { + this.setDefaultHandler = function(keyboardHandler) { + this.removeKeyboardHandler(this.$defaultHandler); + this.$defaultHandler = keyboardHandler; + if (keyboardHandler) + this.$handlers.unshift(keyboardHandler); + this.$data = { }; + }; + this.setKeyboardHandler = function(keyboardHandler) { if (this.$handlers[this.$handlers.length - 1] == keyboardHandler) return; this.$data = { }; - this.$handlers = keyboardHandler ? [this, keyboardHandler] : [this]; + this.$handlers = []; + this.setDefaultHandler(this.$defaultHandler); + if (keyboardHandler) + this.$handlers.push(keyboardHandler); }; this.addKeyboardHandler = function(keyboardHandler) { @@ -5831,7 +5905,7 @@ var KeyBinding = function(editor) { // allow keyboardHandler to consume keys if (toExecute.command != "null") - success = commands.exec(toExecute.command, this.$editor, toExecute.args); + success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); else success = true; @@ -5841,20 +5915,14 @@ var KeyBinding = function(editor) { return success; }; - this.handleKeyboard = function(data, hashId, keyString) { - return { - command: this.$editor.commands.findKeyCommand(hashId, keyString) - }; - }; - this.onCommandKey = function(e, hashId, keyCode) { var keyString = keyUtil.keyCodeToString(keyCode); this.$callKeyboardHandlers(hashId, keyString, keyCode, e); }; - this.onTextInput = function(text, pasted) { + this.onTextInput = function(text) { var success = false; - if (!pasted && text.length == 1) + if (text.length == 1) success = this.$callKeyboardHandlers(0, text); if (!success) this.$editor.commands.exec("insertstring", this.$editor, text); @@ -6177,7 +6245,7 @@ exports.commands = [{ multiSelectAction: "forEach" }, { name: "togglecomment", - bindKey: bindKey("Ctrl-7", "Command-7"), + bindKey: bindKey("Ctrl-/", "Command-/"), exec: function(editor) { editor.toggleCommentLines(); }, multiSelectAction: "forEach" }, { @@ -6399,10 +6467,7 @@ var EditSession = function(text, mode) { } this.selection = new Selection(this); - if (mode) - this.setMode(mode); - else - this.setMode(new TextMode()); + this.setMode(mode); }; @@ -6463,21 +6528,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession@onChangeFold(e) - * + * EditSession@onChangeFold(e) + * * Emitted when a code fold changes its state. * - **/ + **/ this.onChangeFold = function(e) { var fold = e.data; this.$resetRowCache(fold.start.row); }; /** - * EditSession@onChange(e) - * - * Emitted when the document changes. - **/ + * EditSession@onChange(e) + * + * Emitted when the document changes. + **/ this.onChange = function(e) { var delta = e.data; this.$modified = true; @@ -6502,12 +6567,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setValue(text) - * - text (String): The new text to place + * EditSession.setValue(text) + * - text (String): The new text to place * * Sets the session text. - * - **/ + * + **/ this.setValue = function(text) { this.doc.setValue(text); this.selection.moveCursorTo(0, 0); @@ -6538,16 +6603,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getSelection() -> String - * - * Returns the string of the current selection. - **/ + * EditSession.getSelection() -> String + * + * Returns the string of the current selection. + **/ this.getSelection = function() { return this.selection; }; /** related to: BackgroundTokenizer.getState - * EditSession.getState(row) -> Array + * EditSession.getState(row) -> Array * - row (Number): The row to start at * * {:BackgroundTokenizer.getState} @@ -6558,7 +6623,7 @@ var EditSession = function(text, mode) { }; /** related to: BackgroundTokenizer.getTokens - * EditSession.getTokens(firstRow, lastRow) -> Array + * EditSession.getTokens(firstRow, lastRow) -> Array * - firstRow (Number): The row to start at * - lastRow (Number): The row to finish at * @@ -6570,12 +6635,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTokenAt(row, column) -> Array - * - row (Number): The row number to retrieve from + * EditSession.getTokenAt(row, column) -> Array + * - row (Number): The row number to retrieve from * - column (Number): The column number to retrieve from * - * Returns an array of tokens at the indicated row and column. - **/ + * Returns an array of tokens at the indicated row and column. + **/ this.getTokenAt = function(row, column) { var tokens = this.bgTokenizer.getTokens(row, row)[0].tokens; var token, c = 0; @@ -6598,11 +6663,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoManager(undoManager) - * - undoManager (UndoManager): The new undo manager - * + * EditSession.setUndoManager(undoManager) + * - undoManager (UndoManager): The new undo manager + * * Sets the undo manager. - **/ + **/ this.setUndoManager = function(undoManager) { this.$undoManager = undoManager; this.$resetRowCache(0); @@ -6616,10 +6681,10 @@ var EditSession = function(text, mode) { if (undoManager) { var self = this; /** internal, hide - * EditSession.$syncInformUndoManager() - * - * - **/ + * EditSession.$syncInformUndoManager() + * + * + **/ this.$syncInformUndoManager = function() { self.$informUndoManager.cancel(); @@ -6660,19 +6725,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUndoManager() -> UndoManager - * - * Returns the current undo manager. - **/ + * EditSession.getUndoManager() -> UndoManager + * + * Returns the current undo manager. + **/ this.getUndoManager = function() { return this.$undoManager || this.$defaultUndoManager; }, /** - * EditSession.getTabString() -> String - * - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - **/ + * EditSession.getTabString() -> String + * + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + **/ this.getTabString = function() { if (this.getUseSoftTabs()) { return lang.stringRepeat(" ", this.getTabSize()); @@ -6683,12 +6748,12 @@ var EditSession = function(text, mode) { this.$useSoftTabs = true; /** - * EditSession.setUseSoftTabs(useSoftTabs) - * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs - * + * EditSession.setUseSoftTabs(useSoftTabs) + * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs + * * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). * - **/ + **/ this.setUseSoftTabs = function(useSoftTabs) { if (this.$useSoftTabs === useSoftTabs) return; @@ -6696,22 +6761,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseSoftTabs() -> Boolean - * - * Returns `true` if soft tabs are being used, `false` otherwise. + * EditSession.getUseSoftTabs() -> Boolean + * + * Returns `true` if soft tabs are being used, `false` otherwise. * - **/ + **/ this.getUseSoftTabs = function() { return this.$useSoftTabs; }; this.$tabSize = 4; /** - * EditSession.setTabSize(tabSize) - * - tabSize (Number): The new tab size - * + * EditSession.setTabSize(tabSize) + * - tabSize (Number): The new tab size + * * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - **/ + **/ this.setTabSize = function(tabSize) { if (isNaN(tabSize) || this.$tabSize === tabSize) return; @@ -6721,32 +6786,32 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTabSize() -> Number - * - * Returns the current tab size. - **/ + * EditSession.getTabSize() -> Number + * + * Returns the current tab size. + **/ this.getTabSize = function() { return this.$tabSize; }; /** - * EditSession.isTabStop(position) -> Boolean - * - position (Object): The position to check - * + * EditSession.isTabStop(position) -> Boolean + * - position (Object): The position to check + * * Returns `true` if the character at the position is a soft tab. - **/ + **/ this.isTabStop = function(position) { return this.$useSoftTabs && (position.column % this.$tabSize == 0); }; this.$overwrite = false; /** - * EditSession.setOverwrite(overwrite) - * - overwrite (Boolean): Defines wheter or not to set overwrites - * + * EditSession.setOverwrite(overwrite) + * - overwrite (Boolean): Defines wheter or not to set overwrites + * * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * - **/ + **/ this.setOverwrite = function(overwrite) { if (this.$overwrite == overwrite) return; @@ -6755,39 +6820,39 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getOverwrite() -> Boolean - * - * Returns `true` if overwrites are enabled; `false` otherwise. - **/ + * EditSession.getOverwrite() -> Boolean + * + * Returns `true` if overwrites are enabled; `false` otherwise. + **/ this.getOverwrite = function() { return this.$overwrite; }; /** - * EditSession.toggleOverwrite() - * - * Sets the value of overwrite to the opposite of whatever it currently is. - **/ + * EditSession.toggleOverwrite() + * + * Sets the value of overwrite to the opposite of whatever it currently is. + **/ this.toggleOverwrite = function() { this.setOverwrite(!this.$overwrite); }; /** - * EditSession.getBreakpoints() -> Array - * - * Returns an array of numbers, indicating which rows have breakpoints. - **/ + * EditSession.getBreakpoints() -> Array + * + * Returns an array of numbers, indicating which rows have breakpoints. + **/ this.getBreakpoints = function() { return this.$breakpoints; }; /** - * EditSession.setBreakpoints(rows) - * - rows (Array): An array of row indicies - * + * EditSession.setBreakpoints(rows) + * - rows (Array): An array of row indicies + * * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * - **/ + **/ this.setBreakpoints = function(rows) { this.$breakpoints = []; for (var i=0; i Number - * - range (Range): Define the range of the marker + * EditSession.addMarker(range, clazz, type = "line", inFront) -> Number + * - range (Range): Define the range of the marker * - clazz (String): Set the CSS class for the marker * - type (Function | String): Identify the type of the marker * - inFront (Boolean): Set to `true` to establish a front marker * - * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. + * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. * - **/ + **/ this.addMarker = function(range, clazz, type, inFront) { var id = this.$markerId++; @@ -6861,12 +6926,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.removeMarker(markerId) - * - markerId (Number): A number representing a marker + * EditSession.removeMarker(markerId) + * - markerId (Number): A number representing a marker * * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. - * - **/ + * + **/ this.removeMarker = function(markerId) { var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId]; if (!marker) @@ -6880,12 +6945,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMarkers(inFront) -> Array - * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers + * EditSession.getMarkers(inFront) -> Array + * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers * * Returns an array containing the IDs of all the markers, either front or back. - * - **/ + * + **/ this.getMarkers = function(inFront) { return inFront ? this.$frontMarkers : this.$backMarkers; }; @@ -6900,11 +6965,11 @@ var EditSession = function(text, mode) { * } */ /** - * EditSession.setAnnotations(annotations) - * - annotations (Array): A list of annotations + * EditSession.setAnnotations(annotations) + * - annotations (Array): A list of annotations * - * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - **/ + * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. + **/ this.setAnnotations = function(annotations) { this.$annotations = {}; for (var i=0; i Object - * - * Returns the annotations for the `EditSession`. - **/ + * EditSession.getAnnotations() -> Object + * + * Returns the annotations for the `EditSession`. + **/ this.getAnnotations = function() { return this.$annotations || {}; }; /** - * EditSession.clearAnnotations() - * - * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. - **/ + * EditSession.clearAnnotations() + * + * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. + **/ this.clearAnnotations = function() { this.$annotations = {}; this._emit("changeAnnotation", {}); }; /** internal, hide - * EditSession.$detectNewLine(text) - * - text (String): A block of text - * + * EditSession.$detectNewLine(text) + * - text (String): A block of text + * * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. * - **/ + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r?\n)/m); if (match) { @@ -6954,13 +7019,13 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWordRange(row, column) -> Range - * - row (Number): The row to start at + * EditSession.getWordRange(row, column) -> Range + * - row (Number): The row to start at * - column (Number): The column to start at * - * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. * - **/ + **/ this.getWordRange = function(row, column) { var line = this.getLine(row); @@ -6993,12 +7058,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getAWordRange(row, column) -> Range - * - row (Number): The row number to start from + * EditSession.getAWordRange(row, column) -> Range + * - row (Number): The row number to start from * - column (Number): The column number to start from - * + * * Gets the range of a word, including its right whitespace. - **/ + **/ this.getAWordRange = function(row, column) { var wordRange = this.getWordRange(row, column); var line = this.getLine(wordRange.end.row); @@ -7010,20 +7075,20 @@ var EditSession = function(text, mode) { }; /** related to: Document.setNewLineMode - * EditSession.setNewLineMode(newLineMode) - * - newLineMode (String): {:Document.setNewLineMode.param} + * EditSession.setNewLineMode(newLineMode) + * - newLineMode (String): {:Document.setNewLineMode.param} * - * {:Document.setNewLineMode.desc} - **/ + * {:Document.setNewLineMode.desc} + **/ this.setNewLineMode = function(newLineMode) { this.doc.setNewLineMode(newLineMode); }; /** related to: Document.getNewLineMode - * EditSession.getNewLineMode() -> String - * - * Returns the current new line mode. - **/ + * EditSession.getNewLineMode() -> String + * + * Returns the current new line mode. + **/ this.getNewLineMode = function() { return this.doc.getNewLineMode(); }; @@ -7031,12 +7096,12 @@ var EditSession = function(text, mode) { this.$useWorker = true; /** - * EditSession.setUseWorker(useWorker) - * - useWorker (Boolean): Set to `true` to use a worker - * + * EditSession.setUseWorker(useWorker) + * - useWorker (Boolean): Set to `true` to use a worker + * * Identifies if you want to use a worker for the `EditSession`. * - **/ + **/ this.setUseWorker = function(useWorker) { if (this.$useWorker == useWorker) return; @@ -7049,19 +7114,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWorker() -> Boolean - * - * Returns `true` if workers are being used. - **/ + * EditSession.getUseWorker() -> Boolean + * + * Returns `true` if workers are being used. + **/ this.getUseWorker = function() { return this.$useWorker; }; /** - * EditSession@onReloadTokenizer(e) - * - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ + * EditSession@onReloadTokenizer(e) + * + * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + **/ this.onReloadTokenizer = function(e) { var rows = e.data; this.bgTokenizer.start(rows.first); @@ -7072,7 +7137,7 @@ var EditSession = function(text, mode) { this._loadMode = function(mode, callback) { if (this.$modes[mode]) return callback(this.$modes[mode]); - + var _self = this; var module; try { @@ -7080,16 +7145,17 @@ var EditSession = function(text, mode) { } catch (e) {}; if (module) return done(module); - + fetch(function() { require([mode], done); }); - + function done(module) { if (_self.$modes[mode]) return callback(_self.$modes[mode]); - + _self.$modes[mode] = new module.Mode(); + _self.$modes[mode].$id = mode; _self._emit("loadmode", { name: mode, mode: _self.$modes[mode] @@ -7100,40 +7166,48 @@ var EditSession = function(text, mode) { function fetch(callback) { if (!config.get("packaged")) return callback(); - + var base = mode.split("/").pop(); var filename = config.get("modePath") + "/mode-" + base + config.get("suffix"); net.loadScript(filename, callback); } }; + /** + * EditSession.setMode(mode) + * - mode (TextMode): Set a new text mode + * + * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. + * + **/ this.$mode = null; - this.$origMode = null; - /** - * EditSession.setMode(mode) - * - mode (TextMode): Set a new text mode - * - * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * - **/ + this.$modeId = null; this.setMode = function(mode) { - this.$origMode = mode; - // load on demand if (typeof mode === "string") { + if (this.$modeId == mode) + return; + + this.$modeId = mode; var _self = this; this._loadMode(mode, function(module) { - if (_self.$origMode !== mode) + if (_self.$modeId !== mode) return; - + _self.setMode(module); }); return; + } else if (mode == null) { + mode = "ace/mode/text" + this.$modeId = mode; + this.$modes[mode] = this.$modes[mode] || (new TextMode()); + this.setMode(this.$modes[mode]); + return; } - + if (this.$mode === mode) return; this.$mode = mode; - + this.$modeId = mode.$id; this.$stopWorker(); @@ -7200,21 +7274,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMode() -> TextMode - * - * Returns the current text mode. - **/ + * EditSession.getMode() -> TextMode + * + * Returns the current text mode. + **/ this.getMode = function() { return this.$mode; }; - + this.$scrollTop = 0; /** - * EditSession.setScrollTop(scrollTop) - * - scrollTop (Number): The new scroll top value + * EditSession.setScrollTop(scrollTop) + * - scrollTop (Number): The new scroll top value * - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - **/ + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. + **/ this.setScrollTop = function(scrollTop) { scrollTop = Math.round(Math.max(0, scrollTop)); if (this.$scrollTop === scrollTop) @@ -7225,20 +7299,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollTop() -> Number - * - * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - **/ + * EditSession.getScrollTop() -> Number + * + * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} + **/ this.getScrollTop = function() { return this.$scrollTop; }; - + this.$scrollLeft = 0; /** - * EditSession.setScrollLeft(scrollLeft) - * - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - **/ + * EditSession.setScrollLeft(scrollLeft) + * + * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + **/ this.setScrollLeft = function(scrollLeft) { scrollLeft = Math.round(Math.max(0, scrollLeft)); if (this.$scrollLeft === scrollLeft) @@ -7249,29 +7323,29 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollLeft() -> Number - * - * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - **/ + * EditSession.getScrollLeft() -> Number + * + * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} + **/ this.getScrollLeft = function() { return this.$scrollLeft; }; /** - * EditSession.getWidth() -> Number - * - * Returns the width of the document. - **/ + * EditSession.getWidth() -> Number + * + * Returns the width of the document. + **/ this.getWidth = function() { this.$computeWidth(); return this.width; }; /** - * EditSession.getScreenWidth() -> Number - * - * Returns the width of the screen. - **/ + * EditSession.getScreenWidth() -> Number + * + * Returns the width of the screen. + **/ this.getScreenWidth = function() { this.$computeWidth(); return this.screenWidth; @@ -7317,18 +7391,18 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLine - * EditSession.getLine(row) -> String - * - row (Number): The row to retrieve from - * + * EditSession.getLine(row) -> String + * - row (Number): The row to retrieve from + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.doc.getLine(row); }; /** related to: Document.getLines - * EditSession.getLines(firstRow, lastRow) -> Array + * EditSession.getLines(firstRow, lastRow) -> Array * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve * @@ -7340,7 +7414,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLength - * EditSession.getLength()-> Number + * EditSession.getLength()-> Number * * Returns the number of rows in the document. **/ @@ -7349,7 +7423,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getTextRange - * EditSession.getTextRange(range) -> Array + * EditSession.getTextRange(range) -> Array * - range (String): The range to work with * * {:Document.getTextRange.desc} @@ -7359,7 +7433,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insert - * EditSession.insert(position, text) -> Number + * EditSession.insert(position, text) -> Number * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. @@ -7373,7 +7447,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.remove - * EditSession.remove(range) -> Object + * EditSession.remove(range) -> Object * - range (Range): A specified Range to remove * + (Object): The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * @@ -7386,12 +7460,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.undoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.undoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): [If `true`, doesn't select the range of where the change occured]{: #dontSelect} * - * Reverts previous changes to your document. - **/ + * Reverts previous changes to your document. + **/ this.undoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -7419,12 +7493,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.redoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.redoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): {:dontSelect} * - * Re-implements a previously undone change to your document. - **/ + * Re-implements a previously undone change to your document. + **/ this.redoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -7448,20 +7522,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoSelect(enable) - * - enable (Boolean): If `true`, selects the range of the reinserted change + * EditSession.setUndoSelect(enable) + * - enable (Boolean): If `true`, selects the range of the reinserted change * - * ENables or disables highlighting of the range where an undo occured. - **/ + * ENables or disables highlighting of the range where an undo occured. + **/ this.setUndoSelect = function(enable) { this.$undoSelect = enable; }; /** internal, hide - * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range - * - * - **/ + * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range + * + * + **/ this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { function isInsert(delta) { var insert = @@ -7517,7 +7591,7 @@ var EditSession = function(text, mode) { }, /** related to: Document.replace - * EditSession.replace(range, text) -> Object + * EditSession.replace(range, text) -> Object * - range (Range): A specified Range to replace * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this:
@@ -7535,17 +7609,17 @@ var EditSession = function(text, mode) { }; /** - * EditSession.moveText(fromRange, toPosition) -> Range - * - fromRange (Range): The range of text you want moved within the document + * EditSession.moveText(fromRange, toPosition) -> Range + * - fromRange (Range): The range of text you want moved within the document * - toPosition (Object): The location (row and column) where you want to move the text to * + (Range): The new range where the text was moved to. * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: * * { row: newRowLocation, column: newColumnLocation } - * + * * * - **/ + **/ this.moveText = function(fromRange, toPosition) { var text = this.getTextRange(fromRange); this.remove(fromRange); @@ -7577,16 +7651,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.indentRows(startRow, endRow, indentString) - * - startRow (Number): Starting row + * EditSession.indentRows(startRow, endRow, indentString) + * - startRow (Number): Starting row * - endRow (Number): Ending row * - indentString (String): The indent token * - * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. + * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. * * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. * - **/ + **/ this.indentRows = function(startRow, endRow, indentString) { indentString = indentString.replace(/\t/g, this.getTabString()); for (var row=startRow; row<=endRow; row++) @@ -7625,15 +7699,15 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesUp(firstRow, lastRow) -> Number - * - firstRow (Number): The starting row to move up + * EditSession.moveLinesUp(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to move up * - lastRow (Number): The final row to move up - * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. * * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. * * - **/ + **/ this.moveLinesUp = function(firstRow, lastRow) { if (firstRow <= 0) return 0; @@ -7643,7 +7717,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesDown(firstRow, lastRow) -> Number + * EditSession.moveLinesDown(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to move down * - lastRow (Number): The final row to move down * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. @@ -7660,16 +7734,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.duplicateLines(firstRow, lastRow) -> Number + * EditSession.duplicateLines(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to duplicate * - lastRow (Number): The final row to duplicate - * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. * * Duplicates all the text between `firstRow` and `lastRow`. * * * - **/ + **/ this.duplicateLines = function(firstRow, lastRow) { var firstRow = this.$clipRowToDocument(firstRow); var lastRow = this.$clipRowToDocument(lastRow); @@ -7725,7 +7799,7 @@ var EditSession = function(text, mode) { range.start.column ); } - + var len = this.doc.getLength() - 1; if (range.end.row > len) { range.end.row = len; @@ -7748,11 +7822,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUseWrapMode(useWrapMode) - * - useWrapMode (Boolean): Enable (or disable) wrap mode + * EditSession.setUseWrapMode(useWrapMode) + * - useWrapMode (Boolean): Enable (or disable) wrap mode * - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - **/ + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. + **/ this.setUseWrapMode = function(useWrapMode) { if (useWrapMode != this.$useWrapMode) { this.$useWrapMode = useWrapMode; @@ -7774,10 +7848,10 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWrapMode() -> Boolean - * - * Returns `true` if wrap mode is being used; `false` otherwise. - **/ + * EditSession.getUseWrapMode() -> Boolean + * + * Returns `true` if wrap mode is being used; `false` otherwise. + **/ this.getUseWrapMode = function() { return this.$useWrapMode; }; @@ -7787,12 +7861,12 @@ var EditSession = function(text, mode) { // in that direction. Or set both parameters to the same number to pin // the limit to that value. /** - * EditSession.setWrapLimitRange(min, max) - * - min (Number): The minimum wrap value (the left side wrap) + * EditSession.setWrapLimitRange(min, max) + * - min (Number): The minimum wrap value (the left side wrap) * - max (Number): The maximum wrap value (the right side wrap) * - * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. - **/ + * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. + **/ this.setWrapLimitRange = function(min, max) { if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { this.$wrapLimitRange.min = min; @@ -7804,11 +7878,11 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.adjustWrapLimit(desiredLimit) -> Boolean - * - desiredLimit (Number): The new wrap limit + * EditSession.adjustWrapLimit(desiredLimit) -> Boolean + * - desiredLimit (Number): The new wrap limit * - * This should generally only be called by the renderer when a resize is detected. - **/ + * This should generally only be called by the renderer when a resize is detected. + **/ this.adjustWrapLimit = function(desiredLimit) { var wrapLimit = this.$constrainWrapLimit(desiredLimit); if (wrapLimit != this.$wrapLimit && wrapLimit > 0) { @@ -7843,22 +7917,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWrapLimit() -> Number - * - * Returns the value of wrap limit. - **/ + * EditSession.getWrapLimit() -> Number + * + * Returns the value of wrap limit. + **/ this.getWrapLimit = function() { return this.$wrapLimit; }; /** - * EditSession.getWrapLimitRange() -> Object - * - * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: + * EditSession.getWrapLimitRange() -> Object + * + * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: * * { min: wrapLimitRange_min, max: wrapLimitRange_max } * - **/ + **/ this.getWrapLimitRange = function() { // Avoid unexpected mutation by returning a copy return { @@ -8211,10 +8285,10 @@ var EditSession = function(text, mode) { } /** internal, hide - * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] - * - str (String): The string to calculate the screen width of + * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] + * - str (String): The string to calculate the screen width of * - maxScreenColumn (Number): - * - screenColumn (Number): + * - screenColumn (Number): * + ([Number]): Returns an `int[]` array with two elements:
* The first position indicates the number of columns for `str` on screen.
* The second value contains the position of the document column that this function read until. @@ -8222,7 +8296,7 @@ var EditSession = function(text, mode) { * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. * * - **/ + **/ this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { if (maxScreenColumn == 0) { return [0, 0]; @@ -8255,12 +8329,12 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowLength(row) -> Number - * - row (Number): The row number to check + * EditSession.getRowLength(row) -> Number + * - row (Number): The row number to check * * - * Returns the length of the indicated row. - **/ + * Returns the length of the indicated row. + **/ this.getRowLength = function(row) { if (!this.$useWrapMode || !this.$wrapData[row]) { return 1; @@ -8270,8 +8344,8 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowHeight(config, row) -> Number - * - config (Object): An object containing a parameter indicating the `lineHeight`. + * EditSession.getRowHeight(config, row) -> Number + * - config (Object): An object containing a parameter indicating the `lineHeight`. * - row (Number): The row number to check * * Returns the height of the indicated row. This is mostly relevant for situations where wrapping occurs, and a single line spans across multiple rows. @@ -8282,40 +8356,40 @@ var EditSession = function(text, mode) { } /** internal, hide, related to: EditSession.documentToScreenColumn - * EditSession.getScreenLastRowColumn(screenRow) -> Number - * - screenRow (Number): The screen row to check + * EditSession.getScreenLastRowColumn(screenRow) -> Number + * - screenRow (Number): The screen row to check * - * Returns the column position (on screen) for the last character in the provided row. - **/ + * Returns the column position (on screen) for the last character in the provided row. + **/ this.getScreenLastRowColumn = function(screenRow) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE) return this.documentToScreenColumn(pos.row, pos.column); }; /** internal, hide - * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number - * - docRow (Number): + * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number + * - docRow (Number): * - docColumn (Number): * - **/ + **/ this.getDocumentLastRowColumn = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.getScreenLastRowColumn(screenRow); }; /** internal, hide - * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number - * - **/ + * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number + * + **/ this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); }; /** internal, hide - * EditSession.getRowSplitData(row) -> undefined | String + * EditSession.getRowSplitData(row) -> undefined | String * - **/ + **/ this.getRowSplitData = function(row) { if (!this.$useWrapMode) { return undefined; @@ -8325,41 +8399,41 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScreenTabSize(screenColumn) -> Number + * EditSession.getScreenTabSize(screenColumn) -> Number * - screenColumn (Number): The screen column to check - * - * The distance to the next tab stop at the specified screen column. - **/ + * + * The distance to the next tab stop at the specified screen column. + **/ this.getScreenTabSize = function(screenColumn) { return this.$tabSize - screenColumn % this.$tabSize; }; /** internal, hide - * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentRow = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).row; }; /** internal, hide - * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentColumn = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).column; }; /** related to: EditSession.documentToScreenPosition - * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object - * - screenRow (Number): The screen row to check + * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object + * - screenRow (Number): The screen row to check * - screenColumn (Number): The screen column to check - * + (Object): The object returned has two properties: `row` and `column`. + * + (Object): The object returned has two properties: `row` and `column`. * * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * + * * **/ this.screenToDocumentPosition = function(screenRow, screenColumn) { @@ -8458,12 +8532,12 @@ var EditSession = function(text, mode) { }; /** related to: EditSession.screenToDocumentPosition - * EditSession.documentToScreenPosition(docRow, docColumn) -> Object - * - docRow (Number): The document row to check + * EditSession.documentToScreenPosition(docRow, docColumn) -> Object + * - docRow (Number): The document row to check * - docColumn (Number): The document column to check * + (Object): The object returned by this method has two properties: `row` and `column`. * - * Converts document coordinates to screen coordinates. {:conversionConsiderations} + * Converts document coordinates to screen coordinates. {:conversionConsiderations} * * * @@ -8572,28 +8646,28 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.documentToScreenColumn(row, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenColumn(row, docColumn) -> Number + * + * + **/ this.documentToScreenColumn = function(row, docColumn) { return this.documentToScreenPosition(row, docColumn).column; }; /** internal, hide - * EditSession.documentToScreenRow(docRow, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenRow(docRow, docColumn) -> Number + * + * + **/ this.documentToScreenRow = function(docRow, docColumn) { return this.documentToScreenPosition(docRow, docColumn).row; }; /** - * EditSession.getScreenLength() -> Number - * - * Returns the length of the screen. - **/ + * EditSession.getScreenLength() -> Number + * + * Returns the length of the screen. + **/ this.getScreenLength = function() { var screenRows = 0; var fold = null; @@ -8799,7 +8873,8 @@ function deHyphenate(str) { return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); }); } -});/* +}); +/* * based on code from: * * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. @@ -8860,7 +8935,8 @@ exports.loadScript = function(path, callback) { s.onload = callback; }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -8949,10 +9025,10 @@ var Selection = function(session) { oop.implement(this, EventEmitter); /** - * Selection.isEmpty() -> Boolean - * - * Returns `true` if the selection is empty. - **/ + * Selection.isEmpty() -> Boolean + * + * Returns `true` if the selection is empty. + **/ this.isEmpty = function() { return (this.$isEmpty || ( this.selectionAnchor.row == this.selectionLead.row && @@ -8961,10 +9037,10 @@ var Selection = function(session) { }; /** - * Selection.isMultiLine() -> Boolean - * - * Returns `true` if the selection is a multi-line. - **/ + * Selection.isMultiLine() -> Boolean + * + * Returns `true` if the selection is a multi-line. + **/ this.isMultiLine = function() { if (this.isEmpty()) { return false; @@ -8974,7 +9050,7 @@ var Selection = function(session) { }; /** - * Selection.getCursor() -> Number + * Selection.getCursor() -> Number * * Gets the current position of the cursor. **/ @@ -8983,12 +9059,12 @@ var Selection = function(session) { }; /** - * Selection.setSelectionAnchor(row, column) - * - row (Number): The new row - * - column (Number): The new column + * Selection.setSelectionAnchor(row, column) + * - row (Number): The new row + * - column (Number): The new column * * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. - **/ + **/ this.setSelectionAnchor = function(row, column) { this.selectionAnchor.setPosition(row, column); @@ -8999,11 +9075,11 @@ var Selection = function(session) { }; /** related to: Anchor.getPosition - * Selection.getSelectionAnchor() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection anchor. + * Selection.getSelectionAnchor() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection anchor. * - **/ + **/ this.getSelectionAnchor = function() { if (this.$isEmpty) return this.getSelectionLead() @@ -9012,21 +9088,21 @@ var Selection = function(session) { }; /** - * Selection.getSelectionLead() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection lead. - **/ + * Selection.getSelectionLead() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection lead. + **/ this.getSelectionLead = function() { return this.selectionLead.getPosition(); }; /** - * Selection.shiftSelection(columns) - * - columns (Number): The number of columns to shift by - * + * Selection.shiftSelection(columns) + * - columns (Number): The number of columns to shift by + * * Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns. * - **/ + **/ this.shiftSelection = function(columns) { if (this.$isEmpty) { this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns); @@ -9049,10 +9125,10 @@ var Selection = function(session) { }; /** - * Selection.isBackwards() -> Boolean - * - * Returns `true` if the selection is going backwards in the document. - **/ + * Selection.isBackwards() -> Boolean + * + * Returns `true` if the selection is going backwards in the document. + **/ this.isBackwards = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -9060,10 +9136,10 @@ var Selection = function(session) { }; /** - * Selection.getRange() -> Range - * - * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} - **/ + * Selection.getRange() -> Range + * + * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} + **/ this.getRange = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -9080,10 +9156,10 @@ var Selection = function(session) { }; /** - * Selection.clearSelection() - * - * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} - **/ + * Selection.clearSelection() + * + * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} + **/ this.clearSelection = function() { if (!this.$isEmpty) { this.$isEmpty = true; @@ -9092,10 +9168,10 @@ var Selection = function(session) { }; /** - * Selection.selectAll() - * - * Selects all the text in the document. - **/ + * Selection.selectAll() + * + * Selects all the text in the document. + **/ this.selectAll = function() { var lastRow = this.doc.getLength() - 1; this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length); @@ -9103,13 +9179,13 @@ var Selection = function(session) { }; /** - * Selection.setSelectionRange(range, reverse) - * - range (Range): The range of text to select - * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not + * Selection.setSelectionRange(range, reverse) + * - range (Range): The range of text to select + * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not * * Sets the selection to the provided range. * - **/ + **/ this.setSelectionRange = function(range, reverse) { if (reverse) { this.setSelectionAnchor(range.end.row, range.end.column); @@ -9130,13 +9206,13 @@ var Selection = function(session) { }; /** - * Selection.selectTo(row, column) - * - row (Number): The row to select to - * - column (Number): The column to select to + * Selection.selectTo(row, column) + * - row (Number): The row to select to + * - column (Number): The column to select to * * Moves the selection cursor to the indicated row and column. * - **/ + **/ this.selectTo = function(row, column) { this.$moveSelection(function() { this.moveCursorTo(row, column); @@ -9144,12 +9220,12 @@ var Selection = function(session) { }; /** - * Selection.selectToPosition(pos) - * - pos (Object): An object containing the row and column - * + * Selection.selectToPosition(pos) + * - pos (Object): An object containing the row and column + * * Moves the selection cursor to the row and column indicated by `pos`. * - **/ + **/ this.selectToPosition = function(pos) { this.$moveSelection(function() { this.moveCursorToPosition(pos); @@ -9157,10 +9233,10 @@ var Selection = function(session) { }; /** - * Selection.selectUp() - * - * Moves the selection up one row. - **/ + * Selection.selectUp() + * + * Moves the selection up one row. + **/ this.selectUp = function() { this.$moveSelection(this.moveCursorUp); }; @@ -9193,10 +9269,10 @@ var Selection = function(session) { }; /** - * Selection.selectLineStart() - * - * Moves the selection to the beginning of the current line. - **/ + * Selection.selectLineStart() + * + * Moves the selection to the beginning of the current line. + **/ this.selectLineStart = function() { this.$moveSelection(this.moveCursorLineStart); }; @@ -9247,34 +9323,36 @@ var Selection = function(session) { }; /** related to: EditSession.getWordRange - * Selection.selectWord() - * - * Moves the selection to highlight the entire word. - **/ + * Selection.selectWord() + * + * Moves the selection to highlight the entire word. + **/ + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.selectionLead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { - var cursor = this.getCursor(); - var range = this.session.getWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); + this.setSelectionRange(this.getWordRange()); }; /** related to: EditSession.getAWordRange - * Selection.selectAWord() - * - * Selects a word, including its right whitespace. - **/ + * Selection.selectAWord() + * + * Selects a word, including its right whitespace. + **/ this.selectAWord = function() { var cursor = this.getCursor(); var range = this.session.getAWordRange(cursor.row, cursor.column); this.setSelectionRange(range); }; - /** - * Selection.selectLine() - * - * Selects the entire line. - **/ - this.selectLine = function() { - var rowStart = this.selectionLead.row; + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.selectionLead.row; var rowEnd; var foldLine = this.session.getFoldLine(rowStart); @@ -9284,35 +9362,44 @@ var Selection = function(session) { } else { rowEnd = rowStart; } - this.setSelectionAnchor(rowStart, 0); - this.$moveSelection(function() { - this.moveCursorTo(rowEnd + 1, 0); - }); + if (excludeLastChar) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + + /** + * Selection.selectLine() + * + * Selects the entire line. + **/ + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); }; /** - * Selection.moveCursorUp() - * - * Moves the cursor up one row. - **/ + * Selection.moveCursorUp() + * + * Moves the cursor up one row. + **/ this.moveCursorUp = function() { this.moveCursorBy(-1, 0); }; /** - * Selection.moveCursorDown() + * Selection.moveCursorDown() * * Moves the cursor down one row. - **/ + **/ this.moveCursorDown = function() { this.moveCursorBy(1, 0); }; /** - * Selection.moveCursorLeft() + * Selection.moveCursorLeft() * * Moves the cursor left one column. - **/ + **/ this.moveCursorLeft = function() { var cursor = this.selectionLead.getPosition(), fold; @@ -9335,7 +9422,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorRight() + * Selection.moveCursorRight() * * Moves the cursor right one column. **/ @@ -9361,7 +9448,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineStart() + * Selection.moveCursorLineStart() * * Moves the cursor to the start of the line. **/ @@ -9394,7 +9481,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineEnd() + * Selection.moveCursorLineEnd() * * Moves the cursor to the end of the line. **/ @@ -9409,7 +9496,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileEnd() + * Selection.moveCursorFileEnd() * * Moves the cursor to the end of the file. **/ @@ -9420,7 +9507,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileStart() + * Selection.moveCursorFileStart() * * Moves the cursor to the start of the file. **/ @@ -9429,11 +9516,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordRight() + * Selection.moveCursorLongWordRight() * * Moves the cursor to the word on the right. **/ - this.moveCursorWordRight = function() { + this.moveCursorLongWordRight = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; var line = this.doc.getLine(row); @@ -9476,11 +9563,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordLeft() + * Selection.moveCursorLongWordLeft() * * Moves the cursor to the word on the left. **/ - this.moveCursorWordLeft = function() { + this.moveCursorLongWordLeft = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; @@ -9526,8 +9613,94 @@ var Selection = function(session) { this.moveCursorTo(row, column); }; + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index <= 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index-- + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) + return this.moveCursorRight(); + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + if (column == 0) + return this.moveCursorLeft(); + + var str = this.session.getLine(row).substring(0, column); + var leftOfCursor = lang.stringReverse(str); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + /** related to: EditSession.documentToScreenPosition - * Selection.moveCursorBy(rows, chars) + * Selection.moveCursorBy(rows, chars) * - rows (Number): The number of rows to move by * - chars (Number): The number of characters to move by * @@ -9553,23 +9726,23 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToPosition(position) - * - position (Object): The position to move to - * + * Selection.moveCursorToPosition(position) + * - position (Object): The position to move to + * * Moves the selection to the position indicated by its `row` and `column`. - **/ + **/ this.moveCursorToPosition = function(position) { this.moveCursorTo(position.row, position.column); }; /** - * Selection.moveCursorTo(row, column, keepDesiredColumn) - * - row (Number): The row to move to - * - column (Number): The column to move to + * Selection.moveCursorTo(row, column, keepDesiredColumn) + * - row (Number): The row to move to + * - column (Number): The column to move to * - keepDesiredColumn (Boolean): [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} * * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} - **/ + **/ this.moveCursorTo = function(row, column, keepDesiredColumn) { // Ensure the row/column is not inside of a fold. var fold = this.session.getFoldAt(row, column, 1); @@ -9587,13 +9760,13 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToScreen(row, column, keepDesiredColumn) + * Selection.moveCursorToScreen(row, column, keepDesiredColumn) * - row (Number): The row to move to * - column (Number): The column to move to * - keepDesiredColumn (Boolean): {:preventUpdateBool} * * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} - **/ + **/ this.moveCursorToScreen = function(row, column, keepDesiredColumn) { var pos = this.session.screenToDocumentPosition(row, column); this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); @@ -10835,7 +11008,8 @@ var Behaviour = function() { }).call(Behaviour.prototype); exports.Behaviour = Behaviour; -});ace.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { +}); +ace.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { "use strict"; /* @@ -10941,7 +11115,8 @@ function addUnicodePackage (pack) { exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -11021,11 +11196,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -11033,21 +11208,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -11074,10 +11249,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -11137,82 +11312,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -11223,14 +11397,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -11255,10 +11429,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -11266,7 +11440,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -11286,16 +11460,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -11319,7 +11493,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -11330,7 +11504,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -11356,14 +11530,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -11397,7 +11571,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -11427,15 +11601,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -11451,12 +11625,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -11475,9 +11649,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -11485,7 +11659,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -11507,10 +11681,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -13002,7 +13176,9 @@ function FoldLine(foldData, folds) { && fold.start.column != column && fold.start.row != row) { - throw "Moving characters inside of a fold should never be reached"; + //throwing here breaks whole editor + //@todo properly handle this + window.console && window.console.log(row, column, fold); } else if (fold.start.row == row) { folds = this.folds; var i = folds.indexOf(fold); @@ -13096,7 +13272,8 @@ function FoldLine(foldData, folds) { }).call(FoldLine.prototype); exports.FoldLine = FoldLine; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -13211,7 +13388,8 @@ var Fold = exports.Fold = function(range, placeholder) { }).call(Fold.prototype); -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -14031,7 +14209,7 @@ var CommandManager = function(platform, commands) { this.addCommands(commands); this.setDefaultHandler("exec", function(e) { - e.command.exec(e.editor, e.args || {}); + return e.command.exec(e.editor, e.args || {}); }); }; @@ -14051,8 +14229,18 @@ oop.inherits(CommandManager, HashHandler); if (editor && editor.$readOnly && !command.readOnly) return false; - this._emit("exec", {editor: editor, command: command, args: args}); - return true; + try { + var retvalue = this._emit("exec", { + editor: editor, + command: command, + args: args + }); + } catch (e) { + window.console && window.console.log(e); + return true; + } + + return retvalue === false ? false : true; }; this.toggleRecording = function() { @@ -14194,6 +14382,18 @@ function HashHandler(config, platform) { } }; + this.bindKey = function(key, command) { + if(!key) + return; + + var ckb = this.commmandKeyBinding; + key.split("|").forEach(function(keyPart) { + var binding = this.parseKeys(keyPart, command); + var hashId = binding.hashId; + (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; + }, this); + }; + this.addCommands = function(commands) { commands && Object.keys(commands).forEach(function(name) { var command = commands[name]; @@ -14216,18 +14416,6 @@ function HashHandler(config, platform) { }, this); }; - this.bindKey = function(key, command) { - if(!key) - return; - - var ckb = this.commmandKeyBinding; - key.split("|").forEach(function(keyPart) { - var binding = parseKeys(keyPart, command); - var hashId = binding.hashId; - (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; - }); - }; - this.bindKeys = function(keyList) { Object.keys(keyList).forEach(function(key) { this.bindKey(key, keyList[key]); @@ -14243,10 +14431,10 @@ function HashHandler(config, platform) { this.bindKey(key, command); }; - function parseKeys(keys, val, ret) { + this.parseKeys = function(keys, val) { var key; var hashId = 0; - var parts = splitSafe(keys.toLowerCase()); + var parts = keys.toLowerCase().trim().split(/\s*\-\s*/); for (var i = 0, l = parts.length; i < l; i++) { if (keyUtil.KEY_MODS[parts[i]]) @@ -14259,17 +14447,12 @@ function HashHandler(config, platform) { key: key, hashId: hashId }; - } - - function splitSafe(s) { - return (s.trim() - .split(new RegExp("[\\s ]*\\-[\\s ]*", "g"), 999)); - } + }; this.findKeyCommand = function findKeyCommand(hashId, keyString) { var ckbr = this.commmandKeyBinding; return ckbr[hashId] && ckbr[hashId][keyString.toLowerCase()]; - } + }; this.handleKeyboard = function(data, hashId, keyString, keyCode) { return { @@ -14280,7 +14463,8 @@ function HashHandler(config, platform) { }).call(HashHandler.prototype) exports.HashHandler = HashHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -14525,6 +14709,7 @@ var VirtualRenderer = function(container, theme) { this.$gutterLayer = new GutterLayer(this.$gutter); this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true)); + this.setFadeFoldWidgets(true); this.$markerBack = new MarkerLayer(this.content); @@ -14540,14 +14725,15 @@ var VirtualRenderer = function(container, theme) { this.$cursorPadding = 8; // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = true; - this.$horizScrollAlwaysVisible = true; + this.$horizScroll = false; + this.$horizScrollAlwaysVisible = false; this.$animatedScroll = false; this.scrollBar = new ScrollBar(container); this.scrollBar.addEventListener("scroll", function(e) { - _self.session.setScrollTop(e.data); + if (!_self.$inScrollAnimation) + _self.session.setScrollTop(e.data); }); this.scrollTop = 0; @@ -14558,12 +14744,9 @@ var VirtualRenderer = function(container, theme) { _self.scrollLeft = scrollLeft; _self.session.setScrollLeft(scrollLeft); - if (scrollLeft == 0) { - _self.$gutter.className = "ace_gutter"; - } - else { - _self.$gutter.className = "ace_gutter horscroll"; - } + _self.scroller.className = scrollLeft == 0 + ? "ace_scroller" + : "ace_scroller horscroll"; }); this.cursorPos = { @@ -14635,12 +14818,16 @@ var VirtualRenderer = function(container, theme) { **/ this.setSession = function(session) { this.session = session; + + this.scroller.className = "ace_scroller"; + this.$cursorLayer.setSession(session); this.$markerBack.setSession(session); this.$markerFront.setSession(session); this.$gutterLayer.setSession(session); this.$textLayer.setSession(session); this.$loop.schedule(this.CHANGE_FULL); + }; /** @@ -14859,6 +15046,17 @@ var VirtualRenderer = function(container, theme) { this.onResize(true); }; + this.getFadeFoldWidgets = function(){ + return dom.hasCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + + this.setFadeFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.$gutter, "ace_fade-fold-widgets"); + else + dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + this.$updatePrintMargin = function() { var containerEl; @@ -15302,18 +15500,18 @@ var VirtualRenderer = function(container, theme) { this.$cursorLayer.showCursor(); }; - this.scrollSelectionIntoView = function(anchor, lead) { + this.scrollSelectionIntoView = function(anchor, lead, offset) { // first scroll anchor into view then scroll lead into view - this.scrollCursorIntoView(anchor); - this.scrollCursorIntoView(lead); + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); }; /** - * VirtualRenderer.scrollCursorIntoView() -> Void + * VirtualRenderer.scrollCursorIntoView(cursor, offset) -> Void * * Scrolls the cursor into the first visibile area of the editor **/ - this.scrollCursorIntoView = function(cursor) { + this.scrollCursorIntoView = function(cursor, offset) { // the editor is not visible if (this.$size.scrollerHeight === 0) return; @@ -15324,10 +15522,12 @@ var VirtualRenderer = function(container, theme) { var top = pos.top; if (this.scrollTop > top) { + if (offset) + top -= offset * this.$size.scrollerHeight; this.session.setScrollTop(top); - } - - if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + } else if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + if (offset) + top += offset * this.$size.scrollerHeight; this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); } @@ -15337,9 +15537,7 @@ var VirtualRenderer = function(container, theme) { if (left < this.$padding + 2 * this.layerConfig.characterWidth) left = 0; this.session.setScrollLeft(left); - } - - if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); } }; @@ -15390,36 +15588,70 @@ var VirtualRenderer = function(container, theme) { this.session.setScrollTop(row * this.lineHeight); }; + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + /** - * VirtualRenderer.scrollToLine(line, center) -> Void + * VirtualRenderer.scrollToLine(line, center, animate, callback) -> Void * - line (Number): A line number * - center (Boolean): If `true`, centers the editor the to indicated line - * + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called after the animation has finished + * * Gracefully scrolls the editor to the row indicated. **/ - this.scrollToLine = function(line, center) { + this.scrollToLine = function(line, center, animate, callback) { var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); var offset = pos.top; if (center) offset -= this.$size.scrollerHeight / 2; - if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) { - var _self = this; - var steps = _self.$calcSteps(this.scrollTop, offset); - - clearInterval(this.$timer); - this.$timer = setInterval(function() { - _self.session.setScrollTop(steps.shift()); - - if (!steps.length) - clearInterval(_self.$timer); - }, 10); - } - else { + var initialScroll = this.scrollTop; this.session.setScrollTop(offset); - } + if (animate !== false) + this.animateScrolling(initialScroll, callback); }; + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) { + var _self = this; + var steps = _self.$calcSteps(fromValue, toValue); + this.$inScrollAnimation = true; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + // trick session to think it's already scrolled to not loose toValue + _self.session.$scrollTop = toValue; + } else { + this.$inScrollAnimation = false; + clearInterval(_self.$timer); + + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + callback && callback(); + } + }, 10); + } + }; + /** * VirtualRenderer.scrollToY(scrollTop) -> Number * - scrollTop (Number): The position to scroll to @@ -16096,7 +16328,8 @@ var Marker = function(parentEl) { exports.Marker = Marker; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -16488,21 +16721,18 @@ var Text = function(parentEl) { this.$renderToken = function(stringBuilder, screenColumn, token, value) { var self = this; - var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g; + var replaceReg = /\t|&|<|( +)|([\u0000-\u0019\u00a0\u2000-\u200b\u2028\u2029\u3000])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (c.charCodeAt(0) == 32) { + if (a) { return new Array(c.length+1).join(" "); + } else if (c == "&") { + return useragent.isOldGecko ? "&" : "&"; + } else if (c == "<") { + return "<"; } else if (c == "\t") { var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); screenColumn += tabSize - 1; return self.$tabStrings[tabSize]; - } else if (c == "&") { - if (useragent.isOldGecko) - return "&"; - else - return "&"; - } else if (c == "<") { - return "<"; } else if (c == "\u3000") { // U+3000 is both invisible AND full-width, so must be handled uniquely var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; @@ -16511,13 +16741,11 @@ var Text = function(parentEl) { return "" + space + ""; - } else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) { - if (self.showInvisibles) { - var space = new Array(c.length+1).join(self.SPACE_CHAR); - return "" + space + ""; - } else { + } else if (b) { + if (self.showInvisibles) + return "" + self.SPACE_CHAR + ""; + else return " "; - } } else { screenColumn += 1; return " 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) + return; + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + + this.toggleBlockSelection = function () { if (this.rangeCount > 1) { var ranges = this.rangeList.ranges; var lastRange = ranges[ranges.length - 1]; @@ -17725,7 +18003,7 @@ var EditSession = require("./edit_session").EditSession; // extend Editor var Editor = require("./editor").Editor; (function() { - + /** extension * Editor.updateSelectionMarkers() * @@ -17789,13 +18067,13 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onRemoveRange = function(e) { this.removeSelectionMarkers(e.ranges); this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onMultiSelect = function(e) { if (this.inMultiSelectMode) return; @@ -17808,7 +18086,7 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onSingleSelect = function(e) { if (this.session.multiSelect.inVirtualMode) return; @@ -17876,9 +18154,9 @@ var Editor = require("./editor").Editor; this.onCursorChange(); this.onSelectionChange(); }; - + /** extension - * Editor.exitMultiSelectMode() + * Editor.exitMultiSelectMode() -> Void * * Removes all the selections except the last added one. **/ @@ -17904,15 +18182,35 @@ var Editor = require("./editor").Editor; return text; }; + this.onPaste = function(text) { + this._emit("paste", text); + if (!this.inMultiSelectMode) + return this.insert(text); + + var lines = text.split(this.session.getDocument().getNewLineCharacter()); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length) { + this.commands.exec("insertstring", this, text); + return; + } + + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + }; + /** extension - * Editor.findAll(needle, dir, additive) -> Number - * - needle (String): The text to find - * - options (Object): Any of the additional [[Search search options]] - * - additive (Boolean): TODO - * + (Number): The number of found ranges. + * Editor.findAll(dir, options) -> Number + * - needle: text to find + * - options: search options + * - additive: keeps * * Finds and selects all the occurences of `needle`. - * **/ this.findAll = function(needle, options, additive) { options = options || {}; @@ -17925,10 +18223,10 @@ var Editor = require("./editor").Editor; this.$blockScrolling += 1; var selection = this.multiSelect; - + if (!additive) selection.toSingleRange(ranges[0]); - + for (var i = ranges.length; i--; ) selection.addRange(ranges[i], true); @@ -17988,7 +18286,6 @@ var Editor = require("./editor").Editor; * - dir (Number): The direction to rotate selections * * Transposes the selected ranges. - * **/ this.transposeSelections = function(dir) { var session = this.session; @@ -18006,7 +18303,7 @@ var Editor = require("./editor").Editor; } } sel.mergeOverlappingRanges(); - + var words = []; for (var i = all.length; i--; ) { var range = all[i]; @@ -18113,7 +18410,7 @@ function MultiSelect(editor) { editor.on("mousedown", onMouseDown); editor.commands.addCommands(exports.commands.defaultCommands); - + addAltCursorListeners(editor); } @@ -18121,7 +18418,7 @@ function addAltCursorListeners(editor){ var el = editor.textInput.getElement(); var altCursor = false; var contentEl = editor.renderer.content; - el.addEventListener("keydown", function(e) { + event.addListener(el, "keydown", function(e) { if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { if (!altCursor) { contentEl.style.cursor = "crosshair"; @@ -18131,9 +18428,9 @@ function addAltCursorListeners(editor){ contentEl.style.cursor = ""; } }); - - el.addEventListener("keyup", reset); - el.addEventListener("blur", reset); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); function reset() { if (altCursor) { contentEl.style.cursor = ""; @@ -18144,7 +18441,8 @@ function addAltCursorListeners(editor){ exports.MultiSelect = MultiSelect; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -18541,7 +18839,8 @@ function onMouseDown(e) { exports.onMouseDown = onMouseDown; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -18627,20 +18926,22 @@ exports.defaultCommands = [{ exec: function(editor) { editor.multiSelect.splitIntoLines(); }, bindKey: {win: "Ctrl-Shift-L", mac: "Ctrl-Shift-L"}, readonly: true -}]; - -// commands active in multiselect mode -exports.multiEditCommands = [{ +}, { name: "singleSelection", bindKey: "esc", exec: function(editor) { editor.exitMultiSelectMode(); }, - readonly: true + readonly: true, + isAvailable: function(editor) {return editor.inMultiSelectMode} }]; +// commands active in multiselect mode +exports.multiEditCommands = {"singleSelection": "esc"}; + var HashHandler = require("../keyboard/hash_handler").HashHandler; exports.keyboardHandler = new HashHandler(exports.multiEditCommands); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -19442,8 +19743,8 @@ exports.cssText = ".ace-tm .ace_editor {\ }\ \ .ace-tm .ace_line .ace_invalid {\ - background-color: rgb(153, 0, 0);\ - color: white;\ + background-color: rgba(255, 0, 0, 0.1);\ + color: red;\ }\ \ .ace-tm .ace_line .ace_support.ace_function {\ @@ -19530,6 +19831,9 @@ exports.cssText = ".ace-tm .ace_editor {\ .ace-tm .ace_marker-layer .ace_active_line {\ background: rgba(0, 0, 0, 0.07);\ }\ +.ace-tm .ace_gutter_active_line{\ + background-color : #dcdcdc;\ +}\ \ .ace-tm .ace_marker-layer .ace_selected_word {\ background: rgb(250, 250, 255);\ diff --git a/build/src/ace-uncompressed.js b/build/src/ace-uncompressed.js index b2cd993f..a22c5518 100644 --- a/build/src/ace-uncompressed.js +++ b/build/src/ace-uncompressed.js @@ -304,7 +304,8 @@ exports.edit = function(el) { return editor; }; -});// vim:set ts=4 sts=4 sw=4 st: +}); +// vim:set ts=4 sts=4 sw=4 st: // -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License // -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project) // -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified @@ -322,7 +323,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1490,7 +1492,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -2234,7 +2237,8 @@ exports.keyCodeToString = function(keyCode) { return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); } -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2480,6 +2484,7 @@ var Editor = function(renderer, session) { this.container = container; this.renderer = renderer; + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); this.textInput = new TextInput(renderer.getTextAreaContainer(), this); this.keyBinding = new KeyBinding(this); @@ -2496,7 +2501,6 @@ var Editor = function(renderer, session) { wrap: true }); - this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); this.setSession(session || new EditSession("")); }; @@ -2860,6 +2864,7 @@ var Editor = function(renderer, session) { this.$highlightBrackets(); this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); }; /** internal, hide @@ -2872,29 +2877,40 @@ var Editor = function(renderer, session) { if (session.$highlightLineMarker) session.removeMarker(session.$highlightLineMarker); + + session.$highlightLineMarker = null; + + if (this.$highlightActiveLine) { + var cursor = this.getCursorPosition(); + var foldLine = this.session.getFoldLine(cursor.row); + + if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { + var range; + if (foldLine) { + range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); + } else { + range = new Range(cursor.row, 0, cursor.row+1, 0); + } + session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); + } + } + }; + + /** internal, hide + * Editor.$updateHighlightGutterLine() + * + * + **/ + this.$updateHighlightGutterLine = function(){ if (typeof this.$lastrow == "number") this.renderer.removeGutterDecoration(this.$lastrow, "ace_gutter_active_line"); - session.$highlightLineMarker = null; this.$lastrow = null; - if (this.getHighlightActiveLine()) { - var cursor = this.getCursorPosition(), - foldLine = this.session.getFoldLine(cursor.row); - - if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { - var range; - if (foldLine) { - range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); - } else { - range = new Range(cursor.row, 0, cursor.row+1, 0); - } - session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); - } - - this.renderer.addGutterDecoration(this.$lastrow = cursor.row, "ace_gutter_active_line"); - } - }; + if (this.$highlightGutterLine) + this.renderer.addGutterDecoration( + this.$lastrow = this.getCursorPosition().row, "ace_gutter_active_line"); + } /** * Editor@onSelectionChange(e) @@ -2916,6 +2932,7 @@ var Editor = function(renderer, session) { session.$selectionMarker = session.addMarker(range, "ace_selection", style); } else { this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); } if (this.$highlightSelectedWord) @@ -2994,6 +3011,7 @@ var Editor = function(renderer, session) { // Update the active line marker as due to folding changes the current // line range on the screen might have changed. this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); // TODO: This might be too much updating. Okay for now. this.renderer.updateFull(); }; @@ -3012,15 +3030,34 @@ var Editor = function(renderer, session) { return text; }; + /** + * Editor.onCopy() + * + * Called whenever a text "copy" happens. + **/ + this.onCopy = function() { + this.commands.exec("copy", this); + }; + /** * Editor.onCut() * - * Emitted whenever a text "cut" happens. + * called whenever a text "cut" happens. **/ this.onCut = function() { this.commands.exec("cut", this); }; + /** + * Editor.onPaste() + * + * called whenever a text "paste" happens. + **/ + this.onPaste = function(text) { + this._emit("paste", text); + this.insert(text); + }; + /** * Editor.insert(text) * - text (String): The new text to add @@ -3126,11 +3163,8 @@ var Editor = function(renderer, session) { * * Emitted when text is entered. **/ - this.onTextInput = function(text, pasted) { - if (pasted) - this._emit("paste", text); - - this.keyBinding.onTextInput(text, pasted); + this.onTextInput = function(text) { + this.keyBinding.onTextInput(text); }; /** @@ -3246,7 +3280,8 @@ var Editor = function(renderer, session) { * **/ this.setHighlightActiveLine = function(shouldHighlight) { - if (this.$highlightActiveLine == shouldHighlight) return; + if (this.$highlightActiveLine == shouldHighlight) + return; this.$highlightActiveLine = shouldHighlight; this.$updateHighlightActiveLine(); @@ -3261,6 +3296,19 @@ var Editor = function(renderer, session) { return this.$highlightActiveLine; }; + this.$highlightGutterLine = true; + this.setHighlightGutterLine = function(shouldHighlightGutterLine) { + if (this.$highlightGutterLine == shouldHighlightGutterLine) + return; + + this.$highlightGutterLine = shouldHighlightGutterLine; + this.$updateHighlightGutterLine(); + }; + + this.getHighlightGutterLine = function() { + return this.$highlightGutterLine; + }; + this.$highlightSelectedWord = true; /** * Editor.setHighlightSelectedWord(shouldHighlight) @@ -3415,6 +3463,14 @@ var Editor = function(renderer, session) { return this.renderer.$gutterLayer.getShowFoldWidgets(); }; + this.setFadeFoldWidgets = function(show) { + this.renderer.setFadeFoldWidgets(show); + }; + + this.getFadeFoldWidgets = function() { + return this.renderer.getFadeFoldWidgets(); + }; + /** * Editor.remove(dir) * - dir (String): The direction of the deletion to occur, either "left" or "right" @@ -3424,7 +3480,7 @@ var Editor = function(renderer, session) { **/ this.remove = function(dir) { if (this.selection.isEmpty()){ - if(dir == "left") + if (dir == "left") this.selection.selectLeft(); else this.selection.selectRight(); @@ -3849,15 +3905,29 @@ var Editor = function(renderer, session) { return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; }; - this.$getPageDownRow = function() { - return this.renderer.getScrollBottomRow(); - }; + this.$moveByPage = function(dir, select) { + var renderer = this.renderer; + var config = this.renderer.layerConfig; + var rows = dir * Math.floor(config.height / config.lineHeight); - this.$getPageUpRow = function() { - var firstRow = this.renderer.getScrollTopRow(); - var lastRow = this.renderer.getScrollBottomRow(); + this.$blockScrolling++; + if (select == true) { + this.selection.$moveSelection(function(){ + this.moveCursorBy(rows, 0); + }); + } else if (select == false) { + this.selection.moveCursorBy(rows, 0); + this.selection.clearSelection(); + } + this.$blockScrolling--; - return firstRow - (lastRow - firstRow); + var scrollTop = renderer.scrollTop; + + renderer.scrollBy(0, rows * config.lineHeight); + if (select != null) + renderer.scrollCursorIntoView(null, 0.5); + + renderer.animateScrolling(scrollTop); }; /** @@ -3866,14 +3936,7 @@ var Editor = function(renderer, session) { * Selects the text from the current position of the document until where a "page down" finishes. **/ this.selectPageDown = function() { - var row = this.$getPageDownRow() + Math.floor(this.$getVisibleRowCount() / 2); - - this.scrollPageDown(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); + this.$moveByPage(1, true); }; /** @@ -3882,15 +3945,7 @@ var Editor = function(renderer, session) { * Selects the text from the current position of the document until where a "page up" finishes. **/ this.selectPageUp = function() { - var visibleRows = this.renderer.getScrollTopRow() - this.renderer.getScrollBottomRow(); - var row = this.$getPageUpRow() + Math.round(visibleRows / 2); - - this.scrollPageUp(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); + this.$moveByPage(-1, true); }; /** @@ -3899,11 +3954,7 @@ var Editor = function(renderer, session) { * Shifts the document to wherever "page down" is, as well as moving the cursor position. **/ this.gotoPageDown = function() { - var row = this.$getPageDownRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); + this.$moveByPage(1, false); }; /** @@ -3912,11 +3963,7 @@ var Editor = function(renderer, session) { * Shifts the document to wherever "page up" is, as well as moving the cursor position. **/ this.gotoPageUp = function() { - var row = this.$getPageUpRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); + this.$moveByPage(-1, false); }; /** @@ -3925,7 +3972,7 @@ var Editor = function(renderer, session) { * Scrolls the document to wherever "page down" is, without changing the cursor position. **/ this.scrollPageDown = function() { - this.scrollToRow(this.$getPageDownRow()); + this.$moveByPage(1); }; /** @@ -3934,7 +3981,7 @@ var Editor = function(renderer, session) { * Scrolls the document to wherever "page up" is, without changing the cursor position. **/ this.scrollPageUp = function() { - this.renderer.scrollToRow(this.$getPageUpRow()); + this.$moveByPage(-1); }; /** related to: VirtualRenderer.scrollToRow @@ -3952,11 +3999,13 @@ var Editor = function(renderer, session) { * Editor.scrollToLine(line, center) * - line (Number): The line to scroll to * - center (Boolean): If `true` + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called when the animation has finished * - * TODO scrollsa to line, if center == true, puts line in middle of screen or attempts to) + * TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to) **/ - this.scrollToLine = function(line, center) { - this.renderer.scrollToLine(line, center); + this.scrollToLine = function(line, center, animate, callback) { + this.renderer.scrollToLine(line, center, animate, callback); }; /** @@ -4074,19 +4123,21 @@ var Editor = function(renderer, session) { * Editor.gotoLine(lineNumber, column) * - lineNumber (Number): The line number to go to * - column (Number): A column number to go to + * - animate (Boolean): If `true` animates scolling * * Moves the cursor to the specified line number, and also into the indiciated column. * **/ - this.gotoLine = function(lineNumber, column) { + this.gotoLine = function(lineNumber, column, animate) { this.selection.clearSelection(); this.session.unfold({row: lineNumber - 1, column: column || 0}); this.$blockScrolling += 1; - this.moveCursorTo(lineNumber-1, column || 0); + this.moveCursorTo(lineNumber - 1, column || 0); this.$blockScrolling -= 1; - if (!this.isRowFullyVisible(this.getCursorPosition().row)) - this.scrollToLine(lineNumber, true); + + if (!this.isRowFullyVisible(lineNumber - 1)) + this.scrollToLine(lineNumber - 1, true, animate); }; /** related to: Editor.moveCursorTo @@ -4192,8 +4243,10 @@ var Editor = function(renderer, session) { * Moves the cursor to the end of the current file. Note that this does de-select the current selection. **/ this.navigateFileEnd = function() { + var scrollTop = this.renderer.scrollTop; this.selection.moveCursorFileEnd(); this.clearSelection(); + this.renderer.animateScrolling(scrollTop); }; /** @@ -4202,8 +4255,10 @@ var Editor = function(renderer, session) { * Moves the cursor to the start of the current file. Note that this does de-select the current selection. **/ this.navigateFileStart = function() { + var scrollTop = this.renderer.scrollTop; this.selection.moveCursorFileStart(); this.clearSelection(); + this.renderer.animateScrolling(scrollTop); }; /** @@ -4312,44 +4367,45 @@ var Editor = function(renderer, session) { * Editor.find(needle, options) * - needle (String): The text to search for * - options (Object): An object defining various search properties + * - animate (Boolean): If `true` animate scrolling * * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. **/ - this.find = function(needle, options) { + this.find = function(needle, options, animate) { this.clearSelection(); options = options || {}; options.needle = needle; this.$search.set(options); - this.$find(); + this.$find(false, animate); }; /** related to: Editor.find * Editor.findNext(options) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling * * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. **/ - this.findNext = function(options) { + this.findNext = function(options, animate) { options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = false; this.$search.set(options); - this.$find(); + this.$find(false, animate); }; /** related to: Editor.find * Editor.findPrevious(options) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling * * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. **/ - this.findPrevious = function(options) { + this.findPrevious = function(options, animate) { options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = true; this.$search.set(options); - this.$find(); + this.$find(true, animate); }; - this.$find = function(backwards) { + this.$find = function(backwards, animate) { if (!this.selection.isEmpty()) this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())}); @@ -4358,24 +4414,14 @@ var Editor = function(renderer, session) { var range = this.$search.find(this.session); if (range) { - this.session.unfold(range); - this.$blockScrolling += 1; + this.session.unfold(range); this.selection.setSelectionRange(range); this.$blockScrolling -= 1; - if (this.getAnimatedScroll()) { - var cursor = this.getCursorPosition(); - if (!this.isRowFullyVisible(cursor.row)) - this.scrollToLine(cursor.row, true); - - //@todo scroll X - //if (!this.isColumnFullyVisible(cursor.column)) - //this.scrollToRow(cursor.column); - } - else { - this.renderer.scrollSelectionIntoView(range.start, range.end); - } + var scrollTop = this.renderer.scrollTop; + this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); + this.renderer.animateScrolling(scrollTop); } }; @@ -4385,7 +4431,10 @@ var Editor = function(renderer, session) { * {:UndoManager.undo} **/ this.undo = function() { + this.$blockScrolling++; this.session.getUndoManager().undo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); }; /** related to: UndoManager.redo @@ -4394,7 +4443,10 @@ var Editor = function(renderer, session) { * {:UndoManager.redo} **/ this.redo = function() { + this.$blockScrolling++; this.session.getUndoManager().redo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); }; /** @@ -4635,13 +4687,18 @@ var TextInput = function(parentNode, host) { if (!copied) { var value = valueToSend || text.value; if (value) { - if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) { - value = value.slice(0, -1); - if (value) - host.onTextInput(value, pasted); + if (value.length > 1) { + if (value.charAt(0) == PLACEHOLDER) + value = value.substr(1); + else if (value.charAt(value.length - 1) == PLACEHOLDER) + value = value.slice(0, -1); } - else { - host.onTextInput(value, pasted); + + if (value && value != PLACEHOLDER) { + if (pasted) + host.onPaste(value); + else + host.onTextInput(value); } // If editor is no longer focused we quit immediately, since @@ -4662,7 +4719,7 @@ var TextInput = function(parentNode, host) { var onTextInput = function(e) { setTimeout(function () { if (!inCompostion) - sendText(e.data); + sendText(e.data); }, 0); }; @@ -4718,6 +4775,7 @@ var TextInput = function(parentNode, host) { }; event.addCommandKeyListener(text, host.onCommandKey.bind(host)); + if (useragent.isOldIE) { var keytable = { 13:1, 27:1 }; event.addListener(text, "keyup", function (e) { @@ -5040,6 +5098,19 @@ function DefaultHandlers(editor) { var selectionEmpty = selectionRange.isEmpty(); var state = STATE_UNKNOWN; + var button = ev.getButton(); + if (button !== 0) { + if (selectionEmpty) { + editor.moveCursorToPosition(pos); + editor.selection.clearSelection(); + } + if (button == 2) { + editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); + event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); + } + return; + } + // if this click caused the editor to be focused should not clear the // selection if ( @@ -5053,18 +5124,6 @@ function DefaultHandlers(editor) { return; } - var button = ev.getButton(); - if (button !== 0) { - if (selectionEmpty) { - editor.moveCursorToPosition(pos); - } - if (button == 2) { - editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); - event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); - } - return; - } - if (!inSelection) { // Directly pick STATE_SELECT, since the user is not clicking inside // a selection. @@ -5426,7 +5485,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -5469,7 +5528,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -5522,7 +5582,8 @@ function GutterHandler(editor) { exports.GutterHandler = GutterHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -5736,7 +5797,8 @@ function FoldHandler(editor) { exports.FoldHandler = FoldHandler; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -5785,15 +5847,27 @@ require("../commands/default_commands"); var KeyBinding = function(editor) { this.$editor = editor; this.$data = { }; - this.$handlers = [this]; + this.$handlers = []; + this.setDefaultHandler(editor.commands); }; (function() { + this.setDefaultHandler = function(keyboardHandler) { + this.removeKeyboardHandler(this.$defaultHandler); + this.$defaultHandler = keyboardHandler; + if (keyboardHandler) + this.$handlers.unshift(keyboardHandler); + this.$data = { }; + }; + this.setKeyboardHandler = function(keyboardHandler) { if (this.$handlers[this.$handlers.length - 1] == keyboardHandler) return; this.$data = { }; - this.$handlers = keyboardHandler ? [this, keyboardHandler] : [this]; + this.$handlers = []; + this.setDefaultHandler(this.$defaultHandler); + if (keyboardHandler) + this.$handlers.push(keyboardHandler); }; this.addKeyboardHandler = function(keyboardHandler) { @@ -5831,7 +5905,7 @@ var KeyBinding = function(editor) { // allow keyboardHandler to consume keys if (toExecute.command != "null") - success = commands.exec(toExecute.command, this.$editor, toExecute.args); + success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); else success = true; @@ -5841,20 +5915,14 @@ var KeyBinding = function(editor) { return success; }; - this.handleKeyboard = function(data, hashId, keyString) { - return { - command: this.$editor.commands.findKeyCommand(hashId, keyString) - }; - }; - this.onCommandKey = function(e, hashId, keyCode) { var keyString = keyUtil.keyCodeToString(keyCode); this.$callKeyboardHandlers(hashId, keyString, keyCode, e); }; - this.onTextInput = function(text, pasted) { + this.onTextInput = function(text) { var success = false; - if (!pasted && text.length == 1) + if (text.length == 1) success = this.$callKeyboardHandlers(0, text); if (!success) this.$editor.commands.exec("insertstring", this.$editor, text); @@ -6177,7 +6245,7 @@ exports.commands = [{ multiSelectAction: "forEach" }, { name: "togglecomment", - bindKey: bindKey("Ctrl-7", "Command-7"), + bindKey: bindKey("Ctrl-/", "Command-/"), exec: function(editor) { editor.toggleCommentLines(); }, multiSelectAction: "forEach" }, { @@ -6399,10 +6467,7 @@ var EditSession = function(text, mode) { } this.selection = new Selection(this); - if (mode) - this.setMode(mode); - else - this.setMode(new TextMode()); + this.setMode(mode); }; @@ -6463,21 +6528,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession@onChangeFold(e) - * + * EditSession@onChangeFold(e) + * * Emitted when a code fold changes its state. * - **/ + **/ this.onChangeFold = function(e) { var fold = e.data; this.$resetRowCache(fold.start.row); }; /** - * EditSession@onChange(e) - * - * Emitted when the document changes. - **/ + * EditSession@onChange(e) + * + * Emitted when the document changes. + **/ this.onChange = function(e) { var delta = e.data; this.$modified = true; @@ -6502,12 +6567,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setValue(text) - * - text (String): The new text to place + * EditSession.setValue(text) + * - text (String): The new text to place * * Sets the session text. - * - **/ + * + **/ this.setValue = function(text) { this.doc.setValue(text); this.selection.moveCursorTo(0, 0); @@ -6538,16 +6603,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getSelection() -> String - * - * Returns the string of the current selection. - **/ + * EditSession.getSelection() -> String + * + * Returns the string of the current selection. + **/ this.getSelection = function() { return this.selection; }; /** related to: BackgroundTokenizer.getState - * EditSession.getState(row) -> Array + * EditSession.getState(row) -> Array * - row (Number): The row to start at * * {:BackgroundTokenizer.getState} @@ -6558,7 +6623,7 @@ var EditSession = function(text, mode) { }; /** related to: BackgroundTokenizer.getTokens - * EditSession.getTokens(firstRow, lastRow) -> Array + * EditSession.getTokens(firstRow, lastRow) -> Array * - firstRow (Number): The row to start at * - lastRow (Number): The row to finish at * @@ -6570,12 +6635,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTokenAt(row, column) -> Array - * - row (Number): The row number to retrieve from + * EditSession.getTokenAt(row, column) -> Array + * - row (Number): The row number to retrieve from * - column (Number): The column number to retrieve from * - * Returns an array of tokens at the indicated row and column. - **/ + * Returns an array of tokens at the indicated row and column. + **/ this.getTokenAt = function(row, column) { var tokens = this.bgTokenizer.getTokens(row, row)[0].tokens; var token, c = 0; @@ -6598,11 +6663,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoManager(undoManager) - * - undoManager (UndoManager): The new undo manager - * + * EditSession.setUndoManager(undoManager) + * - undoManager (UndoManager): The new undo manager + * * Sets the undo manager. - **/ + **/ this.setUndoManager = function(undoManager) { this.$undoManager = undoManager; this.$resetRowCache(0); @@ -6616,10 +6681,10 @@ var EditSession = function(text, mode) { if (undoManager) { var self = this; /** internal, hide - * EditSession.$syncInformUndoManager() - * - * - **/ + * EditSession.$syncInformUndoManager() + * + * + **/ this.$syncInformUndoManager = function() { self.$informUndoManager.cancel(); @@ -6660,19 +6725,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUndoManager() -> UndoManager - * - * Returns the current undo manager. - **/ + * EditSession.getUndoManager() -> UndoManager + * + * Returns the current undo manager. + **/ this.getUndoManager = function() { return this.$undoManager || this.$defaultUndoManager; }, /** - * EditSession.getTabString() -> String - * - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - **/ + * EditSession.getTabString() -> String + * + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + **/ this.getTabString = function() { if (this.getUseSoftTabs()) { return lang.stringRepeat(" ", this.getTabSize()); @@ -6683,12 +6748,12 @@ var EditSession = function(text, mode) { this.$useSoftTabs = true; /** - * EditSession.setUseSoftTabs(useSoftTabs) - * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs - * + * EditSession.setUseSoftTabs(useSoftTabs) + * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs + * * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). * - **/ + **/ this.setUseSoftTabs = function(useSoftTabs) { if (this.$useSoftTabs === useSoftTabs) return; @@ -6696,22 +6761,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseSoftTabs() -> Boolean - * - * Returns `true` if soft tabs are being used, `false` otherwise. + * EditSession.getUseSoftTabs() -> Boolean + * + * Returns `true` if soft tabs are being used, `false` otherwise. * - **/ + **/ this.getUseSoftTabs = function() { return this.$useSoftTabs; }; this.$tabSize = 4; /** - * EditSession.setTabSize(tabSize) - * - tabSize (Number): The new tab size - * + * EditSession.setTabSize(tabSize) + * - tabSize (Number): The new tab size + * * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - **/ + **/ this.setTabSize = function(tabSize) { if (isNaN(tabSize) || this.$tabSize === tabSize) return; @@ -6721,32 +6786,32 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTabSize() -> Number - * - * Returns the current tab size. - **/ + * EditSession.getTabSize() -> Number + * + * Returns the current tab size. + **/ this.getTabSize = function() { return this.$tabSize; }; /** - * EditSession.isTabStop(position) -> Boolean - * - position (Object): The position to check - * + * EditSession.isTabStop(position) -> Boolean + * - position (Object): The position to check + * * Returns `true` if the character at the position is a soft tab. - **/ + **/ this.isTabStop = function(position) { return this.$useSoftTabs && (position.column % this.$tabSize == 0); }; this.$overwrite = false; /** - * EditSession.setOverwrite(overwrite) - * - overwrite (Boolean): Defines wheter or not to set overwrites - * + * EditSession.setOverwrite(overwrite) + * - overwrite (Boolean): Defines wheter or not to set overwrites + * * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * - **/ + **/ this.setOverwrite = function(overwrite) { if (this.$overwrite == overwrite) return; @@ -6755,39 +6820,39 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getOverwrite() -> Boolean - * - * Returns `true` if overwrites are enabled; `false` otherwise. - **/ + * EditSession.getOverwrite() -> Boolean + * + * Returns `true` if overwrites are enabled; `false` otherwise. + **/ this.getOverwrite = function() { return this.$overwrite; }; /** - * EditSession.toggleOverwrite() - * - * Sets the value of overwrite to the opposite of whatever it currently is. - **/ + * EditSession.toggleOverwrite() + * + * Sets the value of overwrite to the opposite of whatever it currently is. + **/ this.toggleOverwrite = function() { this.setOverwrite(!this.$overwrite); }; /** - * EditSession.getBreakpoints() -> Array - * - * Returns an array of numbers, indicating which rows have breakpoints. - **/ + * EditSession.getBreakpoints() -> Array + * + * Returns an array of numbers, indicating which rows have breakpoints. + **/ this.getBreakpoints = function() { return this.$breakpoints; }; /** - * EditSession.setBreakpoints(rows) - * - rows (Array): An array of row indicies - * + * EditSession.setBreakpoints(rows) + * - rows (Array): An array of row indicies + * * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * - **/ + **/ this.setBreakpoints = function(rows) { this.$breakpoints = []; for (var i=0; i Number - * - range (Range): Define the range of the marker + * EditSession.addMarker(range, clazz, type = "line", inFront) -> Number + * - range (Range): Define the range of the marker * - clazz (String): Set the CSS class for the marker * - type (Function | String): Identify the type of the marker * - inFront (Boolean): Set to `true` to establish a front marker * - * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. + * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. * - **/ + **/ this.addMarker = function(range, clazz, type, inFront) { var id = this.$markerId++; @@ -6861,12 +6926,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.removeMarker(markerId) - * - markerId (Number): A number representing a marker + * EditSession.removeMarker(markerId) + * - markerId (Number): A number representing a marker * * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. - * - **/ + * + **/ this.removeMarker = function(markerId) { var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId]; if (!marker) @@ -6880,12 +6945,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMarkers(inFront) -> Array - * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers + * EditSession.getMarkers(inFront) -> Array + * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers * * Returns an array containing the IDs of all the markers, either front or back. - * - **/ + * + **/ this.getMarkers = function(inFront) { return inFront ? this.$frontMarkers : this.$backMarkers; }; @@ -6900,11 +6965,11 @@ var EditSession = function(text, mode) { * } */ /** - * EditSession.setAnnotations(annotations) - * - annotations (Array): A list of annotations + * EditSession.setAnnotations(annotations) + * - annotations (Array): A list of annotations * - * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - **/ + * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. + **/ this.setAnnotations = function(annotations) { this.$annotations = {}; for (var i=0; i Object - * - * Returns the annotations for the `EditSession`. - **/ + * EditSession.getAnnotations() -> Object + * + * Returns the annotations for the `EditSession`. + **/ this.getAnnotations = function() { return this.$annotations || {}; }; /** - * EditSession.clearAnnotations() - * - * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. - **/ + * EditSession.clearAnnotations() + * + * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. + **/ this.clearAnnotations = function() { this.$annotations = {}; this._emit("changeAnnotation", {}); }; /** internal, hide - * EditSession.$detectNewLine(text) - * - text (String): A block of text - * + * EditSession.$detectNewLine(text) + * - text (String): A block of text + * * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. * - **/ + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r?\n)/m); if (match) { @@ -6954,13 +7019,13 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWordRange(row, column) -> Range - * - row (Number): The row to start at + * EditSession.getWordRange(row, column) -> Range + * - row (Number): The row to start at * - column (Number): The column to start at * - * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. * - **/ + **/ this.getWordRange = function(row, column) { var line = this.getLine(row); @@ -6993,12 +7058,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getAWordRange(row, column) -> Range - * - row (Number): The row number to start from + * EditSession.getAWordRange(row, column) -> Range + * - row (Number): The row number to start from * - column (Number): The column number to start from - * + * * Gets the range of a word, including its right whitespace. - **/ + **/ this.getAWordRange = function(row, column) { var wordRange = this.getWordRange(row, column); var line = this.getLine(wordRange.end.row); @@ -7010,20 +7075,20 @@ var EditSession = function(text, mode) { }; /** related to: Document.setNewLineMode - * EditSession.setNewLineMode(newLineMode) - * - newLineMode (String): {:Document.setNewLineMode.param} + * EditSession.setNewLineMode(newLineMode) + * - newLineMode (String): {:Document.setNewLineMode.param} * - * {:Document.setNewLineMode.desc} - **/ + * {:Document.setNewLineMode.desc} + **/ this.setNewLineMode = function(newLineMode) { this.doc.setNewLineMode(newLineMode); }; /** related to: Document.getNewLineMode - * EditSession.getNewLineMode() -> String - * - * Returns the current new line mode. - **/ + * EditSession.getNewLineMode() -> String + * + * Returns the current new line mode. + **/ this.getNewLineMode = function() { return this.doc.getNewLineMode(); }; @@ -7031,12 +7096,12 @@ var EditSession = function(text, mode) { this.$useWorker = true; /** - * EditSession.setUseWorker(useWorker) - * - useWorker (Boolean): Set to `true` to use a worker - * + * EditSession.setUseWorker(useWorker) + * - useWorker (Boolean): Set to `true` to use a worker + * * Identifies if you want to use a worker for the `EditSession`. * - **/ + **/ this.setUseWorker = function(useWorker) { if (this.$useWorker == useWorker) return; @@ -7049,19 +7114,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWorker() -> Boolean - * - * Returns `true` if workers are being used. - **/ + * EditSession.getUseWorker() -> Boolean + * + * Returns `true` if workers are being used. + **/ this.getUseWorker = function() { return this.$useWorker; }; /** - * EditSession@onReloadTokenizer(e) - * - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ + * EditSession@onReloadTokenizer(e) + * + * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + **/ this.onReloadTokenizer = function(e) { var rows = e.data; this.bgTokenizer.start(rows.first); @@ -7072,7 +7137,7 @@ var EditSession = function(text, mode) { this._loadMode = function(mode, callback) { if (this.$modes[mode]) return callback(this.$modes[mode]); - + var _self = this; var module; try { @@ -7080,16 +7145,17 @@ var EditSession = function(text, mode) { } catch (e) {}; if (module) return done(module); - + fetch(function() { require([mode], done); }); - + function done(module) { if (_self.$modes[mode]) return callback(_self.$modes[mode]); - + _self.$modes[mode] = new module.Mode(); + _self.$modes[mode].$id = mode; _self._emit("loadmode", { name: mode, mode: _self.$modes[mode] @@ -7100,40 +7166,48 @@ var EditSession = function(text, mode) { function fetch(callback) { if (!config.get("packaged")) return callback(); - + var base = mode.split("/").pop(); var filename = config.get("modePath") + "/mode-" + base + config.get("suffix"); net.loadScript(filename, callback); } }; + /** + * EditSession.setMode(mode) + * - mode (TextMode): Set a new text mode + * + * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. + * + **/ this.$mode = null; - this.$origMode = null; - /** - * EditSession.setMode(mode) - * - mode (TextMode): Set a new text mode - * - * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * - **/ + this.$modeId = null; this.setMode = function(mode) { - this.$origMode = mode; - // load on demand if (typeof mode === "string") { + if (this.$modeId == mode) + return; + + this.$modeId = mode; var _self = this; this._loadMode(mode, function(module) { - if (_self.$origMode !== mode) + if (_self.$modeId !== mode) return; - + _self.setMode(module); }); return; + } else if (mode == null) { + mode = "ace/mode/text" + this.$modeId = mode; + this.$modes[mode] = this.$modes[mode] || (new TextMode()); + this.setMode(this.$modes[mode]); + return; } - + if (this.$mode === mode) return; this.$mode = mode; - + this.$modeId = mode.$id; this.$stopWorker(); @@ -7200,21 +7274,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMode() -> TextMode - * - * Returns the current text mode. - **/ + * EditSession.getMode() -> TextMode + * + * Returns the current text mode. + **/ this.getMode = function() { return this.$mode; }; - + this.$scrollTop = 0; /** - * EditSession.setScrollTop(scrollTop) - * - scrollTop (Number): The new scroll top value + * EditSession.setScrollTop(scrollTop) + * - scrollTop (Number): The new scroll top value * - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - **/ + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. + **/ this.setScrollTop = function(scrollTop) { scrollTop = Math.round(Math.max(0, scrollTop)); if (this.$scrollTop === scrollTop) @@ -7225,20 +7299,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollTop() -> Number - * - * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - **/ + * EditSession.getScrollTop() -> Number + * + * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} + **/ this.getScrollTop = function() { return this.$scrollTop; }; - + this.$scrollLeft = 0; /** - * EditSession.setScrollLeft(scrollLeft) - * - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - **/ + * EditSession.setScrollLeft(scrollLeft) + * + * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + **/ this.setScrollLeft = function(scrollLeft) { scrollLeft = Math.round(Math.max(0, scrollLeft)); if (this.$scrollLeft === scrollLeft) @@ -7249,29 +7323,29 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollLeft() -> Number - * - * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - **/ + * EditSession.getScrollLeft() -> Number + * + * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} + **/ this.getScrollLeft = function() { return this.$scrollLeft; }; /** - * EditSession.getWidth() -> Number - * - * Returns the width of the document. - **/ + * EditSession.getWidth() -> Number + * + * Returns the width of the document. + **/ this.getWidth = function() { this.$computeWidth(); return this.width; }; /** - * EditSession.getScreenWidth() -> Number - * - * Returns the width of the screen. - **/ + * EditSession.getScreenWidth() -> Number + * + * Returns the width of the screen. + **/ this.getScreenWidth = function() { this.$computeWidth(); return this.screenWidth; @@ -7317,18 +7391,18 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLine - * EditSession.getLine(row) -> String - * - row (Number): The row to retrieve from - * + * EditSession.getLine(row) -> String + * - row (Number): The row to retrieve from + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.doc.getLine(row); }; /** related to: Document.getLines - * EditSession.getLines(firstRow, lastRow) -> Array + * EditSession.getLines(firstRow, lastRow) -> Array * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve * @@ -7340,7 +7414,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLength - * EditSession.getLength()-> Number + * EditSession.getLength()-> Number * * Returns the number of rows in the document. **/ @@ -7349,7 +7423,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getTextRange - * EditSession.getTextRange(range) -> Array + * EditSession.getTextRange(range) -> Array * - range (String): The range to work with * * {:Document.getTextRange.desc} @@ -7359,7 +7433,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insert - * EditSession.insert(position, text) -> Number + * EditSession.insert(position, text) -> Number * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. @@ -7373,7 +7447,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.remove - * EditSession.remove(range) -> Object + * EditSession.remove(range) -> Object * - range (Range): A specified Range to remove * + (Object): The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * @@ -7386,12 +7460,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.undoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.undoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): [If `true`, doesn't select the range of where the change occured]{: #dontSelect} * - * Reverts previous changes to your document. - **/ + * Reverts previous changes to your document. + **/ this.undoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -7419,12 +7493,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.redoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.redoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): {:dontSelect} * - * Re-implements a previously undone change to your document. - **/ + * Re-implements a previously undone change to your document. + **/ this.redoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -7448,20 +7522,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoSelect(enable) - * - enable (Boolean): If `true`, selects the range of the reinserted change + * EditSession.setUndoSelect(enable) + * - enable (Boolean): If `true`, selects the range of the reinserted change * - * ENables or disables highlighting of the range where an undo occured. - **/ + * ENables or disables highlighting of the range where an undo occured. + **/ this.setUndoSelect = function(enable) { this.$undoSelect = enable; }; /** internal, hide - * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range - * - * - **/ + * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range + * + * + **/ this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { function isInsert(delta) { var insert = @@ -7517,7 +7591,7 @@ var EditSession = function(text, mode) { }, /** related to: Document.replace - * EditSession.replace(range, text) -> Object + * EditSession.replace(range, text) -> Object * - range (Range): A specified Range to replace * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this:
@@ -7535,17 +7609,17 @@ var EditSession = function(text, mode) { }; /** - * EditSession.moveText(fromRange, toPosition) -> Range - * - fromRange (Range): The range of text you want moved within the document + * EditSession.moveText(fromRange, toPosition) -> Range + * - fromRange (Range): The range of text you want moved within the document * - toPosition (Object): The location (row and column) where you want to move the text to * + (Range): The new range where the text was moved to. * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: * * { row: newRowLocation, column: newColumnLocation } - * + * * * - **/ + **/ this.moveText = function(fromRange, toPosition) { var text = this.getTextRange(fromRange); this.remove(fromRange); @@ -7577,16 +7651,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.indentRows(startRow, endRow, indentString) - * - startRow (Number): Starting row + * EditSession.indentRows(startRow, endRow, indentString) + * - startRow (Number): Starting row * - endRow (Number): Ending row * - indentString (String): The indent token * - * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. + * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. * * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. * - **/ + **/ this.indentRows = function(startRow, endRow, indentString) { indentString = indentString.replace(/\t/g, this.getTabString()); for (var row=startRow; row<=endRow; row++) @@ -7625,15 +7699,15 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesUp(firstRow, lastRow) -> Number - * - firstRow (Number): The starting row to move up + * EditSession.moveLinesUp(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to move up * - lastRow (Number): The final row to move up - * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. * * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. * * - **/ + **/ this.moveLinesUp = function(firstRow, lastRow) { if (firstRow <= 0) return 0; @@ -7643,7 +7717,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesDown(firstRow, lastRow) -> Number + * EditSession.moveLinesDown(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to move down * - lastRow (Number): The final row to move down * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. @@ -7660,16 +7734,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.duplicateLines(firstRow, lastRow) -> Number + * EditSession.duplicateLines(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to duplicate * - lastRow (Number): The final row to duplicate - * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. * * Duplicates all the text between `firstRow` and `lastRow`. * * * - **/ + **/ this.duplicateLines = function(firstRow, lastRow) { var firstRow = this.$clipRowToDocument(firstRow); var lastRow = this.$clipRowToDocument(lastRow); @@ -7725,7 +7799,7 @@ var EditSession = function(text, mode) { range.start.column ); } - + var len = this.doc.getLength() - 1; if (range.end.row > len) { range.end.row = len; @@ -7748,11 +7822,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUseWrapMode(useWrapMode) - * - useWrapMode (Boolean): Enable (or disable) wrap mode + * EditSession.setUseWrapMode(useWrapMode) + * - useWrapMode (Boolean): Enable (or disable) wrap mode * - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - **/ + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. + **/ this.setUseWrapMode = function(useWrapMode) { if (useWrapMode != this.$useWrapMode) { this.$useWrapMode = useWrapMode; @@ -7774,10 +7848,10 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWrapMode() -> Boolean - * - * Returns `true` if wrap mode is being used; `false` otherwise. - **/ + * EditSession.getUseWrapMode() -> Boolean + * + * Returns `true` if wrap mode is being used; `false` otherwise. + **/ this.getUseWrapMode = function() { return this.$useWrapMode; }; @@ -7787,12 +7861,12 @@ var EditSession = function(text, mode) { // in that direction. Or set both parameters to the same number to pin // the limit to that value. /** - * EditSession.setWrapLimitRange(min, max) - * - min (Number): The minimum wrap value (the left side wrap) + * EditSession.setWrapLimitRange(min, max) + * - min (Number): The minimum wrap value (the left side wrap) * - max (Number): The maximum wrap value (the right side wrap) * - * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. - **/ + * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. + **/ this.setWrapLimitRange = function(min, max) { if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { this.$wrapLimitRange.min = min; @@ -7804,11 +7878,11 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.adjustWrapLimit(desiredLimit) -> Boolean - * - desiredLimit (Number): The new wrap limit + * EditSession.adjustWrapLimit(desiredLimit) -> Boolean + * - desiredLimit (Number): The new wrap limit * - * This should generally only be called by the renderer when a resize is detected. - **/ + * This should generally only be called by the renderer when a resize is detected. + **/ this.adjustWrapLimit = function(desiredLimit) { var wrapLimit = this.$constrainWrapLimit(desiredLimit); if (wrapLimit != this.$wrapLimit && wrapLimit > 0) { @@ -7843,22 +7917,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWrapLimit() -> Number - * - * Returns the value of wrap limit. - **/ + * EditSession.getWrapLimit() -> Number + * + * Returns the value of wrap limit. + **/ this.getWrapLimit = function() { return this.$wrapLimit; }; /** - * EditSession.getWrapLimitRange() -> Object - * - * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: + * EditSession.getWrapLimitRange() -> Object + * + * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: * * { min: wrapLimitRange_min, max: wrapLimitRange_max } * - **/ + **/ this.getWrapLimitRange = function() { // Avoid unexpected mutation by returning a copy return { @@ -8211,10 +8285,10 @@ var EditSession = function(text, mode) { } /** internal, hide - * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] - * - str (String): The string to calculate the screen width of + * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] + * - str (String): The string to calculate the screen width of * - maxScreenColumn (Number): - * - screenColumn (Number): + * - screenColumn (Number): * + ([Number]): Returns an `int[]` array with two elements:
* The first position indicates the number of columns for `str` on screen.
* The second value contains the position of the document column that this function read until. @@ -8222,7 +8296,7 @@ var EditSession = function(text, mode) { * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. * * - **/ + **/ this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { if (maxScreenColumn == 0) { return [0, 0]; @@ -8255,12 +8329,12 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowLength(row) -> Number - * - row (Number): The row number to check + * EditSession.getRowLength(row) -> Number + * - row (Number): The row number to check * * - * Returns the length of the indicated row. - **/ + * Returns the length of the indicated row. + **/ this.getRowLength = function(row) { if (!this.$useWrapMode || !this.$wrapData[row]) { return 1; @@ -8270,8 +8344,8 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowHeight(config, row) -> Number - * - config (Object): An object containing a parameter indicating the `lineHeight`. + * EditSession.getRowHeight(config, row) -> Number + * - config (Object): An object containing a parameter indicating the `lineHeight`. * - row (Number): The row number to check * * Returns the height of the indicated row. This is mostly relevant for situations where wrapping occurs, and a single line spans across multiple rows. @@ -8282,40 +8356,40 @@ var EditSession = function(text, mode) { } /** internal, hide, related to: EditSession.documentToScreenColumn - * EditSession.getScreenLastRowColumn(screenRow) -> Number - * - screenRow (Number): The screen row to check + * EditSession.getScreenLastRowColumn(screenRow) -> Number + * - screenRow (Number): The screen row to check * - * Returns the column position (on screen) for the last character in the provided row. - **/ + * Returns the column position (on screen) for the last character in the provided row. + **/ this.getScreenLastRowColumn = function(screenRow) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE) return this.documentToScreenColumn(pos.row, pos.column); }; /** internal, hide - * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number - * - docRow (Number): + * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number + * - docRow (Number): * - docColumn (Number): * - **/ + **/ this.getDocumentLastRowColumn = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.getScreenLastRowColumn(screenRow); }; /** internal, hide - * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number - * - **/ + * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number + * + **/ this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); }; /** internal, hide - * EditSession.getRowSplitData(row) -> undefined | String + * EditSession.getRowSplitData(row) -> undefined | String * - **/ + **/ this.getRowSplitData = function(row) { if (!this.$useWrapMode) { return undefined; @@ -8325,41 +8399,41 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScreenTabSize(screenColumn) -> Number + * EditSession.getScreenTabSize(screenColumn) -> Number * - screenColumn (Number): The screen column to check - * - * The distance to the next tab stop at the specified screen column. - **/ + * + * The distance to the next tab stop at the specified screen column. + **/ this.getScreenTabSize = function(screenColumn) { return this.$tabSize - screenColumn % this.$tabSize; }; /** internal, hide - * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentRow = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).row; }; /** internal, hide - * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentColumn = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).column; }; /** related to: EditSession.documentToScreenPosition - * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object - * - screenRow (Number): The screen row to check + * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object + * - screenRow (Number): The screen row to check * - screenColumn (Number): The screen column to check - * + (Object): The object returned has two properties: `row` and `column`. + * + (Object): The object returned has two properties: `row` and `column`. * * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * + * * **/ this.screenToDocumentPosition = function(screenRow, screenColumn) { @@ -8458,12 +8532,12 @@ var EditSession = function(text, mode) { }; /** related to: EditSession.screenToDocumentPosition - * EditSession.documentToScreenPosition(docRow, docColumn) -> Object - * - docRow (Number): The document row to check + * EditSession.documentToScreenPosition(docRow, docColumn) -> Object + * - docRow (Number): The document row to check * - docColumn (Number): The document column to check * + (Object): The object returned by this method has two properties: `row` and `column`. * - * Converts document coordinates to screen coordinates. {:conversionConsiderations} + * Converts document coordinates to screen coordinates. {:conversionConsiderations} * * * @@ -8572,28 +8646,28 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.documentToScreenColumn(row, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenColumn(row, docColumn) -> Number + * + * + **/ this.documentToScreenColumn = function(row, docColumn) { return this.documentToScreenPosition(row, docColumn).column; }; /** internal, hide - * EditSession.documentToScreenRow(docRow, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenRow(docRow, docColumn) -> Number + * + * + **/ this.documentToScreenRow = function(docRow, docColumn) { return this.documentToScreenPosition(docRow, docColumn).row; }; /** - * EditSession.getScreenLength() -> Number - * - * Returns the length of the screen. - **/ + * EditSession.getScreenLength() -> Number + * + * Returns the length of the screen. + **/ this.getScreenLength = function() { var screenRows = 0; var fold = null; @@ -8799,7 +8873,8 @@ function deHyphenate(str) { return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); }); } -});/* +}); +/* * based on code from: * * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. @@ -8860,7 +8935,8 @@ exports.loadScript = function(path, callback) { s.onload = callback; }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -8949,10 +9025,10 @@ var Selection = function(session) { oop.implement(this, EventEmitter); /** - * Selection.isEmpty() -> Boolean - * - * Returns `true` if the selection is empty. - **/ + * Selection.isEmpty() -> Boolean + * + * Returns `true` if the selection is empty. + **/ this.isEmpty = function() { return (this.$isEmpty || ( this.selectionAnchor.row == this.selectionLead.row && @@ -8961,10 +9037,10 @@ var Selection = function(session) { }; /** - * Selection.isMultiLine() -> Boolean - * - * Returns `true` if the selection is a multi-line. - **/ + * Selection.isMultiLine() -> Boolean + * + * Returns `true` if the selection is a multi-line. + **/ this.isMultiLine = function() { if (this.isEmpty()) { return false; @@ -8974,7 +9050,7 @@ var Selection = function(session) { }; /** - * Selection.getCursor() -> Number + * Selection.getCursor() -> Number * * Gets the current position of the cursor. **/ @@ -8983,12 +9059,12 @@ var Selection = function(session) { }; /** - * Selection.setSelectionAnchor(row, column) - * - row (Number): The new row - * - column (Number): The new column + * Selection.setSelectionAnchor(row, column) + * - row (Number): The new row + * - column (Number): The new column * * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. - **/ + **/ this.setSelectionAnchor = function(row, column) { this.selectionAnchor.setPosition(row, column); @@ -8999,11 +9075,11 @@ var Selection = function(session) { }; /** related to: Anchor.getPosition - * Selection.getSelectionAnchor() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection anchor. + * Selection.getSelectionAnchor() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection anchor. * - **/ + **/ this.getSelectionAnchor = function() { if (this.$isEmpty) return this.getSelectionLead() @@ -9012,21 +9088,21 @@ var Selection = function(session) { }; /** - * Selection.getSelectionLead() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection lead. - **/ + * Selection.getSelectionLead() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection lead. + **/ this.getSelectionLead = function() { return this.selectionLead.getPosition(); }; /** - * Selection.shiftSelection(columns) - * - columns (Number): The number of columns to shift by - * + * Selection.shiftSelection(columns) + * - columns (Number): The number of columns to shift by + * * Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns. * - **/ + **/ this.shiftSelection = function(columns) { if (this.$isEmpty) { this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns); @@ -9049,10 +9125,10 @@ var Selection = function(session) { }; /** - * Selection.isBackwards() -> Boolean - * - * Returns `true` if the selection is going backwards in the document. - **/ + * Selection.isBackwards() -> Boolean + * + * Returns `true` if the selection is going backwards in the document. + **/ this.isBackwards = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -9060,10 +9136,10 @@ var Selection = function(session) { }; /** - * Selection.getRange() -> Range - * - * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} - **/ + * Selection.getRange() -> Range + * + * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} + **/ this.getRange = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -9080,10 +9156,10 @@ var Selection = function(session) { }; /** - * Selection.clearSelection() - * - * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} - **/ + * Selection.clearSelection() + * + * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} + **/ this.clearSelection = function() { if (!this.$isEmpty) { this.$isEmpty = true; @@ -9092,10 +9168,10 @@ var Selection = function(session) { }; /** - * Selection.selectAll() - * - * Selects all the text in the document. - **/ + * Selection.selectAll() + * + * Selects all the text in the document. + **/ this.selectAll = function() { var lastRow = this.doc.getLength() - 1; this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length); @@ -9103,13 +9179,13 @@ var Selection = function(session) { }; /** - * Selection.setSelectionRange(range, reverse) - * - range (Range): The range of text to select - * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not + * Selection.setSelectionRange(range, reverse) + * - range (Range): The range of text to select + * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not * * Sets the selection to the provided range. * - **/ + **/ this.setSelectionRange = function(range, reverse) { if (reverse) { this.setSelectionAnchor(range.end.row, range.end.column); @@ -9130,13 +9206,13 @@ var Selection = function(session) { }; /** - * Selection.selectTo(row, column) - * - row (Number): The row to select to - * - column (Number): The column to select to + * Selection.selectTo(row, column) + * - row (Number): The row to select to + * - column (Number): The column to select to * * Moves the selection cursor to the indicated row and column. * - **/ + **/ this.selectTo = function(row, column) { this.$moveSelection(function() { this.moveCursorTo(row, column); @@ -9144,12 +9220,12 @@ var Selection = function(session) { }; /** - * Selection.selectToPosition(pos) - * - pos (Object): An object containing the row and column - * + * Selection.selectToPosition(pos) + * - pos (Object): An object containing the row and column + * * Moves the selection cursor to the row and column indicated by `pos`. * - **/ + **/ this.selectToPosition = function(pos) { this.$moveSelection(function() { this.moveCursorToPosition(pos); @@ -9157,10 +9233,10 @@ var Selection = function(session) { }; /** - * Selection.selectUp() - * - * Moves the selection up one row. - **/ + * Selection.selectUp() + * + * Moves the selection up one row. + **/ this.selectUp = function() { this.$moveSelection(this.moveCursorUp); }; @@ -9193,10 +9269,10 @@ var Selection = function(session) { }; /** - * Selection.selectLineStart() - * - * Moves the selection to the beginning of the current line. - **/ + * Selection.selectLineStart() + * + * Moves the selection to the beginning of the current line. + **/ this.selectLineStart = function() { this.$moveSelection(this.moveCursorLineStart); }; @@ -9247,34 +9323,36 @@ var Selection = function(session) { }; /** related to: EditSession.getWordRange - * Selection.selectWord() - * - * Moves the selection to highlight the entire word. - **/ + * Selection.selectWord() + * + * Moves the selection to highlight the entire word. + **/ + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.selectionLead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { - var cursor = this.getCursor(); - var range = this.session.getWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); + this.setSelectionRange(this.getWordRange()); }; /** related to: EditSession.getAWordRange - * Selection.selectAWord() - * - * Selects a word, including its right whitespace. - **/ + * Selection.selectAWord() + * + * Selects a word, including its right whitespace. + **/ this.selectAWord = function() { var cursor = this.getCursor(); var range = this.session.getAWordRange(cursor.row, cursor.column); this.setSelectionRange(range); }; - /** - * Selection.selectLine() - * - * Selects the entire line. - **/ - this.selectLine = function() { - var rowStart = this.selectionLead.row; + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.selectionLead.row; var rowEnd; var foldLine = this.session.getFoldLine(rowStart); @@ -9284,35 +9362,44 @@ var Selection = function(session) { } else { rowEnd = rowStart; } - this.setSelectionAnchor(rowStart, 0); - this.$moveSelection(function() { - this.moveCursorTo(rowEnd + 1, 0); - }); + if (excludeLastChar) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + + /** + * Selection.selectLine() + * + * Selects the entire line. + **/ + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); }; /** - * Selection.moveCursorUp() - * - * Moves the cursor up one row. - **/ + * Selection.moveCursorUp() + * + * Moves the cursor up one row. + **/ this.moveCursorUp = function() { this.moveCursorBy(-1, 0); }; /** - * Selection.moveCursorDown() + * Selection.moveCursorDown() * * Moves the cursor down one row. - **/ + **/ this.moveCursorDown = function() { this.moveCursorBy(1, 0); }; /** - * Selection.moveCursorLeft() + * Selection.moveCursorLeft() * * Moves the cursor left one column. - **/ + **/ this.moveCursorLeft = function() { var cursor = this.selectionLead.getPosition(), fold; @@ -9335,7 +9422,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorRight() + * Selection.moveCursorRight() * * Moves the cursor right one column. **/ @@ -9361,7 +9448,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineStart() + * Selection.moveCursorLineStart() * * Moves the cursor to the start of the line. **/ @@ -9394,7 +9481,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineEnd() + * Selection.moveCursorLineEnd() * * Moves the cursor to the end of the line. **/ @@ -9409,7 +9496,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileEnd() + * Selection.moveCursorFileEnd() * * Moves the cursor to the end of the file. **/ @@ -9420,7 +9507,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileStart() + * Selection.moveCursorFileStart() * * Moves the cursor to the start of the file. **/ @@ -9429,11 +9516,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordRight() + * Selection.moveCursorLongWordRight() * * Moves the cursor to the word on the right. **/ - this.moveCursorWordRight = function() { + this.moveCursorLongWordRight = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; var line = this.doc.getLine(row); @@ -9476,11 +9563,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordLeft() + * Selection.moveCursorLongWordLeft() * * Moves the cursor to the word on the left. **/ - this.moveCursorWordLeft = function() { + this.moveCursorLongWordLeft = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; @@ -9526,8 +9613,94 @@ var Selection = function(session) { this.moveCursorTo(row, column); }; + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index <= 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index-- + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) + return this.moveCursorRight(); + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + if (column == 0) + return this.moveCursorLeft(); + + var str = this.session.getLine(row).substring(0, column); + var leftOfCursor = lang.stringReverse(str); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + /** related to: EditSession.documentToScreenPosition - * Selection.moveCursorBy(rows, chars) + * Selection.moveCursorBy(rows, chars) * - rows (Number): The number of rows to move by * - chars (Number): The number of characters to move by * @@ -9553,23 +9726,23 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToPosition(position) - * - position (Object): The position to move to - * + * Selection.moveCursorToPosition(position) + * - position (Object): The position to move to + * * Moves the selection to the position indicated by its `row` and `column`. - **/ + **/ this.moveCursorToPosition = function(position) { this.moveCursorTo(position.row, position.column); }; /** - * Selection.moveCursorTo(row, column, keepDesiredColumn) - * - row (Number): The row to move to - * - column (Number): The column to move to + * Selection.moveCursorTo(row, column, keepDesiredColumn) + * - row (Number): The row to move to + * - column (Number): The column to move to * - keepDesiredColumn (Boolean): [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} * * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} - **/ + **/ this.moveCursorTo = function(row, column, keepDesiredColumn) { // Ensure the row/column is not inside of a fold. var fold = this.session.getFoldAt(row, column, 1); @@ -9587,13 +9760,13 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToScreen(row, column, keepDesiredColumn) + * Selection.moveCursorToScreen(row, column, keepDesiredColumn) * - row (Number): The row to move to * - column (Number): The column to move to * - keepDesiredColumn (Boolean): {:preventUpdateBool} * * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} - **/ + **/ this.moveCursorToScreen = function(row, column, keepDesiredColumn) { var pos = this.session.screenToDocumentPosition(row, column); this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); @@ -10835,7 +11008,8 @@ var Behaviour = function() { }).call(Behaviour.prototype); exports.Behaviour = Behaviour; -});define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { +}); +define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { "use strict"; /* @@ -10941,7 +11115,8 @@ function addUnicodePackage (pack) { exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -11021,11 +11196,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -11033,21 +11208,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -11074,10 +11249,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -11137,82 +11312,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -11223,14 +11397,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -11255,10 +11429,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -11266,7 +11440,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -11286,16 +11460,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -11319,7 +11493,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -11330,7 +11504,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -11356,14 +11530,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -11397,7 +11571,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -11427,15 +11601,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -11451,12 +11625,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -11475,9 +11649,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -11485,7 +11659,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -11507,10 +11681,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -13002,7 +13176,9 @@ function FoldLine(foldData, folds) { && fold.start.column != column && fold.start.row != row) { - throw "Moving characters inside of a fold should never be reached"; + //throwing here breaks whole editor + //@todo properly handle this + window.console && window.console.log(row, column, fold); } else if (fold.start.row == row) { folds = this.folds; var i = folds.indexOf(fold); @@ -13096,7 +13272,8 @@ function FoldLine(foldData, folds) { }).call(FoldLine.prototype); exports.FoldLine = FoldLine; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -13211,7 +13388,8 @@ var Fold = exports.Fold = function(range, placeholder) { }).call(Fold.prototype); -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -14031,7 +14209,7 @@ var CommandManager = function(platform, commands) { this.addCommands(commands); this.setDefaultHandler("exec", function(e) { - e.command.exec(e.editor, e.args || {}); + return e.command.exec(e.editor, e.args || {}); }); }; @@ -14051,8 +14229,18 @@ oop.inherits(CommandManager, HashHandler); if (editor && editor.$readOnly && !command.readOnly) return false; - this._emit("exec", {editor: editor, command: command, args: args}); - return true; + try { + var retvalue = this._emit("exec", { + editor: editor, + command: command, + args: args + }); + } catch (e) { + window.console && window.console.log(e); + return true; + } + + return retvalue === false ? false : true; }; this.toggleRecording = function() { @@ -14194,6 +14382,18 @@ function HashHandler(config, platform) { } }; + this.bindKey = function(key, command) { + if(!key) + return; + + var ckb = this.commmandKeyBinding; + key.split("|").forEach(function(keyPart) { + var binding = this.parseKeys(keyPart, command); + var hashId = binding.hashId; + (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; + }, this); + }; + this.addCommands = function(commands) { commands && Object.keys(commands).forEach(function(name) { var command = commands[name]; @@ -14216,18 +14416,6 @@ function HashHandler(config, platform) { }, this); }; - this.bindKey = function(key, command) { - if(!key) - return; - - var ckb = this.commmandKeyBinding; - key.split("|").forEach(function(keyPart) { - var binding = parseKeys(keyPart, command); - var hashId = binding.hashId; - (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; - }); - }; - this.bindKeys = function(keyList) { Object.keys(keyList).forEach(function(key) { this.bindKey(key, keyList[key]); @@ -14243,10 +14431,10 @@ function HashHandler(config, platform) { this.bindKey(key, command); }; - function parseKeys(keys, val, ret) { + this.parseKeys = function(keys, val) { var key; var hashId = 0; - var parts = splitSafe(keys.toLowerCase()); + var parts = keys.toLowerCase().trim().split(/\s*\-\s*/); for (var i = 0, l = parts.length; i < l; i++) { if (keyUtil.KEY_MODS[parts[i]]) @@ -14259,17 +14447,12 @@ function HashHandler(config, platform) { key: key, hashId: hashId }; - } - - function splitSafe(s) { - return (s.trim() - .split(new RegExp("[\\s ]*\\-[\\s ]*", "g"), 999)); - } + }; this.findKeyCommand = function findKeyCommand(hashId, keyString) { var ckbr = this.commmandKeyBinding; return ckbr[hashId] && ckbr[hashId][keyString.toLowerCase()]; - } + }; this.handleKeyboard = function(data, hashId, keyString, keyCode) { return { @@ -14280,7 +14463,8 @@ function HashHandler(config, platform) { }).call(HashHandler.prototype) exports.HashHandler = HashHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -14525,6 +14709,7 @@ var VirtualRenderer = function(container, theme) { this.$gutterLayer = new GutterLayer(this.$gutter); this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true)); + this.setFadeFoldWidgets(true); this.$markerBack = new MarkerLayer(this.content); @@ -14540,14 +14725,15 @@ var VirtualRenderer = function(container, theme) { this.$cursorPadding = 8; // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = true; - this.$horizScrollAlwaysVisible = true; + this.$horizScroll = false; + this.$horizScrollAlwaysVisible = false; this.$animatedScroll = false; this.scrollBar = new ScrollBar(container); this.scrollBar.addEventListener("scroll", function(e) { - _self.session.setScrollTop(e.data); + if (!_self.$inScrollAnimation) + _self.session.setScrollTop(e.data); }); this.scrollTop = 0; @@ -14558,12 +14744,9 @@ var VirtualRenderer = function(container, theme) { _self.scrollLeft = scrollLeft; _self.session.setScrollLeft(scrollLeft); - if (scrollLeft == 0) { - _self.$gutter.className = "ace_gutter"; - } - else { - _self.$gutter.className = "ace_gutter horscroll"; - } + _self.scroller.className = scrollLeft == 0 + ? "ace_scroller" + : "ace_scroller horscroll"; }); this.cursorPos = { @@ -14635,12 +14818,16 @@ var VirtualRenderer = function(container, theme) { **/ this.setSession = function(session) { this.session = session; + + this.scroller.className = "ace_scroller"; + this.$cursorLayer.setSession(session); this.$markerBack.setSession(session); this.$markerFront.setSession(session); this.$gutterLayer.setSession(session); this.$textLayer.setSession(session); this.$loop.schedule(this.CHANGE_FULL); + }; /** @@ -14859,6 +15046,17 @@ var VirtualRenderer = function(container, theme) { this.onResize(true); }; + this.getFadeFoldWidgets = function(){ + return dom.hasCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + + this.setFadeFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.$gutter, "ace_fade-fold-widgets"); + else + dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + this.$updatePrintMargin = function() { var containerEl; @@ -15302,18 +15500,18 @@ var VirtualRenderer = function(container, theme) { this.$cursorLayer.showCursor(); }; - this.scrollSelectionIntoView = function(anchor, lead) { + this.scrollSelectionIntoView = function(anchor, lead, offset) { // first scroll anchor into view then scroll lead into view - this.scrollCursorIntoView(anchor); - this.scrollCursorIntoView(lead); + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); }; /** - * VirtualRenderer.scrollCursorIntoView() -> Void + * VirtualRenderer.scrollCursorIntoView(cursor, offset) -> Void * * Scrolls the cursor into the first visibile area of the editor **/ - this.scrollCursorIntoView = function(cursor) { + this.scrollCursorIntoView = function(cursor, offset) { // the editor is not visible if (this.$size.scrollerHeight === 0) return; @@ -15324,10 +15522,12 @@ var VirtualRenderer = function(container, theme) { var top = pos.top; if (this.scrollTop > top) { + if (offset) + top -= offset * this.$size.scrollerHeight; this.session.setScrollTop(top); - } - - if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + } else if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + if (offset) + top += offset * this.$size.scrollerHeight; this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); } @@ -15337,9 +15537,7 @@ var VirtualRenderer = function(container, theme) { if (left < this.$padding + 2 * this.layerConfig.characterWidth) left = 0; this.session.setScrollLeft(left); - } - - if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); } }; @@ -15390,36 +15588,70 @@ var VirtualRenderer = function(container, theme) { this.session.setScrollTop(row * this.lineHeight); }; + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + /** - * VirtualRenderer.scrollToLine(line, center) -> Void + * VirtualRenderer.scrollToLine(line, center, animate, callback) -> Void * - line (Number): A line number * - center (Boolean): If `true`, centers the editor the to indicated line - * + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called after the animation has finished + * * Gracefully scrolls the editor to the row indicated. **/ - this.scrollToLine = function(line, center) { + this.scrollToLine = function(line, center, animate, callback) { var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); var offset = pos.top; if (center) offset -= this.$size.scrollerHeight / 2; - if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) { - var _self = this; - var steps = _self.$calcSteps(this.scrollTop, offset); - - clearInterval(this.$timer); - this.$timer = setInterval(function() { - _self.session.setScrollTop(steps.shift()); - - if (!steps.length) - clearInterval(_self.$timer); - }, 10); - } - else { + var initialScroll = this.scrollTop; this.session.setScrollTop(offset); - } + if (animate !== false) + this.animateScrolling(initialScroll, callback); }; + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) { + var _self = this; + var steps = _self.$calcSteps(fromValue, toValue); + this.$inScrollAnimation = true; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + // trick session to think it's already scrolled to not loose toValue + _self.session.$scrollTop = toValue; + } else { + this.$inScrollAnimation = false; + clearInterval(_self.$timer); + + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + callback && callback(); + } + }, 10); + } + }; + /** * VirtualRenderer.scrollToY(scrollTop) -> Number * - scrollTop (Number): The position to scroll to @@ -16096,7 +16328,8 @@ var Marker = function(parentEl) { exports.Marker = Marker; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -16488,21 +16721,18 @@ var Text = function(parentEl) { this.$renderToken = function(stringBuilder, screenColumn, token, value) { var self = this; - var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g; + var replaceReg = /\t|&|<|( +)|([\u0000-\u0019\u00a0\u2000-\u200b\u2028\u2029\u3000])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (c.charCodeAt(0) == 32) { + if (a) { return new Array(c.length+1).join(" "); + } else if (c == "&") { + return useragent.isOldGecko ? "&" : "&"; + } else if (c == "<") { + return "<"; } else if (c == "\t") { var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); screenColumn += tabSize - 1; return self.$tabStrings[tabSize]; - } else if (c == "&") { - if (useragent.isOldGecko) - return "&"; - else - return "&"; - } else if (c == "<") { - return "<"; } else if (c == "\u3000") { // U+3000 is both invisible AND full-width, so must be handled uniquely var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; @@ -16511,13 +16741,11 @@ var Text = function(parentEl) { return "" + space + ""; - } else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) { - if (self.showInvisibles) { - var space = new Array(c.length+1).join(self.SPACE_CHAR); - return "" + space + ""; - } else { + } else if (b) { + if (self.showInvisibles) + return "" + self.SPACE_CHAR + ""; + else return " "; - } } else { screenColumn += 1; return " 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) + return; + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + + this.toggleBlockSelection = function () { if (this.rangeCount > 1) { var ranges = this.rangeList.ranges; var lastRange = ranges[ranges.length - 1]; @@ -17725,7 +18003,7 @@ var EditSession = require("./edit_session").EditSession; // extend Editor var Editor = require("./editor").Editor; (function() { - + /** extension * Editor.updateSelectionMarkers() * @@ -17789,13 +18067,13 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onRemoveRange = function(e) { this.removeSelectionMarkers(e.ranges); this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onMultiSelect = function(e) { if (this.inMultiSelectMode) return; @@ -17808,7 +18086,7 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onSingleSelect = function(e) { if (this.session.multiSelect.inVirtualMode) return; @@ -17876,9 +18154,9 @@ var Editor = require("./editor").Editor; this.onCursorChange(); this.onSelectionChange(); }; - + /** extension - * Editor.exitMultiSelectMode() + * Editor.exitMultiSelectMode() -> Void * * Removes all the selections except the last added one. **/ @@ -17904,15 +18182,35 @@ var Editor = require("./editor").Editor; return text; }; + this.onPaste = function(text) { + this._emit("paste", text); + if (!this.inMultiSelectMode) + return this.insert(text); + + var lines = text.split(this.session.getDocument().getNewLineCharacter()); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length) { + this.commands.exec("insertstring", this, text); + return; + } + + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + }; + /** extension - * Editor.findAll(needle, dir, additive) -> Number - * - needle (String): The text to find - * - options (Object): Any of the additional [[Search search options]] - * - additive (Boolean): TODO - * + (Number): The number of found ranges. + * Editor.findAll(dir, options) -> Number + * - needle: text to find + * - options: search options + * - additive: keeps * * Finds and selects all the occurences of `needle`. - * **/ this.findAll = function(needle, options, additive) { options = options || {}; @@ -17925,10 +18223,10 @@ var Editor = require("./editor").Editor; this.$blockScrolling += 1; var selection = this.multiSelect; - + if (!additive) selection.toSingleRange(ranges[0]); - + for (var i = ranges.length; i--; ) selection.addRange(ranges[i], true); @@ -17988,7 +18286,6 @@ var Editor = require("./editor").Editor; * - dir (Number): The direction to rotate selections * * Transposes the selected ranges. - * **/ this.transposeSelections = function(dir) { var session = this.session; @@ -18006,7 +18303,7 @@ var Editor = require("./editor").Editor; } } sel.mergeOverlappingRanges(); - + var words = []; for (var i = all.length; i--; ) { var range = all[i]; @@ -18113,7 +18410,7 @@ function MultiSelect(editor) { editor.on("mousedown", onMouseDown); editor.commands.addCommands(exports.commands.defaultCommands); - + addAltCursorListeners(editor); } @@ -18121,7 +18418,7 @@ function addAltCursorListeners(editor){ var el = editor.textInput.getElement(); var altCursor = false; var contentEl = editor.renderer.content; - el.addEventListener("keydown", function(e) { + event.addListener(el, "keydown", function(e) { if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { if (!altCursor) { contentEl.style.cursor = "crosshair"; @@ -18131,9 +18428,9 @@ function addAltCursorListeners(editor){ contentEl.style.cursor = ""; } }); - - el.addEventListener("keyup", reset); - el.addEventListener("blur", reset); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); function reset() { if (altCursor) { contentEl.style.cursor = ""; @@ -18144,7 +18441,8 @@ function addAltCursorListeners(editor){ exports.MultiSelect = MultiSelect; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -18541,7 +18839,8 @@ function onMouseDown(e) { exports.onMouseDown = onMouseDown; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -18627,20 +18926,22 @@ exports.defaultCommands = [{ exec: function(editor) { editor.multiSelect.splitIntoLines(); }, bindKey: {win: "Ctrl-Shift-L", mac: "Ctrl-Shift-L"}, readonly: true -}]; - -// commands active in multiselect mode -exports.multiEditCommands = [{ +}, { name: "singleSelection", bindKey: "esc", exec: function(editor) { editor.exitMultiSelectMode(); }, - readonly: true + readonly: true, + isAvailable: function(editor) {return editor.inMultiSelectMode} }]; +// commands active in multiselect mode +exports.multiEditCommands = {"singleSelection": "esc"}; + var HashHandler = require("../keyboard/hash_handler").HashHandler; exports.keyboardHandler = new HashHandler(exports.multiEditCommands); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -19442,8 +19743,8 @@ exports.cssText = ".ace-tm .ace_editor {\ }\ \ .ace-tm .ace_line .ace_invalid {\ - background-color: rgb(153, 0, 0);\ - color: white;\ + background-color: rgba(255, 0, 0, 0.1);\ + color: red;\ }\ \ .ace-tm .ace_line .ace_support.ace_function {\ @@ -19530,6 +19831,9 @@ exports.cssText = ".ace-tm .ace_editor {\ .ace-tm .ace_marker-layer .ace_active_line {\ background: rgba(0, 0, 0, 0.07);\ }\ +.ace-tm .ace_gutter_active_line{\ + background-color : #dcdcdc;\ +}\ \ .ace-tm .ace_marker-layer .ace_selected_word {\ background: rgb(250, 250, 255);\ diff --git a/build/src/ace.js b/build/src/ace.js index b3d60347..6014b884 100644 --- a/build/src/ace.js +++ b/build/src/ace.js @@ -1,4 +1,4 @@ -(function(){function g(a){if(typeof requirejs!="undefined"){var e=b.define;b.define=function(a,b,c){return typeof c!="function"?e.apply(this,arguments):e(a,b,function(a,d,e){return b[2]=="module"&&(e.packaged=!0),c.apply(this,arguments)})},b.define.packaged=!0;return}var f=function(a,b){return d("",a,b)};f.packaged=!0;var g=b;a&&(b[a]||(b[a]={}),g=b[a]),g.define&&(c.original=g.define),g.define=c,g.require&&(d.original=g.require),g.require=f}var a="",b=function(){return this}(),c=function(a,b,d){if(typeof a!="string"){c.original?c.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(d=b),c.modules||(c.modules={}),c.modules[a]=d},d=function(a,b,c){if(Object.prototype.toString.call(b)==="[object Array]"){var e=[];for(var g=0,h=b.length;g1&&h(b,"")>-1&&(i=RegExp(this.source,d.replace.call(g(this),"g","")),d.replace.call(a.slice(b.index),i,function(){for(var a=1;ab.index&&this.lastIndex--}return b},f||(RegExp.prototype.test=function(a){var b=d.exec.call(this,a);return b&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--,!!b})}),define("ace/lib/es5-shim",["require","exports","module"],function(a,b,c){function p(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=g.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,h=c.apply(f,d.concat(g.call(arguments)));return h!==null&&Object(h)===h?h:f}return c.apply(b,d.concat(g.call(arguments)))};return e});var d=Function.prototype.call,e=Array.prototype,f=Object.prototype,g=e.slice,h=d.bind(f.toString),i=d.bind(f.hasOwnProperty),j,k,l,m,n;if(n=i(f,"__defineGetter__"))j=d.bind(f.__defineGetter__),k=d.bind(f.__defineSetter__),l=d.bind(f.__lookupGetter__),m=d.bind(f.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return h(b)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b){var c=G(this),d=arguments[1],e=0,f=c.length>>>0;if(h(b)!="[object Function]")throw new TypeError;while(e>>0,e=Array(d),f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=[],f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e=0,f;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);for(;e>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e,f=d-1;if(arguments.length>=2)e=arguments[1];else do{if(f in c){e=c[f--];break}if(--f<0)throw new TypeError}while(!0);do f in this&&(e=b.call(void 0,e,c[f],f,c));while(f--);return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=G(this),d=c.length>>>0;if(!d)return-1;var e=0;arguments.length>1&&(e=E(arguments[1])),e=e>=0?e:Math.max(0,d+e);for(;e>>0;if(!d)return-1;var e=d-1;arguments.length>1&&(e=Math.min(e,E(arguments[1]))),e=e>=0?e:d-Math.abs(e);for(;e>=0;e--)if(e in c&&b===c[e])return e;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||(b.constructor?b.constructor.prototype:f)});if(!Object.getOwnPropertyDescriptor){var o="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(o+b);if(!i(b,c))return;var d,e,g;d={enumerable:!0,configurable:!0};if(n){var h=b.__proto__;b.__proto__=f;var e=l(b,c),g=m(b,c);b.__proto__=h;if(e||g)return e&&(d.get=e),g&&(d.set=g),d}return d.value=b[c],d}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={__proto__:null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}return c!==void 0&&Object.defineProperties(d,c),d});if(Object.defineProperty){var q=p({}),r=typeof document=="undefined"||p(document.createElement("div"));if(!q||!r)var s=Object.defineProperty}if(!Object.defineProperty||s){var t="Property description must be an object: ",u="Object.defineProperty called on non-object: ",v="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(u+b);if(typeof d!="object"&&typeof d!="function"||d===null)throw new TypeError(t+d);if(s)try{return s.call(Object,b,c,d)}catch(e){}if(i(d,"value"))if(n&&(l(b,c)||m(b,c))){var g=b.__proto__;b.__proto__=f,delete b[c],b[c]=d.value,b.__proto__=g}else b[c]=d.value;else{if(!n)throw new TypeError(v);i(d,"get")&&j(b,c,d.get),i(d,"set")&&k(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)i(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(w){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){if(Object(b)===b)throw new TypeError;var c="";while(i(b,c))c+="?";b[c]=!0;var d=i(b,c);return delete b[c],d});if(!Object.keys){var x=!0,y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],z=y.length;for(var A in{toString:null})x=!1;Object.keys=function H(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)i(a,b)&&H.push(b);if(x)for(var c=0,d=z;c9999?"+":"")+("00000"+Math.abs(e)).slice(0<=e&&e<=9999?-4:-6),c=b.length;while(c--)d=b[c],d<10&&(b[c]="0"+d);return e+"-"+b.slice(0,2).join("-")+"T"+b.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(b){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(a){var b=function e(b,c,d,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=j==1&&String(b)===b?new a(e.parse(b)):j>=7?new a(b,c,d,f,g,h,i):j>=6?new a(b,c,d,f,g,h):j>=5?new a(b,c,d,f,g):j>=4?new a(b,c,d,f):j>=3?new a(b,c,d):j>=2?new a(b,c):j>=1?new a(b):new a;return k.constructor=e,k}return a.apply(this,arguments)},c=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var d in a)b[d]=a[d];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;var g=+e.pop(),h=+e.pop(),i=e.pop(),j=0;if(i){if(h>23||g>59)return NaN;j=(h*60+g)*6e4*(i=="+"?-1:1)}var k=+e[0];return 0<=k&&k<=99?(e[0]=k+400,a.UTC.apply(this,e)+j-126227808e5):a.UTC.apply(this,e)+j}return a.parse.apply(this,arguments)},b}(Date));var B=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||B.trim()){B="["+B+"]";var C=new RegExp("^"+B+B+"*"),D=new RegExp(B+B+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(D,"")}}var E=function(a){return a=+a,a!==a?a=0:a!==0&&a!==1/0&&a!==-Infinity&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a},F="a"[0]!="a",G=function(a){if(a==null)throw new TypeError;return F&&typeof a=="string"&&a?a.split(""):Object(a)}}),define("ace/lib/dom",["require","exports","module"],function(a,b,c){"use strict";var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}return d&&c.push(b),a.className=c.join(" "),d},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.hasCssString=function(a,b){var c=0,d;b=b||document;if(b.createStyleSheet&&(d=b.styleSheets)){while(c5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isOldIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko||e.isOpera){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){return h=a.keyIdentifier||a.keyCode,g(c,a,a.keyCode)})}};if(window.postMessage){var h=1;b.nextTick=function(a,c){c=c||window;var d="zero-timeout-message-"+h;b.addListener(c,"message",function e(f){f.data==d&&(b.stopPropagation(f),b.removeListener(c,"message",e),a())}),c.postMessage(d,"*")}}else b.nextTick=function(a,b){b=b||window,window.setTimeout(a,0)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(a,b,c){"use strict";var d=a("./oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(var b in a.FUNCTION_KEYS){var c=a.FUNCTION_KEYS[b].toUpperCase();a[c]=parseInt(b,10)}return d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS),a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),define("ace/lib/oop",["require","exports","module"],function(a,b,c){"use strict",b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),define("ace/lib/useragent",["require","exports","module"],function(a,b,c){"use strict";var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),b.isOldIE=b.isIE&&b.isIE<9,b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOldGecko=b.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isChrome=parseFloat(e.split(" Chrome/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.isIPad=e.indexOf("iPad")>=0,b.isTouchPad=e.indexOf("TouchPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands"],function(a,b,c){"use strict",a("./lib/fixoldbrowsers");var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/useragent"),g=a("./keyboard/textinput").TextInput,h=a("./mouse/mouse_handler").MouseHandler,i=a("./mouse/fold_handler").FoldHandler,j=a("./keyboard/keybinding").KeyBinding,k=a("./edit_session").EditSession,l=a("./search").Search,m=a("./range").Range,n=a("./lib/event_emitter").EventEmitter,o=a("./commands/command_manager").CommandManager,p=a("./commands/default_commands").commands,q=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(a.getTextAreaContainer(),this),this.keyBinding=new j(this),f.isIPad||(this.$mouseHandler=new h(this),new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.commands=new o(f.isMac?"mac":"win",p),this.setSession(b||new k(""))};(function(){d.implement(this,n),this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session==a)return;if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:a,oldSession:b})},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.setFontSize=function(a){this.container.style.fontSize=a,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket","text")}},10)},this.focus=function(){var a=this;setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.$cursorChange=function(){this.renderer.updateCursor(),this.renderer.moveTextAreaToCursor(this.textInput.getElement())},this.onDocumentChange=function(a){var b=a.data,c=b.range,d;c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines"?d=c.end.row:d=Infinity,this.renderer.updateLines(c.start.row,d),this._emit("change",a),this.$cursorChange()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),typeof this.$lastrow=="number"&&this.renderer.removeGutterDecoration(this.$lastrow,"ace_gutter_active_line"),a.$highlightLineMarker=null,this.$lastrow=null;if(this.getHighlightActiveLine()){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row);if(this.getSelectionStyle()!="line"||!this.selection.isMultiLine()){var d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","background")}this.renderer.addGutterDecoration(this.$lastrow=b.row,"ace_gutter_active_line")}},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getCopyText=function(){var a="";return this.selection.isEmpty()||(a=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",a),a},this.onCut=function(){this.commands.exec("cut",this)},this.insert=function(a){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace(" ",this.session.getTabString());if(!this.selection.isEmpty())d=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)==" "?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}i&&c.autoOutdent(h,b,d.row)},this.onTextInput=function(a,b){b&&this._emit("paste",a),this.keyBinding.onTextInput(a,b)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(a){this.$mouseHandler.setDragDelay(a)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(a){if(this.$selectionStyle==a)return;this.$selectionStyle=a,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:a})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){if(this.$highlightActiveLine==a)return;this.$highlightActiveLine=a,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){if(this.$highlightSelectedWord==a)return;this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setShowInvisibles=function(a){if(this.getShowInvisibles()==a)return;this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.setShowFoldWidgets=function(a){var b=this.renderer.$gutterLayer;if(b.getShowFoldWidgets()==a)return;this.renderer.$gutterLayer.setShowFoldWidgets(a),this.$showFoldWidgets=a,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.remove=function(a){this.selection.isEmpty()&&(a=="left"?this.selection.selectLeft():this.selection.selectRight());var b=this.getSelectionRange();if(this.getBehavioursEnabled()){var c=this.session,d=c.getState(b.start.row),e=c.getMode().transformAction(d,"deletion",this,c,b);e&&(b=e)}this.session.remove(b),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b===0)return;var c=this.session.getLine(a.row),d,e;b=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.isRowFullyVisible=function(a){return a>=this.renderer.getFirstFullyVisibleRow()&&a<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$getPageDownRow=function(){return this.renderer.getScrollBottomRow()},this.$getPageUpRow=function(){var a=this.renderer.getScrollTopRow(),b=this.renderer.getScrollBottomRow();return a-(b-a)},this.selectPageDown=function(){var a=this.$getPageDownRow()+Math.floor(this.$getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection(),c=this.session.documentToScreenPosition(b.getSelectionLead()),d=this.session.screenToDocumentPosition(a,c.column);b.selectTo(d.row,d.column)},this.selectPageUp=function(){var a=this.renderer.getScrollTopRow()-this.renderer.getScrollBottomRow(),b=this.$getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection(),d=this.session.documentToScreenPosition(c.getSelectionLead()),e=this.session.screenToDocumentPosition(b,d.column);c.selectTo(e.row,e.column)},this.gotoPageDown=function(){var a=this.$getPageDownRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.gotoPageUp=function(){var a=this.$getPageUpRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.$getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.$getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.scrollToLine=function(a,b){this.renderer.scrollToLine(a,b)},this.centerSelection=function(){var a=this.getSelectionRange(),b=Math.floor(a.start.row+(a.end.row-a.start.row)/2);this.renderer.scrollToLine(b,!0)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b)},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a)},this.jumpToMatching=function(){var a=this.getCursorPosition(),b=this.session.findMatchingBracket(a);b||(a.column+=1,b=this.session.findMatchingBracket(a)),b||(a.column-=2,b=this.session.findMatchingBracket(a)),b&&(this.clearSelection(),this.moveCursorTo(b.row,b.column))},this.gotoLine=function(a,b){this.selection.clearSelection(),this.session.unfold({row:a-1,column:b||0}),this.$blockScrolling+=1,this.moveCursorTo(a-1,b||0),this.$blockScrolling-=1,this.isRowFullyVisible(this.getCursorPosition().row)||this.scrollToLine(a,!0)},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b)},this.navigateUp=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(-a,0)},this.navigateDown=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(a,0)},this.navigateLeft=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().start;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().end;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.session),d=0;return c?(this.$tryReplace(c,a)&&(d=1),c!==null&&(this.selection.setSelectionRange(c),this.renderer.scrollSelectionIntoView(c.start,c.end)),d):d},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.session),d=0;if(!c.length)return d;this.$blockScrolling+=1;var e=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var f=c.length-1;f>=0;--f)this.$tryReplace(c[f],a)&&d++;return this.selection.setSelectionRange(e),this.$blockScrolling-=1,d},this.$tryReplace=function(a,b){var c=this.session.getTextRange(a);return b=this.$search.replace(c,b),b!==null?(a.end=this.session.replace(a,b),a):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.session.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.session);if(b){this.session.unfold(b),this.$blockScrolling+=1,this.selection.setSelectionRange(b),this.$blockScrolling-=1;if(this.getAnimatedScroll()){var c=this.getCursorPosition();this.isRowFullyVisible(c.row)||this.scrollToLine(c.row,!0)}else this.renderer.scrollSelectionIntoView(b.start,b.end)}},this.undo=function(){this.session.getUndoManager().undo()},this.redo=function(){this.session.getUndoManager().redo()},this.destroy=function(){this.renderer.destroy()}}).call(q.prototype),b.Editor=q}),define("ace/lib/lang",["require","exports","module"],function(a,b,c){"use strict",b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(var c=0,d=a.length;c128)return;setTimeout(function(){h||m()},0)},p=function(a){h=!0,b.onCompositionStart(),e.isGecko||setTimeout(q,0)},q=function(){if(!h)return;b.onCompositionUpdate(c.value)},r=function(a){h=!1,b.onCompositionEnd()},s=function(a){i=!0;var d=b.getCopyText();d?c.value=d:a.preventDefault(),l(),setTimeout(function(){m()},0)},t=function(a){i=!0;var d=b.getCopyText();d?(c.value=d,b.onCut()):a.preventDefault(),l(),setTimeout(function(){m()},0)};d.addCommandKeyListener(c,b.onCommandKey.bind(b));if(e.isOldIE){var u={13:1,27:1};d.addListener(c,"keyup",function(a){h&&(!c.value||u[a.keyCode])&&setTimeout(r,0);if((c.value.charCodeAt(0)|0)<129)return;h?q():p()})}"onpropertychange"in c&&!("oninput"in c)?d.addListener(c,"propertychange",o):d.addListener(c,"input",n),d.addListener(c,"paste",function(a){j=!0,a.clipboardData&&a.clipboardData.getData?(m(a.clipboardData.getData("text/plain")),a.preventDefault()):o()}),"onbeforecopy"in c&&typeof clipboardData!="undefined"?(d.addListener(c,"beforecopy",function(a){var c=b.getCopyText();c?clipboardData.setData("Text",c):a.preventDefault()}),d.addListener(a,"keydown",function(a){if(a.ctrlKey&&a.keyCode==88){var c=b.getCopyText();c&&(clipboardData.setData("Text",c),b.onCut()),d.preventDefault(a)}})):(d.addListener(c,"copy",s),d.addListener(c,"cut",t)),d.addListener(c,"compositionstart",p),e.isGecko&&d.addListener(c,"text",q),e.isWebKit&&d.addListener(c,"keyup",q),d.addListener(c,"compositionend",r),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),l()}),this.focus=function(){b.onFocus(),l(),c.focus()},this.blur=function(){c.blur()},this.isFocused=v,this.getElement=function(){return c},this.onContextMenu=function(a,b){a&&(k||(k=c.style.cssText),c.style.cssText="position:fixed; z-index:1000;left:"+(a.x-2)+"px; top:"+(a.y-2)+"px;"),b&&(c.value="")},this.onContextMenuClose=function(){setTimeout(function(){k&&(c.style.cssText=k,k=""),m()},0)}};b.TextInput=g}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event"],function(a,b,c){"use strict";var d=a("../lib/event"),e=a("./default_handlers").DefaultHandlers,f=a("./default_gutter_handler").GutterHandler,g=a("./mouse_event").MouseEvent,h=function(a){this.editor=a,new e(a),new f(a),d.addListener(a.container,"mousedown",function(b){return a.focus(),d.preventDefault(b)}),d.addListener(a.container,"selectstart",function(a){return d.preventDefault(a)});var b=a.renderer.getMouseEventTarget();d.addListener(b,"mousedown",this.onMouseEvent.bind(this,"mousedown")),d.addListener(b,"click",this.onMouseEvent.bind(this,"click")),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove")),d.addMultiMouseDownListener(b,0,2,500,this.onMouseEvent.bind(this,"dblclick")),d.addMultiMouseDownListener(b,0,3,600,this.onMouseEvent.bind(this,"tripleclick")),d.addMultiMouseDownListener(b,0,4,600,this.onMouseEvent.bind(this,"quadclick")),d.addMouseWheelListener(a.container,this.onMouseWheel.bind(this,"mousewheel"));var c=a.renderer.$gutter;d.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),d.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),d.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),d.addListener(c,"mousemove",this.onMouseMove.bind(this,"gutter"))};(function(){this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(a,b){this.editor._emit(a,new g(b,this.editor))},this.$dragDelay=250,this.setDragDelay=function(a){this.$dragDelay=a},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(a,b){var c=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!c||!c.length)return;this.editor._emit(a,new g(b,this.editor))},this.onMouseWheel=function(a,b){var c=new g(b,this.editor);c.speed=this.$scrollSpeed*2,c.wheelX=b.wheelX,c.wheelY=b.wheelY,this.editor._emit(a,c)}}).call(h.prototype),b.MouseHandler=h}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/event","ace/lib/dom","ace/lib/browser_focus"],function(a,b,c){function k(a){this.editor=a,this.$clickSelection=null,this.browserFocus=new f,a.setDefaultHandler("mousedown",this.onMouseDown.bind(this)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(this)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(this)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(this)),a.setDefaultHandler("mousewheel",this.onScroll.bind(this))}function l(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))}"use strict";var d=a("../lib/event"),e=a("../lib/dom"),f=a("../lib/browser_focus").BrowserFocus,g=0,h=1,i=2,j=5;(function(){this.onMouseDown=function(a){function C(b){a.getShiftKey()?m.selection.selectToPosition(b):n.$clickSelection||(m.moveCursorToPosition(b),m.selection.clearSelection()),q=h}var b=a.inSelection(),c=a.pageX,f=a.pageY,k=a.getDocumentPosition(),m=this.editor,n=this,o=m.getSelectionRange(),p=o.isEmpty(),q=g;if(b&&(!this.browserFocus.isFocused()||(new Date).getTime()-this.browserFocus.lastFocus<20||!m.isFocused())){m.focus();return}var r=a.getButton();if(r!==0){p&&m.moveCursorToPosition(k),r==2&&(m.textInput.onContextMenu({x:a.clientX,y:a.clientY},p),d.capture(m.container,function(){},m.textInput.onContextMenuClose));return}b||C(k);var s=c,t=f,u=(new Date).getTime(),v,w,x,y=function(a){s=d.getDocumentX(a),t=d.getDocumentY(a)},z=function(a){clearInterval(F),q==g?C(k):q==i&&A(a),n.$clickSelection=null,q=g},A=function(a){e.removeCssClass(m.container,"ace_dragging"),m.session.removeMarker(x),m.$mouseHandler.$clickSelection||v||(m.moveCursorToPosition(k),m.selection.clearSelection());if(!v)return;if(w.contains(v.row,v.column)){v=null;return}m.clearSelection();if(a&&(a.ctrlKey||a.altKey))var b=m.session,c=b.insert(v,b.getTextRange(w));else var c=m.moveText(w,v);if(!c){v=null;return}m.selection.setSelectionRange(c)},B=function(){if(q==g){var a=l(c,f,s,t),b=(new Date).getTime();if(a>j){q=h;var d=m.renderer.screenToTextCoordinates(s,t);C(d)}else if(b-u>m.getDragDelay()){q=i,w=m.getSelectionRange();var k=m.getSelectionStyle();x=m.session.addMarker(w,"ace_selection",k),m.clearSelection(),e.addCssClass(m.container,"ace_dragging")}}q==i?E():q==h&&D()},D=function(){var a,b=m.renderer.screenToTextCoordinates(s,t);n.$clickSelection?n.$clickSelection.contains(b.row,b.column)?m.selection.setSelectionRange(n.$clickSelection):(n.$clickSelection.compare(b.row,b.column)==-1?a=n.$clickSelection.end:a=n.$clickSelection.start,m.selection.setSelectionAnchor(a.row,a.column),m.selection.selectToPosition(b)):m.selection.selectToPosition(b),m.renderer.scrollCursorIntoView()},E=function(){v=m.renderer.screenToTextCoordinates(s,t),m.moveCursorToPosition(v)};d.capture(m.container,y,z);var F=setInterval(B,20);return a.preventDefault()},this.onDoubleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectWord(),this.$clickSelection=c.getSelectionRange()},this.onTripleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectLine(),this.$clickSelection=c.getSelectionRange()},this.onQuadClick=function(a){var b=this.editor;b.selectAll(),this.$clickSelection=b.getSelectionRange()},this.onScroll=function(a){var b=this.editor;b.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed);if(b.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed))return a.preventDefault()}}).call(k.prototype),b.DefaultHandlers=k}),define("ace/lib/browser_focus",["require","exports","module","ace/lib/oop","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./oop"),e=a("./event"),f=a("./event_emitter").EventEmitter,g=function(a){a=a||window,this.lastFocus=(new Date).getTime(),this._isFocused=!0;var b=this;"onfocusin"in a.document?(e.addListener(a.document,"focusin",function(a){b._setFocused(!0)}),e.addListener(a.document,"focusout",function(a){b._setFocused(!!a.toElement)})):(e.addListener(a,"blur",function(a){b._setFocused(!1)}),e.addListener(a,"focus",function(a){b._setFocused(!0)}))};(function(){d.implement(this,f),this.isFocused=function(){return this._isFocused},this._setFocused=function(a){if(this._isFocused==a)return;a&&(this.lastFocus=(new Date).getTime()),this._isFocused=a,this._emit("changeFocus")}}).call(g.prototype),b.BrowserFocus=g}),define("ace/lib/event_emitter",["require","exports","module"],function(a,b,c){"use strict";var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var c=this._eventRegistry[a]||[],d=this._defaultHandlers[a];if(!c.length&&!d)return;b=b||{},b.type=a,b.stopPropagation||(b.stopPropagation=function(){this.propagationStopped=!0}),b.preventDefault||(b.preventDefault=function(){this.defaultPrevented=!0});for(var e=0;e=4352&&a<=4447||a>=4515&&a<=4519||a>=4602&&a<=4607||a>=9001&&a<=9002||a>=11904&&a<=11929||a>=11931&&a<=12019||a>=12032&&a<=12245||a>=12272&&a<=12283||a>=12288&&a<=12350||a>=12353&&a<=12438||a>=12441&&a<=12543||a>=12549&&a<=12589||a>=12593&&a<=12686||a>=12688&&a<=12730||a>=12736&&a<=12771||a>=12784&&a<=12830||a>=12832&&a<=12871||a>=12880&&a<=13054||a>=13056&&a<=19903||a>=19968&&a<=42124||a>=42128&&a<=42182||a>=43360&&a<=43388||a>=44032&&a<=55203||a>=55216&&a<=55238||a>=55243&&a<=55291||a>=63744&&a<=64255||a>=65040&&a<=65049||a>=65072&&a<=65106||a>=65108&&a<=65126||a>=65128&&a<=65131||a>=65281&&a<=65376||a>=65504&&a<=65510}e.implement(this,h),this.setDocument=function(a){if(this.doc)throw new Error("Document is already set");this.doc=a,a.on("change",this.onChange.bind(this)),this.on("changeFold",this.onChangeFold.bind(this)),this.bgTokenizer&&(this.bgTokenizer.setDocument(this.getDocument()),this.bgTokenizer.start(0))},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(a==0){this.$rowCache=[];return}var b=this.$rowCache;for(var c=0;c=a){b.splice(c,b.length);return}},this.onChangeFold=function(a){var b=a.data;this.$resetRowCache(b.start.row)},this.onChange=function(a){var b=a.data;this.$modified=!0,this.$resetRowCache(b.range.start.row);var c=this.$updateInternalDataOnChange(a);!this.$fromUndo&&this.$undoManager&&!b.ignore&&(this.$deltasDoc.push(b),c&&c.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:c}),this.$informUndoManager.schedule()),this.bgTokenizer.start(b.range.start.row),this._emit("change",a)},this.setValue=function(a){this.doc.setValue(a),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(a){return this.bgTokenizer.getState(a)},this.getTokens=function(a,b){return this.bgTokenizer.getTokens(a,b)},this.getTokenAt=function(a,b){var c=this.bgTokenizer.getTokens(a,a)[0].tokens,d,e=0;if(b==null)f=c.length-1,e=this.getLine(a).length;else for(var f=0;f=b)break}return d=c[f],d?(d.index=f,d.start=e-d.value.length,d):null},this.setUndoManager=function(a){this.$undoManager=a,this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.$deltasFold.length&&(b.$deltas.push({group:"fold",deltas:b.$deltasFold}),b.$deltasFold=[]),b.$deltasDoc.length&&(b.$deltas.push({group:"doc",deltas:b.$deltasDoc}),b.$deltasDoc=[]),b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]},this.$informUndoManager=f.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?f.stringRepeat(" ",this.getTabSize()):" "},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){if(this.$useSoftTabs===a)return;this.$useSoftTabs=a},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){if(isNaN(a)||this.$tabSize===a)return;this.$modified=!0,this.$tabSize=a,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(a){if(this.$overwrite==a)return;this.$overwrite=a,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=this.doc.getLength()-1)return 0;var c=this.doc.removeLines(a,b);return this.doc.insertLines(a+1,c),1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.doc.insertLines(a,c);var d=b-a+1;return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},this.$clipColumnToRow=function(a,b){return b<0?0:Math.min(this.doc.getLine(a).length,b)},this.$clipPositionToDocument=function(a,b){b=Math.max(0,b);if(a<0)a=0,b=0;else{var c=this.doc.getLength();a>=c?(a=c-1,b=this.doc.getLine(c-1).length):b=Math.min(this.doc.getLine(a).length,b)}return{row:a,column:b}},this.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var b=this.doc.getLength()-1;return a.end.row>b?(a.end.row=b,a.end.column=this.doc.getLine(b).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(a){if(a!=this.$useWrapMode){this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0);if(a){var b=this.getLength();this.$wrapData=[];for(var c=0;c0?(this.$wrapLimit=b,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(a){var b=this.$wrapLimitRange.min;b&&(a=Math.max(b,a));var c=this.$wrapLimitRange.max;return c&&(a=Math.min(c,a)),Math.max(1,a)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(a){var b=this.$useWrapMode,c,d=a.data.action,e=a.data.range.start.row,f=a.data.range.end.row,g=a.data.range.start,h=a.data.range.end,i=null;d.indexOf("Lines")!=-1?(d=="insertLines"?f=e+a.data.lines.length:f=e,c=a.data.lines?a.data.lines.length:f-e):c=f-e;if(c!=0)if(d.indexOf("remove")!=-1){b&&this.$wrapData.splice(e,c);var j=this.$foldData;i=this.getFoldsInRange(a.data.range),this.removeFolds(i);var k=this.getFoldLine(h.row),l=0;if(k){k.addRemoveChars(h.row,h.column,g.column-h.column),k.shiftRow(-c);var m=this.getFoldLine(e);m&&m!==k&&(m.merge(k),k=m),l=j.indexOf(k)+1}for(l;l=h.row&&k.shiftRow(-c)}f=e}else{var n;if(b){n=[e,0];for(var o=0;o=e&&k.shiftRow(c)}}else{c=Math.abs(a.data.range.start.column-a.data.range.end.column),d.indexOf("remove")!=-1&&(i=this.getFoldsInRange(a.data.range),this.removeFolds(i),c=-c);var k=this.getFoldLine(e);k&&k.addRemoveChars(e,g.column,c)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),b&&this.$updateWrapData(e,f),i},this.$updateWrapData=function(a,b){var c=this.doc.getAllLines(),d=this.getTabSize(),e=this.$wrapData,g=this.$wrapLimit,h,k,l=a;b=Math.min(b,c.length-1);while(l<=b){k=this.getFoldLine(l,k);if(!k)h=this.$getDisplayTokens(f.stringTrimRight(c[l])),e[l]=this.$computeWrapSplits(h,g,d),l++;else{h=[],k.walk(function(a,b,d,e){var f;if(a){f=this.$getDisplayTokens(a,h.length),f[0]=i;for(var g=1;g=n)h.pop();e[k.start.row]=this.$computeWrapSplits(h,g,d),l=k.end.row+1}}};var b=1,c=2,i=3,j=4,l=9,n=10,o=11,p=12;this.$computeWrapSplits=function(a,b){function g(b){var d=a.slice(e,b),g=d.length;d.join("").replace(/12/g,function(){g-=1}).replace(/2/g,function(){g-=1}),f+=g,c.push(f),e=b}if(a.length==0)return[];var c=[],d=a.length,e=0,f=0;while(d-e>b){var h=e+b;if(a[h]>=n){while(a[h]>=n)h++;g(h);continue}if(a[h]==i||a[h]==j){for(h;h!=e-1;h--)if(a[h]==i)break;if(h>e){g(h);continue}h=e+b;for(h;hk&&a[h]k&&a[h]==l)h--;if(h>k){g(++h);continue}h=e+b,g(h)}return c},this.$getDisplayTokens=function(a,d){var e=[],f;d=d||0;for(var g=0;g39&&h<48||h>57&&h<64?e.push(l):h>=4352&&q(h)?e.push(b,c):e.push(b)}return e},this.$getStringScreenWidth=function(a,b,c){if(b==0)return[0,0];b==null&&(b=c+a.length*Math.max(this.getTabSize(),2)),c=c||0;var d,e;for(e=0;e=4352&&q(d)?c+=2:c+=1;if(c>b)break}return[c,e]},this.getRowLength=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},this.getRowHeight=function(a,b){return this.getRowLength(b)*a.lineHeight},this.getScreenLastRowColumn=function(a){var b=this.screenToDocumentPosition(a,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},this.getDocumentLastRowColumn=function(a,b){var c=this.documentToScreenRow(a,b);return this.getScreenLastRowColumn(c)},this.getDocumentLastRowColumnPosition=function(a,b){var c=this.documentToScreenRow(a,b);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},this.getRowSplitData=function(a){return this.$useWrapMode?this.$wrapData[a]:undefined},this.getScreenTabSize=function(a){return this.$tabSize-a%this.$tabSize},this.screenToDocumentRow=function(a,b){return this.screenToDocumentPosition(a,b).row},this.screenToDocumentColumn=function(a,b){return this.screenToDocumentPosition(a,b).column},this.screenToDocumentPosition=function(a,b){if(a<0)return{row:0,column:0};var c,d=0,e=0,f,g=0,h=0,i=this.$rowCache;for(var j=0;j=a||d>=l)break;g+=h,d++,d>n&&(d=m.end.row+1,m=this.getNextFoldLine(d,m),n=m?m.start.row:Infinity),k&&i.push({docRow:d,screenRow:g})}if(m&&m.start.row<=d)c=this.getFoldDisplayLine(m),d=m.start.row;else{if(g+h<=a||d>l)return{row:l,column:this.getLine(l).length};c=this.getLine(d),m=null}if(this.$useWrapMode){var o=this.$wrapData[d];o&&(f=o[a-g],a>g&&o.length&&(e=o[a-g-1]||o[o.length-1],c=c.substring(e)))}return e+=this.$getStringScreenWidth(c,b)[1],this.$useWrapMode&&e>=f&&(e=f-1),m?m.idxToPosition(e):{row:d,column:e}},this.documentToScreenPosition=function(a,b){if(typeof b=="undefined")var c=this.$clipPositionToDocument(a.row,a.column);else c=this.$clipPositionToDocument(a,b);a=c.row,b=c.column;var d;if(this.$useWrapMode){d=this.$wrapData;if(a>d.length-1)return{row:this.getScreenLength(),column:d.length==0?0:d[d.length-1].length-1}}var e=0,f=null,g=null;g=this.getFoldAt(a,b,1),g&&(a=g.start.row,b=g.start.column);var h,i=0,j=this.$rowCache;for(var k=0;k=n){h=m.end.row+1;if(h>a)break;m=this.getNextFoldLine(h,m),n=m?m.start.row:Infinity}else h=i+1;e+=this.getRowLength(i),i=h,l&&j.push({docRow:i,screenRow:e})}var o="";m&&i>=n?(o=this.getFoldDisplayLine(m,a,b),f=m.start.row):(o=this.getLine(a).substring(0,b),f=a);if(this.$useWrapMode){var p=d[f],q=0;while(o.length>=p[q])e++,q++;o=o.substring(p[q-1]||0,o.length)}return{row:e,column:this.$getStringScreenWidth(o)[0]}},this.documentToScreenColumn=function(a,b){return this.documentToScreenPosition(a,b).column},this.documentToScreenRow=function(a,b){return this.documentToScreenPosition(a,b).row},this.getScreenLength=function(){var a=0,b=null;if(!this.$useWrapMode){a=this.getLength();var c=this.$foldData;for(var d=0;dg&&(f=b.end.row+1,b=this.$foldData[d++],g=b?b.start.row:Infinity)}return a}}).call(n.prototype),a("./edit_session/folding").Folding.call(n.prototype),a("./edit_session/bracket_match").BracketMatch.call(n.prototype),b.EditSession=n}),define("ace/config",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}"no use strict";var d=a("./lib/lang"),e=function(){return this}(),f={packaged:!1,workerPath:"",modePath:"",themePath:"",suffix:".js"};b.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);return f[a]},b.set=function(a,b){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);f[a]=b},b.all=function(){return d.copyObject(f)},b.init=function(){f.packaged=a.packaged||c.packaged||e.define&&define.packaged;if(!e.document)return"";var d={},h="",i,j=document.getElementsByTagName("script");for(var k=0;kb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor,b=this.selectionLead;return this.isEmpty()?g.fromPoints(b,b):this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.moveCursorTo(0,0)},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column)),this.$desiredColumn=null},this.$moveSelection=function(a){var b=this.selectionLead;this.$isEmpty&&this.setSelectionAnchor(b.row,b.column),a.call(this)},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.getCursor(),b=this.session.getWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectAWord=function(){var a=this.getCursor(),b=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectLine=function(){var a=this.selectionLead.row,b,c=this.session.getFoldLine(a);c?(a=c.start.row,b=c.end.row):b=a,this.setSelectionAnchor(a,0),this.$moveSelection(function(){this.moveCursorTo(b+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(b.start.row,b.start.column);else if(a.column==0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var c=this.session.getTabSize();this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(a.column-c,a.column).split(" ").length-1==c?this.moveCursorBy(0,-c):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(b.end.row,b.end.column);else if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=c.length){this.moveCursorTo(a,c.length),this.moveCursorRight(),a0&&this.moveCursorWordLeft();return}if(g=this.session.tokenRe.exec(f))b-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(a,b)},this.moveCursorBy=function(a,b){var c=this.session.documentToScreenPosition(this.selectionLead.row,this.selectionLead.column);b===0&&(this.$desiredColumn?c.column=this.$desiredColumn:this.$desiredColumn=c.column);var d=this.session.screenToDocumentPosition(c.row+a,c.column);this.moveCursorTo(d.row,d.column+b,b===0)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b,c){var d=this.session.getFoldAt(a,b,1);d&&(a=d.start.row,b=d.start.column),this.$keepDesiredColumnOnChange=!0,this.selectionLead.setPosition(a,b),this.$keepDesiredColumnOnChange=!1,c||(this.$desiredColumn=null)},this.moveCursorToScreen=function(a,b,c){var d=this.session.screenToDocumentPosition(a,b);this.moveCursorTo(d.row,d.column,c)},this.detach=function(){this.selectionLead.detach(),this.selectionAnchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(a){var b=this.getRange();return a?(a.start.column=b.start.column,a.start.row=b.start.row,a.end.column=b.end.column,a.end.row=b.end.row):a=b,a.cursor=this.isBackwards()?a.start:a.end,a.desiredColumn=this.$desiredColumn,a}}).call(h.prototype),b.Selection=h}),define("ace/range",["require","exports","module"],function(a,b,c){"use strict";var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.isEqual=function(a){return this.start.row==a.start.row&&this.end.row==a.end.row&&this.start.column==a.start.column&&this.end.column==a.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;return b=this.compare(c.row,c.column),b==1?(b=this.compare(d.row,d.column),b==1?2:b==0?1:0):b==-1?-2:(b=this.compare(d.row,d.column),b==-1?-1:b==1?42:0)},this.comparePoint=function(a){return this.compare(a.row,a.column)},this.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},this.intersects=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)||this.isStart(a,b)?!1:!0:!1},this.insideStart=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)?!1:!0:!1},this.insideEnd=function(a,b){return this.compare(a,b)==0?this.isStart(a,b)?!1:!0:!1},this.compare=function(a,b){return!this.isMultiLine()&&a===this.start.row?bthis.end.column?1:0:athis.end.row?1:this.start.row===a?b>=this.start.column?0:-1:this.end.row===a?b<=this.end.column?0:1:0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0&&/^[\w\d]/.test(h)||e<=g&&/[\w\d]$/.test(h))return;h=f.substring(c.start.column,c.end.column);if(!/^[\w\d]+$/.test(h))return;var i=a.getCursorPosition(),j={wrap:!0,wholeWord:!0,caseSensitive:!0,needle:h},k=a.$search.getOptions();a.$search.set(j);var l=a.$search.findAll(b);l.forEach(function(a){if(!a.contains(i.row,i.column)){var c=b.addMarker(a,"ace_selected_word","text");b.$selectionOccurrences.push(c)}}),a.$search.set(k)},this.clearSelectionHighlight=function(a){if(!a.session.$selectionOccurrences)return;a.session.$selectionOccurrences.forEach(function(b){a.session.removeMarker(b)}),a.session.$selectionOccurrences=[]},this.createModeDelegates=function(a){if(!this.$embeds)return;this.$modes={};for(var b=0;b1&&e[i].token.length!==j-1)throw new Error("Matching groups and length of the token array don't match in rule #"+i+" of state "+c);h[g]={rule:i,len:j},g+=j,f.push(k)}this.regExps[c]=new RegExp("(?:("+f.join(")|(")+")|(.))",b)}};(function(){this.getLineTokens=function(a,b){var c=b,d=this.rules[c],e=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;var g,h=[],i=0,j={type:null,value:""};while(g=f.exec(a)){var k="text",l=null,m=[g[0]];for(var n=0;n1&&(m=g.slice(n+2,n+1+e[n].len)),typeof l.token=="function"?k=l.token.apply(this,m):k=l.token,l.next&&(c=l.next,d=this.rules[c],e=this.matchMappings[c],i=f.lastIndex,f=this.regExps[c],f.lastIndex=i);break}if(m[0]){typeof k=="string"&&(m=[m.join("")],k=[k]);for(var n=0;n=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length),a},this.insert=function(a,b){if(!b||b.length===0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];return a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c);var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};return this._emit("change",{data:e}),d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};return this._emit("change",{data:d}),c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};return this._emit("change",{data:e}),d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);return a.start},this.removeInLine=function(a,b,c){if(b==c)return;var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};return this._emit("change",{data:i}),d.start},this.removeLines=function(a,b){var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};return this._emit("change",{data:e}),d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._emit("change",{data:g})},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=b.Anchor=function(a,b,c){this.document=a,typeof c=="undefined"?this.setPosition(b.row,b.column):this.setPosition(b,c),this.$onChange=this.onChange.bind(this),a.on("change",this.$onChange)};(function(){d.implement(this,e),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&c.start.row!=this.row)return;if(c.start.row>this.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0),c}}).call(f.prototype)}),define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(!c.running)return;var a=new Date,b=c.currentLine,d=c.doc,e=0,f=d.getLength();while(c.currentLine20){c.fireUpdateEvent(b,c.currentLine-1),c.running=setTimeout(c.$worker,20);return}}c.running=!1,c.fireUpdateEvent(b,f-1)}};(function(){d.implement(this,e),this.setTokenizer=function(a){this.tokenizer=a,this.lines=[],this.start(0)},this.setDocument=function(a){this.doc=a,this.lines=[],this.stop()},this.fireUpdateEvent=function(a,b){var c={first:a,last:b};this._emit("update",{data:c})},this.start=function(a){this.currentLine=Math.min(a||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(a,b){return this.$tokenizeRows(a,b)},this.getState=function(a){return this.$tokenizeRows(a,a)[0].state},this.$tokenizeRows=function(a,b){if(!this.doc||isNaN(a)||isNaN(b))return[{state:"start",tokens:[]}];var c=[],d="start",e=!1;a>0&&this.lines[a-1]?(d=this.lines[a-1].state,e=!0):a==0?(d="start",e=!0):this.lines.length>0&&(d=this.lines[this.lines.length-1].state);var f=this.doc.getLines(a,b);for(var g=a;g<=b;g++)if(!this.lines[g]){var h=this.tokenizer.getLineTokens(f[g-a]||"",d),d=h.state;c.push(h),e&&(this.lines[g]=h)}else{var h=this.lines[g];d=h.state,c.push(h)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(a,b,c){function h(){this.getFoldAt=function(a,b,c){var d=this.getFoldLine(a);if(!d)return null;var e=d.folds;for(var f=0;f=a)return e;if(e.end.row>a)return null}return null},this.getNextFoldLine=function(a,b){var c=this.$foldData,d=0;b&&(d=c.indexOf(b)),d==-1&&(d=0);for(d;d=a)return e}return null},this.getFoldedRowCount=function(a,b){var c=this.$foldData,d=b-a+1;for(var e=0;e=b){h=a?d-=b-h:d=0);break}g>=a&&(h>=a?d-=g-h:d-=g-a+1)}return d},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(a,b){return a.start.row-b.start.row}),a},this.addFold=function(a,b){var c=this.$foldData,d=!1,g;a instanceof f?g=a:g=new f(b,a),this.$clipRangeToDocument(g.range);var h=g.start.row,i=g.start.column,j=g.end.row,k=g.end.column;if(g.placeholder.length<2)throw"Placeholder has to be at least 2 characters";if(h==j&&k-i<2)throw"The range has to be at least 2 characters width";var l=this.getFoldAt(h,i,1),m=this.getFoldAt(j,k,-1);if(l&&m==l)return l.addSubFold(g);if(l&&!l.range.isStart(h,i)||m&&!m.range.isEnd(j,k))throw"A fold can't intersect already existing fold"+g.range+l.range;var n=this.getFoldsInRange(g.range);n.length>0&&(this.removeFolds(n),g.subFolds=n);for(var o=0;othis.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(a),this.folds.sort(function(a,b){return-a.range.compareEnd(b.start.row,b.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else{if(a.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column}a.foldLine=this},this.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},this.walk=function(a,b,c){var d=0,e=this.folds,f,g,h,i=!0;b==null&&(b=this.end.row,c=this.end.column);for(var j=0;j=this.$rowTokens.length){this.$row+=1;if(this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row,this.$row)[0].tokens,this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,b=this.$tokenIndex,c=a[b].start;if(c!==undefined)return c;c=0;while(b>0)b-=1,c+=a[b].value.length;return c}}).call(d.prototype),b.TokenIterator=d}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator"],function(a,b,c){function e(){this.findMatchingBracket=function(a){if(a.column==0)return null;var b=this.getLine(a.row).charAt(a.column-1);if(b=="")return null;var c=b.match(/([\(\[\{])|([\)\]\}])/);return c?c[1]?this.$findClosingBracket(c[1],a):this.$findOpeningBracket(c[2],a):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("rparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn()-2,j=g.value;for(;;){while(i>=0){var k=j.charAt(i);if(k==c){e-=1;if(e==0)return{row:f.getCurrentTokenRow(),column:i+f.getCurrentTokenColumn()}}else k==a&&(e+=1);i-=1}do g=f.stepBackward();while(g&&!h.test(g.type));if(g==null)break;j=g.value,i=j.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("lparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn();for(;;){var j=g.value,k=j.length;while(i=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function k(e){var f=a.getLine(e);return b&&e==c.end.row&&(f=f.substring(0,c.end.column)),j&&e==d.row&&(f=f.substring(0,d.column)),f}var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"start":"end"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap,j=!1;return{forEach:function(a){var b=d.row,c=k(b),g=d.column,l=!1;j=!1;while(!a(c,g,b)){if(l)return;b++,g=0;if(b>h){if(!i)return;b=e,g=f,j=!0}b==d.row&&(l=!0),c=k(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"end":"start"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1,n=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(j0},this.hasRedo=function(){return this.$redoStack.length>0}}).call(d.prototype),b.UndoManager=d}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/config","ace/lib/net","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter","text!ace/css/editor.css"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/useragent"),h=a("./config"),i=a("./lib/net"),j=a("./layer/gutter").Gutter,k=a("./layer/marker").Marker,l=a("./layer/text").Text,m=a("./layer/cursor").Cursor,n=a("./scrollbar").ScrollBar,o=a("./renderloop").RenderLoop,p=a("./lib/event_emitter").EventEmitter,q=a("text!./css/editor.css");e.importCssString(q,"ace_editor");var r=function(a,b){var c=this;this.container=a,e.addCssClass(a,"ace_editor"),this.setTheme(b),this.$gutter=e.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=e.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=e.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new j(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onResize.bind(this,!0)),this.$markerBack=new k(this.content);var d=this.$textLayer=new l(this.content);this.canvas=d.element,this.$markerFront=new k(this.content),this.characterWidth=d.getCharacterWidth(),this.lineHeight=d.getLineHeight(),this.$cursorLayer=new m(this.content),this.$cursorPadding=8,this.$horizScroll=!0,this.$horizScrollAlwaysVisible=!0,this.$animatedScroll=!1,this.scrollBar=new n(a),this.scrollBar.addEventListener("scroll",function(a){c.session.setScrollTop(a.data)}),this.scrollTop=0,this.scrollLeft=0,f.addListener(this.scroller,"scroll",function(){var a=c.scroller.scrollLeft;c.scrollLeft=a,c.session.setScrollLeft(a),a==0?c.$gutter.className="ace_gutter":c.$gutter.className="ace_gutter horscroll"}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){c.characterWidth=d.getCharacterWidth(),c.lineHeight=d.getLineHeight(),c.$updatePrintMargin(),c.onResize(!0),c.$loop.schedule(c.CHANGE_FULL)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.setPadding(4),this.$updatePrintMargin()};(function(){this.showGutter=!0,this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,d.implement(this,p),this.setSession=function(a){this.session=a,this.$cursorLayer.setSession(a),this.$markerBack.setSession(a),this.$markerFront.setSession(a),this.$gutterLayer.setSession(a),this.$textLayer.setSession(a),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(a,b){b===undefined&&(b=Infinity),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)return;if(bd&&this.session.setScrollTop(d),this.scrollTop+this.$size.scrollerHeightc&&(c0)return!0;if(b>0&&this.session.getScrollTop()+this.$size.scrollerHeighth&&(e=g.end.row+1,g=this.session.getNextFoldLine(e,g),h=g?g.start.row:Infinity);if(e>f)break;var j=this.$annotations[e]||b;c.push("
",e+1);if(i){var k=i[e];k==null&&(k=i[e]=this.session.getFoldWidget(e)),k&&c.push("")}var l=this.session.getRowLength(e)-1;while(l--)c.push("
¦");c.push("
"),e++}this.element=d.setInnerHtml(this.element,c.join("")),this.element.style.height=a.minHeight+"px";var m=this.element.offsetWidth;m!==this.gutterWidth&&(this.gutterWidth=m,this._emit("changeGutterWidth",m))},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(a){a?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=a},this.getShowFoldWidgets=function(){return this.$showFoldWidgets}}).call(g.prototype),b.Gutter=g}),define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../range").Range,e=a("../lib/dom"),f=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.update=function(a){var a=a||this.config;if(!a)return;this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],f=d.range.clipRows(a.firstRow,a.lastRow);if(f.isEmpty())continue;f=f.toScreenRange(this.session);if(d.renderer){var g=this.$getTop(f.start.row,a),h=Math.round(this.$padding+f.start.column*a.characterWidth);d.renderer(b,f,h,g,a)}else f.isMultiLine()?d.type=="text"?this.drawTextMarker(b,f,d.clazz,a):this.drawMultiLineMarker(b,f,d.clazz,a,d.type):this.drawSingleLineMarker(b,f,d.clazz+" start",a,null,d.type)}this.element=e.setInnerHtml(this.element,b.join(""))},this.$getTop=function(a,b){return(a-b.firstRowScreen)*b.lineHeight},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.session.getScreenLastRowColumn(f));this.drawSingleLineMarker(a,g,c+" start",e,1,"text"),f=b.end.row,g=new d(f,0,f,b.end.column),this.drawSingleLineMarker(a,g,c,e,0,"text");for(f=b.start.row+1;f"),j=this.$getTop(b.end.row,d),i=Math.round(b.end.column*d.characterWidth),a.push("
"),h=(b.end.row-b.start.row-1)*d.lineHeight;if(h<0)return;j=this.$getTop(b.start.row+1,d),a.push("
")},this.drawSingleLineMarker=function(a,b,c,d,e,f){var g=f==="background"?0:this.$padding,h=d.lineHeight;if(f==="background")var i=d.width;else i=Math.round((b.end.column+(e||0)-b.start.column)*d.characterWidth);var j=this.$getTop(b.start.row,d),k=Math.round(g+b.start.column*d.characterWidth);a.push("
")}}).call(f.prototype),b.Marker=f}),define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/dom"),f=a("../lib/lang"),g=a("../lib/useragent"),h=a("../lib/event_emitter").EventEmitter,i=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes()||{width:0,height:0},this.$pollSizeChanges()};(function(){d.implement(this,h),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.$padding=0,this.setPadding=function(a){this.$padding=a,this.element.style.padding="0 "+a+"px"},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.checkForSizeChanges=function(){var a=this.$measureSizes();a&&(this.$characterSize.width!==a.width||this.$characterSize.height!==a.height)&&(this.$characterSize=a,this._emit("changeCharacterSize",{data:a}))},this.$pollSizeChanges=function(){var a=this;this.$pollSizeChangesTimer=setInterval(function(){a.checkForSizeChanges()},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=g.isIE||g.isOldGecko?function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=e.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top=-a*40+"px",c.visibility="hidden",c.position="fixed",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a);if(this.element.ownerDocument.body)this.element.ownerDocument.body.appendChild(b);else{var d=this.element.parentNode;while(!e.hasCssClass(d,"ace_editor"))d=d.parentNode;d.appendChild(b)}}if(!this.element.offsetWidth)return null;var c=this.$measureNode.style,g=e.computedStyle(this.element);for(var h in this.$fontStyles)c[h]=g[h];var i={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return i.width==0||i.height==0?null:i}:function(){if(!this.$measureNode){var a=this.$measureNode=e.createElement("div"),b=a.style;b.width=b.height="auto",b.left=b.top="-100px",b.visibility="hidden",b.position="fixed",b.overflow="visible",b.whiteSpace="nowrap",a.innerHTML="X";var c=this.element.parentNode;while(c&&!e.hasCssClass(c,"ace_editor"))c=c.parentNode;if(!c)return this.$measureNode=null;c.appendChild(a)}var d=this.$measureNode.getBoundingClientRect(),f={height:d.height,width:d.width};return f.width==0||f.height==0?null:f},this.setSession=function(a){this.session=a},this.showInvisibles=!1,this.setShowInvisibles=function(a){return this.showInvisibles==a?!1:(this.showInvisibles=a,!0)},this.$tabStrings=[],this.$computeTabString=function(){var a=this.session.getTabSize(),b=this.$tabStrings=[0];for(var c=1;c"+this.TAB_CHAR+(new Array(c)).join(" ")+"
"):b.push((new Array(c+1)).join(" "))},this.updateLines=function(a,b,c){this.$computeTabString(),(this.config.lastRow!=a.lastRow||this.config.firstRow!=a.firstRow)&&this.scrollLines(a),this.config=a;var d=Math.max(b,a.firstRow),f=Math.min(c,a.lastRow),g=this.element.childNodes,h=0;for(var i=a.firstRow;i0;d--)c.removeChild(c.firstChild);if(b.lastRow>a.lastRow)for(var d=this.session.getFoldedRowCount(a.lastRow+1,b.lastRow);d>0;d--)c.removeChild(c.lastChild);if(a.firstRowb.lastRow){var e=this.$renderLinesFragment(a,b.lastRow+1,a.lastRow);c.appendChild(e)}},this.$renderLinesFragment=function(a,b,c){var d=this.element.ownerDocument.createDocumentFragment(),f=b,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>c)break;var i=e.createElement("div"),j=[],k=this.session.getTokens(f,f);k.length==1&&this.$renderLine(j,f,k[0].tokens,!1),i.innerHTML=j.join("");if(this.$useLineGroups())i.className="ace_line_group",d.appendChild(i);else{var l=i.childNodes;while(l.length)d.appendChild(l[0])}f++}return d},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=a.firstRow,d=a.lastRow,f=c,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>d)break;this.$useLineGroups()&&b.push("
");var i=this.session.getTokens(f,f);i.length==1&&this.$renderLine(b,f,i[0].tokens,!1),this.$useLineGroups()&&b.push("
"),f++}this.element=e.setInnerHtml(this.element,b.join(""))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(a,b,c,d){var e=this,f=/\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g,h=function(a,c,d,f,h){if(a.charCodeAt(0)==32)return(new Array(a.length+1)).join(" ");if(a==" "){var i=e.session.getScreenTabSize(b+f);return b+=i-1,e.$tabStrings[i]}if(a=="&")return g.isOldGecko?"&":"&";if(a=="<")return"<";if(a==" "){var j=e.showInvisibles?"ace_cjk ace_invisible":"ace_cjk",k=e.showInvisibles?e.SPACE_CHAR:"";return b+=1,""+k+""}if(a.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)){if(e.showInvisibles){var k=(new Array(a.length+1)).join(e.SPACE_CHAR);return""+k+""}return" "}return b+=1,""+a+""},i=d.replace(f,h);if(!this.$textToken[c.type]){var j="ace_"+c.type.replace(/\./g," ace_"),k="";c.type=="fold"&&(k=" style='width:"+c.value.length*this.config.characterWidth+"px;' "),a.push("",i,"")}else a.push(i);return b+d.length},this.$renderLineCore=function(a,b,c,d,e){var f=0,g=0,h,i=0,j=this;!d||d.length==0?h=Number.MAX_VALUE:h=d[0],e||a.push("
");for(var k=0;k=h)i=j.$renderToken(a,i,l,m.substring(0,h-f)),m=m.substring(h-f),f=h,e||a.push("
","
"),g++,i=0,h=d[g]||Number.MAX_VALUE;m.length!=0&&(f+=m.length,i=j.$renderToken(a,i,l,m))}}this.showInvisibles&&(b!==this.session.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+"")),e||a.push("
")},this.$renderLine=function(a,b,c,d){if(!this.session.isRowFolded(b)){var e=this.session.getRowSplitData(b);this.$renderLineCore(a,b,c,e,d)}else this.$renderFoldLine(a,b,c,d)},this.$renderFoldLine=function(a,b,c,d){function h(a,b,c){var d=0,e=0;while(e+a[d].value.lengthc-b&&(f=f.substring(0,c-b)),g.push({type:a[d].type,value:f}),e=b+f.length,d+=1}while(ec&&(f=f.substring(0,c-e)),g.push({type:a[d].type,value:f}),e+=f.length,d+=1}}var e=this.session,f=e.getFoldLine(b),g=[];f.walk(function(a,b,d,e,f){a?g.push({type:"fold",value:a}):(f&&(c=this.session.getTokens(b,b)[0].tokens),c.length!=0&&h(c,e,d))}.bind(this),f.end.row,this.session.getLine(f.end.row).length);var i=this.session.$useWrapMode?this.session.$wrapData[b]:null;this.$renderLineCore(a,b,g,i,d)},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(i.prototype),b.Text=i}),define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../lib/dom"),e=function(a){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.cursors=[],this.cursor=this.addCursor()};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.addCursor=function(){var a=d.createElement("div"),b="ace_cursor";return this.isVisible||(b+=" ace_hidden"),this.overwrite&&(b+=" ace_overwrite"),a.className=b,this.element.appendChild(a),this.cursors.push(a),a},this.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},this.hideCursor=function(){this.isVisible=!1;for(var a=this.cursors.length;a--;)d.addCssClass(this.cursors[a],"ace_hidden");clearInterval(this.blinkId)},this.showCursor=function(){this.isVisible=!0;for(var a=this.cursors.length;a--;)d.removeCssClass(this.cursors[a],"ace_hidden");this.element.style.visibility="",this.restartTimer()},this.restartTimer=function(){clearInterval(this.blinkId);if(!this.isVisible)return;var a=this.cursors.length==1?this.cursor:this.element;this.blinkId=setInterval(function(){a.style.visibility="hidden",setTimeout(function(){a.style.visibility=""},400)},1e3)},this.getPixelPosition=function(a,b){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var c=this.session.documentToScreenPosition(a),d=Math.round(this.$padding+c.column*this.config.characterWidth),e=(c.row-(b?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:d,top:e}},this.update=function(a){this.config=a;if(this.session.selectionMarkerCount>0){var b=this.session.$selectionMarkers,c=0,d,e=0;for(var c=b.length;c--;){d=b[c];var f=this.getPixelPosition(d.cursor,!0),g=(this.cursors[e++]||this.addCursor()).style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px"}if(e>1)while(this.cursors.length>e)this.removeCursor()}else{var f=this.getPixelPosition(null,!0),g=this.cursor.style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px";while(this.cursors.length>1)this.removeCursor()}var h=this.session.getOverwrite();h!=this.overwrite&&this.$setOverite(h),this.restartTimer()},this.$setOverite=function(a){this.overwrite=a;for(var b=this.cursors.length;b--;)a?d.addCssClass(this.cursors[b],"ace_overwrite"):d.removeCssClass(this.cursors[b],"ace_overwrite")},this.destroy=function(){clearInterval(this.blinkId)}}).call(e.prototype),b.Cursor=e}),define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/event_emitter").EventEmitter,h=function(a){this.element=e.createElement("div"),this.element.className="ace_sb",this.inner=e.createElement("div"),this.element.appendChild(this.inner),a.appendChild(this.element),this.width=e.scrollbarWidth(a.ownerDocument),this.element.style.width=(this.width||15)+5+"px",f.addListener(this.element,"scroll",this.onScroll.bind(this))};(function(){d.implement(this,g),this.onScroll=function(){this._emit("scroll",{data:this.element.scrollTop})},this.getWidth=function(){return this.width},this.setHeight=function(a){this.element.style.height=a+"px"},this.setInnerHeight=function(a){this.inner.style.height=a+"px"},this.setScrollTop=function(a){this.element.scrollTop=a}}).call(h.prototype),b.ScrollBar=h}),define("ace/renderloop",["require","exports","module","ace/lib/event"],function(a,b,c){"use strict";var d=a("./lib/event"),e=function(a,b){this.onRender=a,this.pending=!1,this.changes=0,this.window=b||window};(function(){this.schedule=function(a){this.changes=this.changes|a;if(!this.pending){this.pending=!0;var b=this;d.nextTick(function(){b.pending=!1;var a;while(a=b.changes)b.changes=0,b.onRender(a)},this.window)}}}).call(e.prototype),b.RenderLoop=e}),define("text!ace/css/editor.css",[],"@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);\n\n.ace_editor {\n position: absolute;\n overflow: hidden;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace;\n font-size: 12px;\n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n cursor: text;\n}\n\n.ace_composition {\n position: absolute;\n background: #555;\n color: #DDD;\n z-index: 4;\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n height: 100%;\n width: auto;\n cursor: default;\n z-index: 1000;\n}\n\n.ace_gutter.horscroll {\n box-shadow: 0px 0px 20px rgba(0,0,0,0.4);\n}\n\n.ace_gutter-cell {\n padding-left: 19px;\n padding-right: 6px;\n}\n\n.ace_gutter-cell.ace_error {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info {\n background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0;\n}\n\n.ace_editor .ace_print_margin_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden;\n margin: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n.ace_editor .ace_print_margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_editor textarea {\n position: fixed;\n z-index: 0;\n width: 10px;\n height: 30px;\n opacity: 0;\n background: transparent;\n appearance: none;\n -moz-appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n white-space: nowrap;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter .ace_layer {\n position: relative;\n min-width: 40px;\n text-align: right;\n pointer-events: auto;\n}\n\n.ace_text-layer {\n color: black;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n}\n\n.ace_cursor.ace_hidden {\n opacity: 0.2;\n}\n\n.ace_editor.multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_gutter .ace_gutter_active_line{\n background-color : #dcdcdc;\n}\n\n.ace_marker-layer .ace_selected_word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n \n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n border-radius: 2px;\n \n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n}\n\n.ace_dragging .ace_content {\n cursor: move;\n}\n\n.ace_folding-enabled > .ace_gutter-cell {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n\n margin: 0 -12px 1px 1px;\n display: inline-block;\n height: 14px;\n width: 11px;\n vertical-align: text-bottom;\n \n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat;\n background-position: center 5px;\n\n border-radius: 3px;\n}\n\n.ace_fold-widget.end {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget.closed {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n background-position: center 4px;\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n\n.ace_fold-widget.invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n"),define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor"],function(a,b,c){function j(a,b,c){return i.$options.wrap=!0,i.$options.needle=b,i.$options.backwards=c==-1,i.find(a)}function m(a,b){return a.row==b.row&&a.column==b.column}function n(a){a.$onAddRange=a.$onAddRange.bind(a),a.$onRemoveRange=a.$onRemoveRange.bind(a),a.$onMultiSelect=a.$onMultiSelect.bind(a),a.$onSingleSelect=a.$onSingleSelect.bind(a),b.onSessionChange.call(a,a),a.on("changeSession",b.onSessionChange.bind(a)),a.on("mousedown",g),a.commands.addCommands(b.commands.defaultCommands),o(a)}function o(a){function e(){c&&(d.style.cursor="",c=!1)}var b=a.textInput.getElement(),c=!1,d=a.renderer.content;b.addEventListener("keydown",function(a){a.keyCode==18&&!(a.ctrlKey||a.shiftKey||a.metaKey)?c||(d.style.cursor="crosshair",c=!0):c&&(d.style.cursor="")}),b.addEventListener("keyup",e),b.addEventListener("blur",e)}var d=a("./range_list").RangeList,e=a("./range").Range,f=a("./selection").Selection,g=a("./mouse/multi_select_handler").onMouseDown;b.commands=a("./commands/multi_select_commands");var h=a("./search").Search,i=new h,k=a("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(k.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(a,b){if(!a)return;if(!this.inMultiSelectMode&&this.rangeCount==0){var c=this.toOrientedRange();if(a.intersects(c))return b||this.fromOrientedRange(a);this.rangeList.add(c),this.$onAddRange(c)}a.cursor||(a.cursor=a.end);var d=this.rangeList.add(a);return this.$onAddRange(a),d.length&&this.$onRemoveRange(d),this.rangeCount>1&&!this.inMultiSelectMode&&(this._emit("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),b||this.fromOrientedRange(a)},this.toSingleRange=function(a){a=a||this.ranges[0];var b=this.rangeList.removeAll();b.length&&this.$onRemoveRange(b),a&&this.fromOrientedRange(a)},this.substractPoint=function(a){var b=this.rangeList.substractPoint(a);if(b)return this.$onRemoveRange(b),b[0]},this.mergeOverlappingRanges=function(){var a=this.rangeList.merge();a.length?this.$onRemoveRange(a):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(a){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(a),this._emit("addRange",{range:a})},this.$onRemoveRange=function(a){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var b=this.rangeList.ranges.pop();a.push(b),this.rangeCount=0}for(var c=a.length;c--;){var d=this.ranges.indexOf(a[c]);this.ranges.splice(d,1)}this._emit("removeRange",{ranges:a}),this.rangeCount==0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._emit("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),b=b||this.ranges[0],b&&!b.isEqual(this.getRange())&&this.fromOrientedRange(b)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new d,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeList.ranges.concat()},this.splitIntoLines=function(){if(this.rangeCount>1){var a=this.rangeList.ranges,b=a[a.length-1],c=e.fromPoints(a[0].start,b.end);this.toSingleRange(),this.setSelectionRange(c,b.cursor==b.start)}else{var d=this.session.documentToScreenPosition(this.selectionLead),f=this.session.documentToScreenPosition(this.selectionAnchor),g=this.rectangularRangeBlock(d,f);g.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(a,b,c){var d=[],f=a.column0)p--;if(p>0){var q=0;while(d[q].isEmpty())q++}for(var r=p;r>=q;r--)d[r].isEmpty()&&d.splice(r,1)}return d}}.call(f.prototype);var l=a("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(a){a.cursor||(a.cursor=a.end);var b=this.getSelectionStyle();return a.marker=this.session.addMarker(a,"ace_selection",b),this.session.$selectionMarkers.push(a),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,a},this.removeSelectionMarker=function(a){if(!a.marker)return;this.session.removeMarker(a.marker);var b=this.session.$selectionMarkers.indexOf(a);b!=-1&&this.session.$selectionMarkers.splice(b,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(a){var b=this.session.$selectionMarkers;for(var c=a.length;c--;){var d=a[c];if(!d.marker)continue;this.session.removeMarker(d.marker);var e=b.indexOf(d);e!=-1&&b.splice(e,1)}this.session.selectionMarkerCount=b.length},this.$onAddRange=function(a){this.addSelectionMarker(a.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(a){this.removeSelectionMarkers(a.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(a){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("multiselect"),this.keyBinding.addKeyboardHandler(b.commands.keyboardHandler),this.commands.on("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(a){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("multiselect"),this.keyBinding.removeKeyboardHandler(b.commands.keyboardHandler),this.commands.removeEventListener("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelectExec=function(a){var b=a.command,c=a.editor;b.multiSelectAction?b.multiSelectAction=="forEach"?c.forEachSelection(b,a.args):b.multiSelectAction=="single"?(c.exitMultiSelectMode(),b.exec(c,a.args||{})):b.multiSelectAction(c,a.args||{}):(b.exec(c,a.args||{}),c.multiSelect.addRange(c.multiSelect.toOrientedRange()),c.multiSelect.mergeOverlappingRanges()),a.preventDefault()},this.forEachSelection=function(a,b){if(this.inVirtualSelectionMode)return;var c=this.session,d=this.selection,e=d.rangeList,g=d._eventRegistry;d._eventRegistry={};var h=new f(c);this.inVirtualSelectionMode=!0;for(var i=e.ranges.length;i--;)h.fromOrientedRange(e.ranges[i]),this.selection=c.selection=h,a.exec(this,b||{}),h.toOrientedRange(e.ranges[i]);h.detach(),this.selection=c.selection=d,this.inVirtualSelectionMode=!1,d._eventRegistry=g,d.mergeOverlappingRanges(),this.onCursorChange(),this.onSelectionChange()},this.exitMultiSelectMode=function(){if(this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getCopyText=function(){var a="";if(this.inMultiSelectMode){var b=this.multiSelect.rangeList.ranges;a=[];for(var c=0;c0)continue;return f==0?d:(f=this.comparePoints(a,e.start),f>=0?d:-d-1)}return-d-1},this.add=function(a){var b=this.pointIndex(a.start);b<0&&(b=-b-1);var c=this.pointIndex(a.end,b);return c<0?c=-c-1:c++,this.ranges.splice(b,c-b,a)},this.addList=function(a){var b=[];for(var c=a.length;c--;)b.push.call(b,this.add(a[c]));return b},this.substractPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges.splice(b,1)},this.merge=function(){var a=[],b=this.ranges,c=b[0],d;for(var e=1;e=0},this.containsPoint=function(a){return this.pointIndex(a)>=0},this.rangeAtPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges[b]},this.clipRows=function(a,b){var c=this.ranges;if(c[0].start.row>b||c[c.length-1].start.rowe)break;l.start.row==e&&l.start.column>=c.column&&(l.start.column+=h,l.start.row+=g),l.end.row==e&&l.end.column>=c.column&&(l.end.column+=h,l.end.row+=g)}if(g!=0&&j=this.pos.column&&c.start.column<=this.pos.column+this.length+1){var f=c.start.column-this.pos.column;this.length+=e;if(!this.session.$fromUndo){if(b.action==="insertText")for(var g=this.others.length-1;g>=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=this.pos.column&&b.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var a=0;a1&&h(b,"")>-1&&(i=RegExp(this.source,d.replace.call(g(this),"g","")),d.replace.call(a.slice(b.index),i,function(){for(var a=1;ab.index&&this.lastIndex--}return b},f||(RegExp.prototype.test=function(a){var b=d.exec.call(this,a);return b&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--,!!b})}),define("ace/lib/es5-shim",["require","exports","module"],function(a,b,c){function p(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=g.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,h=c.apply(f,d.concat(g.call(arguments)));return h!==null&&Object(h)===h?h:f}return c.apply(b,d.concat(g.call(arguments)))};return e});var d=Function.prototype.call,e=Array.prototype,f=Object.prototype,g=e.slice,h=d.bind(f.toString),i=d.bind(f.hasOwnProperty),j,k,l,m,n;if(n=i(f,"__defineGetter__"))j=d.bind(f.__defineGetter__),k=d.bind(f.__defineSetter__),l=d.bind(f.__lookupGetter__),m=d.bind(f.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return h(b)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b){var c=G(this),d=arguments[1],e=0,f=c.length>>>0;if(h(b)!="[object Function]")throw new TypeError;while(e>>0,e=Array(d),f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=[],f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e=0,f;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);for(;e>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e,f=d-1;if(arguments.length>=2)e=arguments[1];else do{if(f in c){e=c[f--];break}if(--f<0)throw new TypeError}while(!0);do f in this&&(e=b.call(void 0,e,c[f],f,c));while(f--);return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=G(this),d=c.length>>>0;if(!d)return-1;var e=0;arguments.length>1&&(e=E(arguments[1])),e=e>=0?e:Math.max(0,d+e);for(;e>>0;if(!d)return-1;var e=d-1;arguments.length>1&&(e=Math.min(e,E(arguments[1]))),e=e>=0?e:d-Math.abs(e);for(;e>=0;e--)if(e in c&&b===c[e])return e;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||(b.constructor?b.constructor.prototype:f)});if(!Object.getOwnPropertyDescriptor){var o="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(o+b);if(!i(b,c))return;var d,e,g;d={enumerable:!0,configurable:!0};if(n){var h=b.__proto__;b.__proto__=f;var e=l(b,c),g=m(b,c);b.__proto__=h;if(e||g)return e&&(d.get=e),g&&(d.set=g),d}return d.value=b[c],d}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={__proto__:null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}return c!==void 0&&Object.defineProperties(d,c),d});if(Object.defineProperty){var q=p({}),r=typeof document=="undefined"||p(document.createElement("div"));if(!q||!r)var s=Object.defineProperty}if(!Object.defineProperty||s){var t="Property description must be an object: ",u="Object.defineProperty called on non-object: ",v="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(u+b);if(typeof d!="object"&&typeof d!="function"||d===null)throw new TypeError(t+d);if(s)try{return s.call(Object,b,c,d)}catch(e){}if(i(d,"value"))if(n&&(l(b,c)||m(b,c))){var g=b.__proto__;b.__proto__=f,delete b[c],b[c]=d.value,b.__proto__=g}else b[c]=d.value;else{if(!n)throw new TypeError(v);i(d,"get")&&j(b,c,d.get),i(d,"set")&&k(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)i(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(w){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){if(Object(b)===b)throw new TypeError;var c="";while(i(b,c))c+="?";b[c]=!0;var d=i(b,c);return delete b[c],d});if(!Object.keys){var x=!0,y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],z=y.length;for(var A in{toString:null})x=!1;Object.keys=function H(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)i(a,b)&&H.push(b);if(x)for(var c=0,d=z;c9999?"+":"")+("00000"+Math.abs(e)).slice(0<=e&&e<=9999?-4:-6),c=b.length;while(c--)d=b[c],d<10&&(b[c]="0"+d);return e+"-"+b.slice(0,2).join("-")+"T"+b.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(b){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(a){var b=function e(b,c,d,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=j==1&&String(b)===b?new a(e.parse(b)):j>=7?new a(b,c,d,f,g,h,i):j>=6?new a(b,c,d,f,g,h):j>=5?new a(b,c,d,f,g):j>=4?new a(b,c,d,f):j>=3?new a(b,c,d):j>=2?new a(b,c):j>=1?new a(b):new a;return k.constructor=e,k}return a.apply(this,arguments)},c=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var d in a)b[d]=a[d];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;var g=+e.pop(),h=+e.pop(),i=e.pop(),j=0;if(i){if(h>23||g>59)return NaN;j=(h*60+g)*6e4*(i=="+"?-1:1)}var k=+e[0];return 0<=k&&k<=99?(e[0]=k+400,a.UTC.apply(this,e)+j-126227808e5):a.UTC.apply(this,e)+j}return a.parse.apply(this,arguments)},b}(Date));var B=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||B.trim()){B="["+B+"]";var C=new RegExp("^"+B+B+"*"),D=new RegExp(B+B+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(D,"")}}var E=function(a){return a=+a,a!==a?a=0:a!==0&&a!==1/0&&a!==-Infinity&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a},F="a"[0]!="a",G=function(a){if(a==null)throw new TypeError;return F&&typeof a=="string"&&a?a.split(""):Object(a)}}),define("ace/lib/dom",["require","exports","module"],function(a,b,c){"use strict";var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}return d&&c.push(b),a.className=c.join(" "),d},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.hasCssString=function(a,b){var c=0,d;b=b||document;if(b.createStyleSheet&&(d=b.styleSheets)){while(c5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isOldIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko||e.isOpera){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){return h=a.keyIdentifier||a.keyCode,g(c,a,a.keyCode)})}};if(window.postMessage){var h=1;b.nextTick=function(a,c){c=c||window;var d="zero-timeout-message-"+h;b.addListener(c,"message",function e(f){f.data==d&&(b.stopPropagation(f),b.removeListener(c,"message",e),a())}),c.postMessage(d,"*")}}else b.nextTick=function(a,b){b=b||window,window.setTimeout(a,0)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(a,b,c){"use strict";var d=a("./oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(var b in a.FUNCTION_KEYS){var c=a.FUNCTION_KEYS[b].toUpperCase();a[c]=parseInt(b,10)}return d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS),a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),define("ace/lib/oop",["require","exports","module"],function(a,b,c){"use strict",b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),define("ace/lib/useragent",["require","exports","module"],function(a,b,c){"use strict";var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),b.isOldIE=b.isIE&&b.isIE<9,b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOldGecko=b.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isChrome=parseFloat(e.split(" Chrome/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.isIPad=e.indexOf("iPad")>=0,b.isTouchPad=e.indexOf("TouchPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands"],function(a,b,c){"use strict",a("./lib/fixoldbrowsers");var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/useragent"),g=a("./keyboard/textinput").TextInput,h=a("./mouse/mouse_handler").MouseHandler,i=a("./mouse/fold_handler").FoldHandler,j=a("./keyboard/keybinding").KeyBinding,k=a("./edit_session").EditSession,l=a("./search").Search,m=a("./range").Range,n=a("./lib/event_emitter").EventEmitter,o=a("./commands/command_manager").CommandManager,p=a("./commands/default_commands").commands,q=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.commands=new o(f.isMac?"mac":"win",p),this.textInput=new g(a.getTextAreaContainer(),this),this.keyBinding=new j(this),f.isIPad||(this.$mouseHandler=new h(this),new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.setSession(b||new k(""))};(function(){d.implement(this,n),this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session==a)return;if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:a,oldSession:b})},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.setFontSize=function(a){this.container.style.fontSize=a,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket","text")}},10)},this.focus=function(){var a=this;setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.$cursorChange=function(){this.renderer.updateCursor(),this.renderer.moveTextAreaToCursor(this.textInput.getElement())},this.onDocumentChange=function(a){var b=a.data,c=b.range,d;c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines"?d=c.end.row:d=Infinity,this.renderer.updateLines(c.start.row,d),this._emit("change",a),this.$cursorChange()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$updateHighlightActiveLine(),this.$updateHighlightGutterLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),a.$highlightLineMarker=null;if(this.$highlightActiveLine){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row);if(this.getSelectionStyle()!="line"||!this.selection.isMultiLine()){var d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","background")}}},this.$updateHighlightGutterLine=function(){typeof this.$lastrow=="number"&&this.renderer.removeGutterDecoration(this.$lastrow,"ace_gutter_active_line"),this.$lastrow=null,this.$highlightGutterLine&&this.renderer.addGutterDecoration(this.$lastrow=this.getCursorPosition().row,"ace_gutter_active_line")},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine(),this.$updateHighlightGutterLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.$updateHighlightGutterLine(),this.renderer.updateFull()},this.getCopyText=function(){var a="";return this.selection.isEmpty()||(a=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",a),a},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(a){this._emit("paste",a),this.insert(a)},this.insert=function(a){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace(" ",this.session.getTabString());if(!this.selection.isEmpty())d=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)==" "?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}i&&c.autoOutdent(h,b,d.row)},this.onTextInput=function(a){this.keyBinding.onTextInput(a)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(a){this.$mouseHandler.setDragDelay(a)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(a){if(this.$selectionStyle==a)return;this.$selectionStyle=a,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:a})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){if(this.$highlightActiveLine==a)return;this.$highlightActiveLine=a,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightGutterLine=!0,this.setHighlightGutterLine=function(a){if(this.$highlightGutterLine==a)return;this.$highlightGutterLine=a,this.$updateHighlightGutterLine()},this.getHighlightGutterLine=function(){return this.$highlightGutterLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){if(this.$highlightSelectedWord==a)return;this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setShowInvisibles=function(a){if(this.getShowInvisibles()==a)return;this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.setShowFoldWidgets=function(a){var b=this.renderer.$gutterLayer;if(b.getShowFoldWidgets()==a)return;this.renderer.$gutterLayer.setShowFoldWidgets(a),this.$showFoldWidgets=a,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.setFadeFoldWidgets=function(a){this.renderer.setFadeFoldWidgets(a)},this.getFadeFoldWidgets=function(){return this.renderer.getFadeFoldWidgets()},this.remove=function(a){this.selection.isEmpty()&&(a=="left"?this.selection.selectLeft():this.selection.selectRight());var b=this.getSelectionRange();if(this.getBehavioursEnabled()){var c=this.session,d=c.getState(b.start.row),e=c.getMode().transformAction(d,"deletion",this,c,b);e&&(b=e)}this.session.remove(b),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b===0)return;var c=this.session.getLine(a.row),d,e;b=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.isRowFullyVisible=function(a){return a>=this.renderer.getFirstFullyVisibleRow()&&a<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(a,b){var c=this.renderer,d=this.renderer.layerConfig,e=a*Math.floor(d.height/d.lineHeight);this.$blockScrolling++,b==1?this.selection.$moveSelection(function(){this.moveCursorBy(e,0)}):b==0&&(this.selection.moveCursorBy(e,0),this.selection.clearSelection()),this.$blockScrolling--;var f=c.scrollTop;c.scrollBy(0,e*d.lineHeight),b!=null&&c.scrollCursorIntoView(null,.5),c.animateScrolling(f)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.scrollToLine=function(a,b,c,d){this.renderer.scrollToLine(a,b,c,d)},this.centerSelection=function(){var a=this.getSelectionRange(),b=Math.floor(a.start.row+(a.end.row-a.start.row)/2);this.renderer.scrollToLine(b,!0)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b)},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a)},this.jumpToMatching=function(){var a=this.getCursorPosition(),b=this.session.findMatchingBracket(a);b||(a.column+=1,b=this.session.findMatchingBracket(a)),b||(a.column-=2,b=this.session.findMatchingBracket(a)),b&&(this.clearSelection(),this.moveCursorTo(b.row,b.column))},this.gotoLine=function(a,b,c){this.selection.clearSelection(),this.session.unfold({row:a-1,column:b||0}),this.$blockScrolling+=1,this.moveCursorTo(a-1,b||0),this.$blockScrolling-=1,this.isRowFullyVisible(a-1)||this.scrollToLine(a-1,!0,c)},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b)},this.navigateUp=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(-a,0)},this.navigateDown=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(a,0)},this.navigateLeft=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().start;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().end;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){var a=this.renderer.scrollTop;this.selection.moveCursorFileEnd(),this.clearSelection(),this.renderer.animateScrolling(a)},this.navigateFileStart=function(){var a=this.renderer.scrollTop;this.selection.moveCursorFileStart(),this.clearSelection(),this.renderer.animateScrolling(a)},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.session),d=0;return c?(this.$tryReplace(c,a)&&(d=1),c!==null&&(this.selection.setSelectionRange(c),this.renderer.scrollSelectionIntoView(c.start,c.end)),d):d},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.session),d=0;if(!c.length)return d;this.$blockScrolling+=1;var e=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var f=c.length-1;f>=0;--f)this.$tryReplace(c[f],a)&&d++;return this.selection.setSelectionRange(e),this.$blockScrolling-=1,d},this.$tryReplace=function(a,b){var c=this.session.getTextRange(a);return b=this.$search.replace(c,b),b!==null?(a.end=this.session.replace(a,b),a):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b,c){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find(!1,c)},this.findNext=function(a,b){a=a||{},this.$search.set(a),this.$find(!1,b)},this.findPrevious=function(a,b){a=a||{},this.$search.set(a),this.$find(!0,b)},this.$find=function(a,b){this.selection.isEmpty()||this.$search.set({needle:this.session.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var c=this.$search.find(this.session);if(c){this.$blockScrolling+=1,this.session.unfold(c),this.selection.setSelectionRange(c),this.$blockScrolling-=1;var d=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(c.start,c.end,.5),this.renderer.animateScrolling(d)}},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy()}}).call(q.prototype),b.Editor=q}),define("ace/lib/lang",["require","exports","module"],function(a,b,c){"use strict",b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(var c=0,d=a.length;c1&&(d.charAt(0)==g?d=d.substr(1):d.charAt(d.length-1)==g&&(d=d.slice(0,-1))),d&&d!=g&&(j?b.onPaste(d):b.onTextInput(d));if(!v())return!1}}i=!1,j=!1,c.value=g,l()}function v(){return document.activeElement===c}var c=f.createElement("textarea");e.isTouchPad&&c.setAttribute("x-palm-disable-auto-cap",!0),c.style.left="-10000px",c.style.position="fixed",a.insertBefore(c,a.firstChild);var g=String.fromCharCode(0);m();var h=!1,i=!1,j=!1,k="",n=function(a){setTimeout(function(){h||m(a.data)},0)},o=function(a){if(e.isOldIE&&c.value.charCodeAt(0)>128)return;setTimeout(function(){h||m()},0)},p=function(a){h=!0,b.onCompositionStart(),e.isGecko||setTimeout(q,0)},q=function(){if(!h)return;b.onCompositionUpdate(c.value)},r=function(a){h=!1,b.onCompositionEnd()},s=function(a){i=!0;var d=b.getCopyText();d?c.value=d:a.preventDefault(),l(),setTimeout(function(){m()},0)},t=function(a){i=!0;var d=b.getCopyText();d?(c.value=d,b.onCut()):a.preventDefault(),l(),setTimeout(function(){m()},0)};d.addCommandKeyListener(c,b.onCommandKey.bind(b));if(e.isOldIE){var u={13:1,27:1};d.addListener(c,"keyup",function(a){h&&(!c.value||u[a.keyCode])&&setTimeout(r,0);if((c.value.charCodeAt(0)|0)<129)return;h?q():p()})}"onpropertychange"in c&&!("oninput"in c)?d.addListener(c,"propertychange",o):d.addListener(c,"input",n),d.addListener(c,"paste",function(a){j=!0,a.clipboardData&&a.clipboardData.getData?(m(a.clipboardData.getData("text/plain")),a.preventDefault()):o()}),"onbeforecopy"in c&&typeof clipboardData!="undefined"?(d.addListener(c,"beforecopy",function(a){var c=b.getCopyText();c?clipboardData.setData("Text",c):a.preventDefault()}),d.addListener(a,"keydown",function(a){if(a.ctrlKey&&a.keyCode==88){var c=b.getCopyText();c&&(clipboardData.setData("Text",c),b.onCut()),d.preventDefault(a)}})):(d.addListener(c,"copy",s),d.addListener(c,"cut",t)),d.addListener(c,"compositionstart",p),e.isGecko&&d.addListener(c,"text",q),e.isWebKit&&d.addListener(c,"keyup",q),d.addListener(c,"compositionend",r),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),l()}),this.focus=function(){b.onFocus(),l(),c.focus()},this.blur=function(){c.blur()},this.isFocused=v,this.getElement=function(){return c},this.onContextMenu=function(a,b){a&&(k||(k=c.style.cssText),c.style.cssText="position:fixed; z-index:1000;left:"+(a.x-2)+"px; top:"+(a.y-2)+"px;"),b&&(c.value="")},this.onContextMenuClose=function(){setTimeout(function(){k&&(c.style.cssText=k,k=""),m()},0)}};b.TextInput=g}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event"],function(a,b,c){"use strict";var d=a("../lib/event"),e=a("./default_handlers").DefaultHandlers,f=a("./default_gutter_handler").GutterHandler,g=a("./mouse_event").MouseEvent,h=function(a){this.editor=a,new e(a),new f(a),d.addListener(a.container,"mousedown",function(b){return a.focus(),d.preventDefault(b)}),d.addListener(a.container,"selectstart",function(a){return d.preventDefault(a)});var b=a.renderer.getMouseEventTarget();d.addListener(b,"mousedown",this.onMouseEvent.bind(this,"mousedown")),d.addListener(b,"click",this.onMouseEvent.bind(this,"click")),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove")),d.addMultiMouseDownListener(b,0,2,500,this.onMouseEvent.bind(this,"dblclick")),d.addMultiMouseDownListener(b,0,3,600,this.onMouseEvent.bind(this,"tripleclick")),d.addMultiMouseDownListener(b,0,4,600,this.onMouseEvent.bind(this,"quadclick")),d.addMouseWheelListener(a.container,this.onMouseWheel.bind(this,"mousewheel"));var c=a.renderer.$gutter;d.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),d.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),d.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),d.addListener(c,"mousemove",this.onMouseMove.bind(this,"gutter"))};(function(){this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(a,b){this.editor._emit(a,new g(b,this.editor))},this.$dragDelay=250,this.setDragDelay=function(a){this.$dragDelay=a},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(a,b){var c=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!c||!c.length)return;this.editor._emit(a,new g(b,this.editor))},this.onMouseWheel=function(a,b){var c=new g(b,this.editor);c.speed=this.$scrollSpeed*2,c.wheelX=b.wheelX,c.wheelY=b.wheelY,this.editor._emit(a,c)}}).call(h.prototype),b.MouseHandler=h}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/event","ace/lib/dom","ace/lib/browser_focus"],function(a,b,c){function k(a){this.editor=a,this.$clickSelection=null,this.browserFocus=new f,a.setDefaultHandler("mousedown",this.onMouseDown.bind(this)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(this)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(this)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(this)),a.setDefaultHandler("mousewheel",this.onScroll.bind(this))}function l(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))}"use strict";var d=a("../lib/event"),e=a("../lib/dom"),f=a("../lib/browser_focus").BrowserFocus,g=0,h=1,i=2,j=5;(function(){this.onMouseDown=function(a){function C(b){a.getShiftKey()?m.selection.selectToPosition(b):n.$clickSelection||(m.moveCursorToPosition(b),m.selection.clearSelection()),q=h}var b=a.inSelection(),c=a.pageX,f=a.pageY,k=a.getDocumentPosition(),m=this.editor,n=this,o=m.getSelectionRange(),p=o.isEmpty(),q=g,r=a.getButton();if(r!==0){p&&(m.moveCursorToPosition(k),m.selection.clearSelection()),r==2&&(m.textInput.onContextMenu({x:a.clientX,y:a.clientY},p),d.capture(m.container,function(){},m.textInput.onContextMenuClose));return}if(b&&(!this.browserFocus.isFocused()||(new Date).getTime()-this.browserFocus.lastFocus<20||!m.isFocused())){m.focus();return}b||C(k);var s=c,t=f,u=(new Date).getTime(),v,w,x,y=function(a){s=d.getDocumentX(a),t=d.getDocumentY(a)},z=function(a){clearInterval(F),q==g?C(k):q==i&&A(a),n.$clickSelection=null,q=g},A=function(a){e.removeCssClass(m.container,"ace_dragging"),m.session.removeMarker(x),m.$mouseHandler.$clickSelection||v||(m.moveCursorToPosition(k),m.selection.clearSelection());if(!v)return;if(w.contains(v.row,v.column)){v=null;return}m.clearSelection();if(a&&(a.ctrlKey||a.altKey))var b=m.session,c=b.insert(v,b.getTextRange(w));else var c=m.moveText(w,v);if(!c){v=null;return}m.selection.setSelectionRange(c)},B=function(){if(q==g){var a=l(c,f,s,t),b=(new Date).getTime();if(a>j){q=h;var d=m.renderer.screenToTextCoordinates(s,t);C(d)}else if(b-u>m.getDragDelay()){q=i,w=m.getSelectionRange();var k=m.getSelectionStyle();x=m.session.addMarker(w,"ace_selection",k),m.clearSelection(),e.addCssClass(m.container,"ace_dragging")}}q==i?E():q==h&&D()},D=function(){var a,b=m.renderer.screenToTextCoordinates(s,t);n.$clickSelection?n.$clickSelection.contains(b.row,b.column)?m.selection.setSelectionRange(n.$clickSelection):(n.$clickSelection.compare(b.row,b.column)==-1?a=n.$clickSelection.end:a=n.$clickSelection.start,m.selection.setSelectionAnchor(a.row,a.column),m.selection.selectToPosition(b)):m.selection.selectToPosition(b),m.renderer.scrollCursorIntoView()},E=function(){v=m.renderer.screenToTextCoordinates(s,t),m.moveCursorToPosition(v)};d.capture(m.container,y,z);var F=setInterval(B,20);return a.preventDefault()},this.onDoubleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectWord(),this.$clickSelection=c.getSelectionRange()},this.onTripleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectLine(),this.$clickSelection=c.getSelectionRange()},this.onQuadClick=function(a){var b=this.editor;b.selectAll(),this.$clickSelection=b.getSelectionRange()},this.onScroll=function(a){var b=this.editor;b.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed);if(b.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed))return a.preventDefault()}}).call(k.prototype),b.DefaultHandlers=k}),define("ace/lib/browser_focus",["require","exports","module","ace/lib/oop","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./oop"),e=a("./event"),f=a("./event_emitter").EventEmitter,g=function(a){a=a||window,this.lastFocus=(new Date).getTime(),this._isFocused=!0;var b=this;"onfocusin"in a.document?(e.addListener(a.document,"focusin",function(a){b._setFocused(!0)}),e.addListener(a.document,"focusout",function(a){b._setFocused(!!a.toElement)})):(e.addListener(a,"blur",function(a){b._setFocused(!1)}),e.addListener(a,"focus",function(a){b._setFocused(!0)}))};(function(){d.implement(this,f),this.isFocused=function(){return this._isFocused},this._setFocused=function(a){if(this._isFocused==a)return;a&&(this.lastFocus=(new Date).getTime()),this._isFocused=a,this._emit("changeFocus")}}).call(g.prototype),b.BrowserFocus=g}),define("ace/lib/event_emitter",["require","exports","module"],function(a,b,c){"use strict";var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var c=this._eventRegistry[a]||[],d=this._defaultHandlers[a];if(!c.length&&!d)return;b=b||{},b.type=a,b.stopPropagation||(b.stopPropagation=function(){this.propagationStopped=!0}),b.preventDefault||(b.preventDefault=function(){this.defaultPrevented=!0});for(var e=0;e=4352&&a<=4447||a>=4515&&a<=4519||a>=4602&&a<=4607||a>=9001&&a<=9002||a>=11904&&a<=11929||a>=11931&&a<=12019||a>=12032&&a<=12245||a>=12272&&a<=12283||a>=12288&&a<=12350||a>=12353&&a<=12438||a>=12441&&a<=12543||a>=12549&&a<=12589||a>=12593&&a<=12686||a>=12688&&a<=12730||a>=12736&&a<=12771||a>=12784&&a<=12830||a>=12832&&a<=12871||a>=12880&&a<=13054||a>=13056&&a<=19903||a>=19968&&a<=42124||a>=42128&&a<=42182||a>=43360&&a<=43388||a>=44032&&a<=55203||a>=55216&&a<=55238||a>=55243&&a<=55291||a>=63744&&a<=64255||a>=65040&&a<=65049||a>=65072&&a<=65106||a>=65108&&a<=65126||a>=65128&&a<=65131||a>=65281&&a<=65376||a>=65504&&a<=65510}e.implement(this,h),this.setDocument=function(a){if(this.doc)throw new Error("Document is already set");this.doc=a,a.on("change",this.onChange.bind(this)),this.on("changeFold",this.onChangeFold.bind(this)),this.bgTokenizer&&(this.bgTokenizer.setDocument(this.getDocument()),this.bgTokenizer.start(0))},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(a==0){this.$rowCache=[];return}var b=this.$rowCache;for(var c=0;c=a){b.splice(c,b.length);return}},this.onChangeFold=function(a){var b=a.data;this.$resetRowCache(b.start.row)},this.onChange=function(a){var b=a.data;this.$modified=!0,this.$resetRowCache(b.range.start.row);var c=this.$updateInternalDataOnChange(a);!this.$fromUndo&&this.$undoManager&&!b.ignore&&(this.$deltasDoc.push(b),c&&c.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:c}),this.$informUndoManager.schedule()),this.bgTokenizer.start(b.range.start.row),this._emit("change",a)},this.setValue=function(a){this.doc.setValue(a),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(a){return this.bgTokenizer.getState(a)},this.getTokens=function(a,b){return this.bgTokenizer.getTokens(a,b)},this.getTokenAt=function(a,b){var c=this.bgTokenizer.getTokens(a,a)[0].tokens,d,e=0;if(b==null)f=c.length-1,e=this.getLine(a).length;else for(var f=0;f=b)break}return d=c[f],d?(d.index=f,d.start=e-d.value.length,d):null},this.setUndoManager=function(a){this.$undoManager=a,this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.$deltasFold.length&&(b.$deltas.push({group:"fold",deltas:b.$deltasFold}),b.$deltasFold=[]),b.$deltasDoc.length&&(b.$deltas.push({group:"doc",deltas:b.$deltasDoc}),b.$deltasDoc=[]),b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]},this.$informUndoManager=f.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?f.stringRepeat(" ",this.getTabSize()):" "},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){if(this.$useSoftTabs===a)return;this.$useSoftTabs=a},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){if(isNaN(a)||this.$tabSize===a)return;this.$modified=!0,this.$tabSize=a,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(a){if(this.$overwrite==a)return;this.$overwrite=a,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=this.doc.getLength()-1)return 0;var c=this.doc.removeLines(a,b);return this.doc.insertLines(a+1,c),1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.doc.insertLines(a,c);var d=b-a+1;return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},this.$clipColumnToRow=function(a,b){return b<0?0:Math.min(this.doc.getLine(a).length,b)},this.$clipPositionToDocument=function(a,b){b=Math.max(0,b);if(a<0)a=0,b=0;else{var c=this.doc.getLength();a>=c?(a=c-1,b=this.doc.getLine(c-1).length):b=Math.min(this.doc.getLine(a).length,b)}return{row:a,column:b}},this.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var b=this.doc.getLength()-1;return a.end.row>b?(a.end.row=b,a.end.column=this.doc.getLine(b).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(a){if(a!=this.$useWrapMode){this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0);if(a){var b=this.getLength();this.$wrapData=[];for(var c=0;c0?(this.$wrapLimit=b,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(a){var b=this.$wrapLimitRange.min;b&&(a=Math.max(b,a));var c=this.$wrapLimitRange.max;return c&&(a=Math.min(c,a)),Math.max(1,a)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(a){var b=this.$useWrapMode,c,d=a.data.action,e=a.data.range.start.row,f=a.data.range.end.row,g=a.data.range.start,h=a.data.range.end,i=null;d.indexOf("Lines")!=-1?(d=="insertLines"?f=e+a.data.lines.length:f=e,c=a.data.lines?a.data.lines.length:f-e):c=f-e;if(c!=0)if(d.indexOf("remove")!=-1){b&&this.$wrapData.splice(e,c);var j=this.$foldData;i=this.getFoldsInRange(a.data.range),this.removeFolds(i);var k=this.getFoldLine(h.row),l=0;if(k){k.addRemoveChars(h.row,h.column,g.column-h.column),k.shiftRow(-c);var m=this.getFoldLine(e);m&&m!==k&&(m.merge(k),k=m),l=j.indexOf(k)+1}for(l;l=h.row&&k.shiftRow(-c)}f=e}else{var n;if(b){n=[e,0];for(var o=0;o=e&&k.shiftRow(c)}}else{c=Math.abs(a.data.range.start.column-a.data.range.end.column),d.indexOf("remove")!=-1&&(i=this.getFoldsInRange(a.data.range),this.removeFolds(i),c=-c);var k=this.getFoldLine(e);k&&k.addRemoveChars(e,g.column,c)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),b&&this.$updateWrapData(e,f),i},this.$updateWrapData=function(a,b){var c=this.doc.getAllLines(),d=this.getTabSize(),e=this.$wrapData,g=this.$wrapLimit,h,j,k=a;b=Math.min(b,c.length-1);while(k<=b){j=this.getFoldLine(k,j);if(!j)h=this.$getDisplayTokens(f.stringTrimRight(c[k])),e[k]=this.$computeWrapSplits(h,g,d),k++;else{h=[],j.walk(function(a,b,d,e){var f;if(a){f=this.$getDisplayTokens(a,h.length),f[0]=i;for(var g=1;g=o)h.pop();e[j.start.row]=this.$computeWrapSplits(h,g,d),k=j.end.row+1}}};var b=1,c=2,i=3,l=4,n=9,o=10,p=11,q=12;this.$computeWrapSplits=function(a,b){function g(b){var d=a.slice(e,b),g=d.length;d.join("").replace(/12/g,function(){g-=1}).replace(/2/g,function(){g-=1}),f+=g,c.push(f),e=b}if(a.length==0)return[];var c=[],d=a.length,e=0,f=0;while(d-e>b){var h=e+b;if(a[h]>=o){while(a[h]>=o)h++;g(h);continue}if(a[h]==i||a[h]==l){for(h;h!=e-1;h--)if(a[h]==i)break;if(h>e){g(h);continue}h=e+b;for(h;hj&&a[h]j&&a[h]==n)h--;if(h>j){g(++h);continue}h=e+b,g(h)}return c},this.$getDisplayTokens=function(a,d){var e=[],f;d=d||0;for(var g=0;g39&&h<48||h>57&&h<64?e.push(n):h>=4352&&r(h)?e.push(b,c):e.push(b)}return e},this.$getStringScreenWidth=function(a,b,c){if(b==0)return[0,0];b==null&&(b=c+a.length*Math.max(this.getTabSize(),2)),c=c||0;var d,e;for(e=0;e=4352&&r(d)?c+=2:c+=1;if(c>b)break}return[c,e]},this.getRowLength=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},this.getRowHeight=function(a,b){return this.getRowLength(b)*a.lineHeight},this.getScreenLastRowColumn=function(a){var b=this.screenToDocumentPosition(a,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},this.getDocumentLastRowColumn=function(a,b){var c=this.documentToScreenRow(a,b);return this.getScreenLastRowColumn(c)},this.getDocumentLastRowColumnPosition=function(a,b){var c=this.documentToScreenRow(a,b);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},this.getRowSplitData=function(a){return this.$useWrapMode?this.$wrapData[a]:undefined},this.getScreenTabSize=function(a){return this.$tabSize-a%this.$tabSize},this.screenToDocumentRow=function(a,b){return this.screenToDocumentPosition(a,b).row},this.screenToDocumentColumn=function(a,b){return this.screenToDocumentPosition(a,b).column},this.screenToDocumentPosition=function(a,b){if(a<0)return{row:0,column:0};var c,d=0,e=0,f,g=0,h=0,i=this.$rowCache;for(var j=0;j=a||d>=l)break;g+=h,d++,d>n&&(d=m.end.row+1,m=this.getNextFoldLine(d,m),n=m?m.start.row:Infinity),k&&i.push({docRow:d,screenRow:g})}if(m&&m.start.row<=d)c=this.getFoldDisplayLine(m),d=m.start.row;else{if(g+h<=a||d>l)return{row:l,column:this.getLine(l).length};c=this.getLine(d),m=null}if(this.$useWrapMode){var o=this.$wrapData[d];o&&(f=o[a-g],a>g&&o.length&&(e=o[a-g-1]||o[o.length-1],c=c.substring(e)))}return e+=this.$getStringScreenWidth(c,b)[1],this.$useWrapMode&&e>=f&&(e=f-1),m?m.idxToPosition(e):{row:d,column:e}},this.documentToScreenPosition=function(a,b){if(typeof b=="undefined")var c=this.$clipPositionToDocument(a.row,a.column);else c=this.$clipPositionToDocument(a,b);a=c.row,b=c.column;var d;if(this.$useWrapMode){d=this.$wrapData;if(a>d.length-1)return{row:this.getScreenLength(),column:d.length==0?0:d[d.length-1].length-1}}var e=0,f=null,g=null;g=this.getFoldAt(a,b,1),g&&(a=g.start.row,b=g.start.column);var h,i=0,j=this.$rowCache;for(var k=0;k=n){h=m.end.row+1;if(h>a)break;m=this.getNextFoldLine(h,m),n=m?m.start.row:Infinity}else h=i+1;e+=this.getRowLength(i),i=h,l&&j.push({docRow:i,screenRow:e})}var o="";m&&i>=n?(o=this.getFoldDisplayLine(m,a,b),f=m.start.row):(o=this.getLine(a).substring(0,b),f=a);if(this.$useWrapMode){var p=d[f],q=0;while(o.length>=p[q])e++,q++;o=o.substring(p[q-1]||0,o.length)}return{row:e,column:this.$getStringScreenWidth(o)[0]}},this.documentToScreenColumn=function(a,b){return this.documentToScreenPosition(a,b).column},this.documentToScreenRow=function(a,b){return this.documentToScreenPosition(a,b).row},this.getScreenLength=function(){var a=0,b=null;if(!this.$useWrapMode){a=this.getLength();var c=this.$foldData;for(var d=0;dg&&(f=b.end.row+1,b=this.$foldData[d++],g=b?b.start.row:Infinity)}return a}}).call(n.prototype),a("./edit_session/folding").Folding.call(n.prototype),a("./edit_session/bracket_match").BracketMatch.call(n.prototype),b.EditSession=n}),define("ace/config",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}"no use strict";var d=a("./lib/lang"),e=function(){return this}(),f={packaged:!1,workerPath:"",modePath:"",themePath:"",suffix:".js"};b.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);return f[a]},b.set=function(a,b){if(!f.hasOwnProperty(a))throw new Error("Unknown confik key: "+a);f[a]=b},b.all=function(){return d.copyObject(f)},b.init=function(){f.packaged=a.packaged||c.packaged||e.define&&define.packaged;if(!e.document)return"";var d={},h="",i,j=document.getElementsByTagName("script");for(var k=0;kb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor,b=this.selectionLead;return this.isEmpty()?g.fromPoints(b,b):this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.moveCursorTo(0,0)},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column)),this.$desiredColumn=null},this.$moveSelection=function(a){var b=this.selectionLead;this.$isEmpty&&this.setSelectionAnchor(b.row,b.column),a.call(this)},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(a,b){if(typeof b=="undefined"){var c=a||this.selectionLead;a=c.row,b=c.column}return this.session.getWordRange(a,b)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var a=this.getCursor(),b=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(b)},this.getLineRange=function(a,b){var c=typeof a=="number"?a:this.selectionLead.row,d,e=this.session.getFoldLine(c);return e?(c=e.start.row,d=e.end.row):d=c,b?new g(c,0,d,this.session.getLine(d).length):new g(c,0,d+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(b.start.row,b.start.column);else if(a.column==0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var c=this.session.getTabSize();this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(a.column-c,a.column).split(" ").length-1==c?this.moveCursorBy(0,-c):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(b.end.row,b.end.column);else if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=c.length){this.moveCursorTo(a,c.length),this.moveCursorRight(),a0&&this.moveCursorWordLeft();return}if(g=this.session.tokenRe.exec(f))b-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(a,b)},this.$shortWordEndIndex=function(a){var b,c=0,d,e=/\s/,f=this.session.tokenRe;f.lastIndex=0;if(b=this.session.tokenRe.exec(a))c=this.session.tokenRe.lastIndex;else{while((d=a[c])&&e.test(d))c++;if(c<=1){f.lastIndex=0;while((d=a[c])&&!f.test(d)){f.lastIndex=0,c++;if(e.test(d)){if(c>2){c--;break}while((d=a[c])&&e.test(d))c++;if(c>2)break}}}}return f.lastIndex=0,c},this.moveCursorShortWordRight=function(){var a=this.selectionLead.row,b=this.selectionLead.column,c=this.doc.getLine(a),d=c.substring(b),e=this.session.getFoldAt(a,b,1);if(e)return this.moveCursorTo(e.end.row,e.end.column);if(b==c.length)return this.moveCursorRight();var f=this.$shortWordEndIndex(d);this.moveCursorTo(a,b+f)},this.moveCursorShortWordLeft=function(){var a=this.selectionLead.row,b=this.selectionLead.column,c;if(c=this.session.getFoldAt(a,b,-1))return this.moveCursorTo(c.start.row,c.start.column);if(b==0)return this.moveCursorLeft();var d=this.session.getLine(a).substring(0,b),f=e.stringReverse(d),g=this.$shortWordEndIndex(f);return this.moveCursorTo(a,b-g)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(a,b){var c=this.session.documentToScreenPosition(this.selectionLead.row,this.selectionLead.column);b===0&&(this.$desiredColumn?c.column=this.$desiredColumn:this.$desiredColumn=c.column);var d=this.session.screenToDocumentPosition(c.row+a,c.column);this.moveCursorTo(d.row,d.column+b,b===0)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b,c){var d=this.session.getFoldAt(a,b,1);d&&(a=d.start.row,b=d.start.column),this.$keepDesiredColumnOnChange=!0,this.selectionLead.setPosition(a,b),this.$keepDesiredColumnOnChange=!1,c||(this.$desiredColumn=null)},this.moveCursorToScreen=function(a,b,c){var d=this.session.screenToDocumentPosition(a,b);this.moveCursorTo(d.row,d.column,c)},this.detach=function(){this.selectionLead.detach(),this.selectionAnchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(a){var b=this.getRange();return a?(a.start.column=b.start.column,a.start.row=b.start.row,a.end.column=b.end.column,a.end.row=b.end.row):a=b,a.cursor=this.isBackwards()?a.start:a.end,a.desiredColumn=this.$desiredColumn,a}}).call(h.prototype),b.Selection=h}),define("ace/range",["require","exports","module"],function(a,b,c){"use strict";var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.isEqual=function(a){return this.start.row==a.start.row&&this.end.row==a.end.row&&this.start.column==a.start.column&&this.end.column==a.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;return b=this.compare(c.row,c.column),b==1?(b=this.compare(d.row,d.column),b==1?2:b==0?1:0):b==-1?-2:(b=this.compare(d.row,d.column),b==-1?-1:b==1?42:0)},this.comparePoint=function(a){return this.compare(a.row,a.column)},this.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},this.intersects=function(a){var b=this.compareRange(a);return b==-1||b==0||b==1},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)||this.isStart(a,b)?!1:!0:!1},this.insideStart=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)?!1:!0:!1},this.insideEnd=function(a,b){return this.compare(a,b)==0?this.isStart(a,b)?!1:!0:!1},this.compare=function(a,b){return!this.isMultiLine()&&a===this.start.row?bthis.end.column?1:0:athis.end.row?1:this.start.row===a?b>=this.start.column?0:-1:this.end.row===a?b<=this.end.column?0:1:0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0&&/^[\w\d]/.test(h)||e<=g&&/[\w\d]$/.test(h))return;h=f.substring(c.start.column,c.end.column);if(!/^[\w\d]+$/.test(h))return;var i=a.getCursorPosition(),j={wrap:!0,wholeWord:!0,caseSensitive:!0,needle:h},k=a.$search.getOptions();a.$search.set(j);var l=a.$search.findAll(b);l.forEach(function(a){if(!a.contains(i.row,i.column)){var c=b.addMarker(a,"ace_selected_word","text");b.$selectionOccurrences.push(c)}}),a.$search.set(k)},this.clearSelectionHighlight=function(a){if(!a.session.$selectionOccurrences)return;a.session.$selectionOccurrences.forEach(function(b){a.session.removeMarker(b)}),a.session.$selectionOccurrences=[]},this.createModeDelegates=function(a){if(!this.$embeds)return;this.$modes={};for(var b=0;b1&&e[i].token.length!==j-1)throw new Error("Matching groups and length of the token array don't match in rule #"+i+" of state "+c);h[g]={rule:i,len:j},g+=j,f.push(k)}this.regExps[c]=new RegExp("(?:("+f.join(")|(")+")|(.))",b)}};(function(){this.getLineTokens=function(a,b){var c=b,d=this.rules[c],e=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;var g,h=[],i=0,j={type:null,value:""};while(g=f.exec(a)){var k="text",l=null,m=[g[0]];for(var n=0;n1&&(m=g.slice(n+2,n+1+e[n].len)),typeof l.token=="function"?k=l.token.apply(this,m):k=l.token,l.next&&(c=l.next,d=this.rules[c],e=this.matchMappings[c],i=f.lastIndex,f=this.regExps[c],f.lastIndex=i);break}if(m[0]){typeof k=="string"&&(m=[m.join("")],k=[k]);for(var n=0;n=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length),a},this.insert=function(a,b){if(!b||b.length===0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];return a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c);var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};return this._emit("change",{data:e}),d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};return this._emit("change",{data:d}),c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};return this._emit("change",{data:e}),d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);return a.start},this.removeInLine=function(a,b,c){if(b==c)return;var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};return this._emit("change",{data:i}),d.start},this.removeLines=function(a,b){var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};return this._emit("change",{data:e}),d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._emit("change",{data:g})},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}}).call(h.prototype),b.Document=h}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=b.Anchor=function(a,b,c){this.document=a,typeof c=="undefined"?this.setPosition(b.row,b.column):this.setPosition(b,c),this.$onChange=this.onChange.bind(this),a.on("change",this.$onChange)};(function(){d.implement(this,e),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&c.start.row!=this.row)return;if(c.start.row>this.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0),c}}).call(f.prototype)}),define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(!c.running)return;var a=new Date,b=c.currentLine,d=c.doc,e=0,f=d.getLength();while(c.currentLine20){c.fireUpdateEvent(b,c.currentLine-1),c.running=setTimeout(c.$worker,20);return}}c.running=!1,c.fireUpdateEvent(b,f-1)}};(function(){d.implement(this,e),this.setTokenizer=function(a){this.tokenizer=a,this.lines=[],this.start(0)},this.setDocument=function(a){this.doc=a,this.lines=[],this.stop()},this.fireUpdateEvent=function(a,b){var c={first:a,last:b};this._emit("update",{data:c})},this.start=function(a){this.currentLine=Math.min(a||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(a,b){return this.$tokenizeRows(a,b)},this.getState=function(a){return this.$tokenizeRows(a,a)[0].state},this.$tokenizeRows=function(a,b){if(!this.doc||isNaN(a)||isNaN(b))return[{state:"start",tokens:[]}];var c=[],d="start",e=!1;a>0&&this.lines[a-1]?(d=this.lines[a-1].state,e=!0):a==0?(d="start",e=!0):this.lines.length>0&&(d=this.lines[this.lines.length-1].state);var f=this.doc.getLines(a,b);for(var g=a;g<=b;g++)if(!this.lines[g]){var h=this.tokenizer.getLineTokens(f[g-a]||"",d),d=h.state;c.push(h),e&&(this.lines[g]=h)}else{var h=this.lines[g];d=h.state,c.push(h)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(a,b,c){function h(){this.getFoldAt=function(a,b,c){var d=this.getFoldLine(a);if(!d)return null;var e=d.folds;for(var f=0;f=a)return e;if(e.end.row>a)return null}return null},this.getNextFoldLine=function(a,b){var c=this.$foldData,d=0;b&&(d=c.indexOf(b)),d==-1&&(d=0);for(d;d=a)return e}return null},this.getFoldedRowCount=function(a,b){var c=this.$foldData,d=b-a+1;for(var e=0;e=b){h=a?d-=b-h:d=0);break}g>=a&&(h>=a?d-=g-h:d-=g-a+1)}return d},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(a,b){return a.start.row-b.start.row}),a},this.addFold=function(a,b){var c=this.$foldData,d=!1,g;a instanceof f?g=a:g=new f(b,a),this.$clipRangeToDocument(g.range);var h=g.start.row,i=g.start.column,j=g.end.row,k=g.end.column;if(g.placeholder.length<2)throw"Placeholder has to be at least 2 characters";if(h==j&&k-i<2)throw"The range has to be at least 2 characters width";var l=this.getFoldAt(h,i,1),m=this.getFoldAt(j,k,-1);if(l&&m==l)return l.addSubFold(g);if(l&&!l.range.isStart(h,i)||m&&!m.range.isEnd(j,k))throw"A fold can't intersect already existing fold"+g.range+l.range;var n=this.getFoldsInRange(g.range);n.length>0&&(this.removeFolds(n),g.subFolds=n);for(var o=0;othis.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(a),this.folds.sort(function(a,b){return-a.range.compareEnd(b.start.row,b.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else{if(a.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column}a.foldLine=this},this.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},this.walk=function(a,b,c){var d=0,e=this.folds,f,g,h,i=!0;b==null&&(b=this.end.row,c=this.end.column);for(var j=0;j=this.$rowTokens.length){this.$row+=1;if(this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row,this.$row)[0].tokens,this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,b=this.$tokenIndex,c=a[b].start;if(c!==undefined)return c;c=0;while(b>0)b-=1,c+=a[b].value.length;return c}}).call(d.prototype),b.TokenIterator=d}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator"],function(a,b,c){function e(){this.findMatchingBracket=function(a){if(a.column==0)return null;var b=this.getLine(a.row).charAt(a.column-1);if(b=="")return null;var c=b.match(/([\(\[\{])|([\)\]\}])/);return c?c[1]?this.$findClosingBracket(c[1],a):this.$findOpeningBracket(c[2],a):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("rparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn()-2,j=g.value;for(;;){while(i>=0){var k=j.charAt(i);if(k==c){e-=1;if(e==0)return{row:f.getCurrentTokenRow(),column:i+f.getCurrentTokenColumn()}}else k==a&&(e+=1);i-=1}do g=f.stepBackward();while(g&&!h.test(g.type));if(g==null)break;j=g.value,i=j.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("lparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn();for(;;){var j=g.value,k=j.length;while(i=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function k(e){var f=a.getLine(e);return b&&e==c.end.row&&(f=f.substring(0,c.end.column)),j&&e==d.row&&(f=f.substring(0,d.column)),f}var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"start":"end"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap,j=!1;return{forEach:function(a){var b=d.row,c=k(b),g=d.column,l=!1;j=!1;while(!a(c,g,b)){if(l)return;b++,g=0;if(b>h){if(!i)return;b=e,g=f,j=!0}b==d.row&&(l=!0),c=k(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"end":"start"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1,n=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(j0},this.hasRedo=function(){return this.$redoStack.length>0}}).call(d.prototype),b.UndoManager=d}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/config","ace/lib/net","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter","text!ace/css/editor.css"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/useragent"),h=a("./config"),i=a("./lib/net"),j=a("./layer/gutter").Gutter,k=a("./layer/marker").Marker,l=a("./layer/text").Text,m=a("./layer/cursor").Cursor,n=a("./scrollbar").ScrollBar,o=a("./renderloop").RenderLoop,p=a("./lib/event_emitter").EventEmitter,q=a("text!./css/editor.css");e.importCssString(q,"ace_editor");var r=function(a,b){var c=this;this.container=a,e.addCssClass(a,"ace_editor"),this.setTheme(b),this.$gutter=e.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=e.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=e.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new j(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onResize.bind(this,!0)),this.setFadeFoldWidgets(!0),this.$markerBack=new k(this.content);var d=this.$textLayer=new l(this.content);this.canvas=d.element,this.$markerFront=new k(this.content),this.characterWidth=d.getCharacterWidth(),this.lineHeight=d.getLineHeight(),this.$cursorLayer=new m(this.content),this.$cursorPadding=8,this.$horizScroll=!1,this.$horizScrollAlwaysVisible=!1,this.$animatedScroll=!1,this.scrollBar=new n(a),this.scrollBar.addEventListener("scroll",function(a){c.$inScrollAnimation||c.session.setScrollTop(a.data)}),this.scrollTop=0,this.scrollLeft=0,f.addListener(this.scroller,"scroll",function(){var a=c.scroller.scrollLeft;c.scrollLeft=a,c.session.setScrollLeft(a),c.scroller.className=a==0?"ace_scroller":"ace_scroller horscroll"}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){c.characterWidth=d.getCharacterWidth(),c.lineHeight=d.getLineHeight(),c.$updatePrintMargin(),c.onResize(!0),c.$loop.schedule(c.CHANGE_FULL)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.setPadding(4),this.$updatePrintMargin()};(function(){this.showGutter=!0,this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,d.implement(this,p),this.setSession=function(a){this.session=a,this.scroller.className="ace_scroller",this.$cursorLayer.setSession(a),this.$markerBack.setSession(a),this.$markerFront.setSession(a),this.$gutterLayer.setSession(a),this.$textLayer.setSession(a),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(a,b){b===undefined&&(b=Infinity),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)return;if(be?(b&&(e-=b*this.$size.scrollerHeight),this.session.setScrollTop(e)):this.scrollTop+this.$size.scrollerHeightd?(d0)return!0;if(b>0&&this.session.getScrollTop()+this.$size.scrollerHeighth&&(e=g.end.row+1,g=this.session.getNextFoldLine(e,g),h=g?g.start.row:Infinity);if(e>f)break;var j=this.$annotations[e]||b;c.push("
",e+1);if(i){var k=i[e];k==null&&(k=i[e]=this.session.getFoldWidget(e)),k&&c.push("")}var l=this.session.getRowLength(e)-1;while(l--)c.push("
¦");c.push("
"),e++}this.element=d.setInnerHtml(this.element,c.join("")),this.element.style.height=a.minHeight+"px";var m=this.element.offsetWidth;m!==this.gutterWidth&&(this.gutterWidth=m,this._emit("changeGutterWidth",m))},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(a){a?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=a},this.getShowFoldWidgets=function(){return this.$showFoldWidgets}}).call(g.prototype),b.Gutter=g}),define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../range").Range,e=a("../lib/dom"),f=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.update=function(a){var a=a||this.config;if(!a)return;this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c],f=d.range.clipRows(a.firstRow,a.lastRow);if(f.isEmpty())continue;f=f.toScreenRange(this.session);if(d.renderer){var g=this.$getTop(f.start.row,a),h=Math.round(this.$padding+f.start.column*a.characterWidth);d.renderer(b,f,h,g,a)}else f.isMultiLine()?d.type=="text"?this.drawTextMarker(b,f,d.clazz,a):this.drawMultiLineMarker(b,f,d.clazz,a,d.type):this.drawSingleLineMarker(b,f,d.clazz+" start",a,null,d.type)}this.element=e.setInnerHtml(this.element,b.join(""))},this.$getTop=function(a,b){return(a-b.firstRowScreen)*b.lineHeight},this.drawTextMarker=function(a,b,c,e){var f=b.start.row,g=new d(f,b.start.column,f,this.session.getScreenLastRowColumn(f));this.drawSingleLineMarker(a,g,c+" start",e,1,"text"),f=b.end.row,g=new d(f,0,f,b.end.column),this.drawSingleLineMarker(a,g,c,e,0,"text");for(f=b.start.row+1;f"),j=this.$getTop(b.end.row,d),i=Math.round(b.end.column*d.characterWidth),a.push("
"),h=(b.end.row-b.start.row-1)*d.lineHeight;if(h<0)return;j=this.$getTop(b.start.row+1,d),a.push("
")},this.drawSingleLineMarker=function(a,b,c,d,e,f){var g=f==="background"?0:this.$padding,h=d.lineHeight;if(f==="background")var i=d.width;else i=Math.round((b.end.column+(e||0)-b.start.column)*d.characterWidth);var j=this.$getTop(b.start.row,d),k=Math.round(g+b.start.column*d.characterWidth);a.push("
")}}).call(f.prototype),b.Marker=f}),define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/dom"),f=a("../lib/lang"),g=a("../lib/useragent"),h=a("../lib/event_emitter").EventEmitter,i=function(a){this.element=e.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes()||{width:0,height:0},this.$pollSizeChanges()};(function(){d.implement(this,h),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.$padding=0,this.setPadding=function(a){this.$padding=a,this.element.style.padding="0 "+a+"px"},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.checkForSizeChanges=function(){var a=this.$measureSizes();a&&(this.$characterSize.width!==a.width||this.$characterSize.height!==a.height)&&(this.$characterSize=a,this._emit("changeCharacterSize",{data:a}))},this.$pollSizeChanges=function(){var a=this;this.$pollSizeChangesTimer=setInterval(function(){a.checkForSizeChanges()},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=g.isIE||g.isOldGecko?function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=e.createElement("div"),c=b.style;c.width=c.height="auto",c.left=c.top=-a*40+"px",c.visibility="hidden",c.position="fixed",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a);if(this.element.ownerDocument.body)this.element.ownerDocument.body.appendChild(b);else{var d=this.element.parentNode;while(!e.hasCssClass(d,"ace_editor"))d=d.parentNode;d.appendChild(b)}}if(!this.element.offsetWidth)return null;var c=this.$measureNode.style,g=e.computedStyle(this.element);for(var h in this.$fontStyles)c[h]=g[h];var i={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return i.width==0||i.height==0?null:i}:function(){if(!this.$measureNode){var a=this.$measureNode=e.createElement("div"),b=a.style;b.width=b.height="auto",b.left=b.top="-100px",b.visibility="hidden",b.position="fixed",b.overflow="visible",b.whiteSpace="nowrap",a.innerHTML="X";var c=this.element.parentNode;while(c&&!e.hasCssClass(c,"ace_editor"))c=c.parentNode;if(!c)return this.$measureNode=null;c.appendChild(a)}var d=this.$measureNode.getBoundingClientRect(),f={height:d.height,width:d.width};return f.width==0||f.height==0?null:f},this.setSession=function(a){this.session=a},this.showInvisibles=!1,this.setShowInvisibles=function(a){return this.showInvisibles==a?!1:(this.showInvisibles=a,!0)},this.$tabStrings=[],this.$computeTabString=function(){var a=this.session.getTabSize(),b=this.$tabStrings=[0];for(var c=1;c"+this.TAB_CHAR+(new Array(c)).join(" ")+"
"):b.push((new Array(c+1)).join(" "))},this.updateLines=function(a,b,c){this.$computeTabString(),(this.config.lastRow!=a.lastRow||this.config.firstRow!=a.firstRow)&&this.scrollLines(a),this.config=a;var d=Math.max(b,a.firstRow),f=Math.min(c,a.lastRow),g=this.element.childNodes,h=0;for(var i=a.firstRow;i0;d--)c.removeChild(c.firstChild);if(b.lastRow>a.lastRow)for(var d=this.session.getFoldedRowCount(a.lastRow+1,b.lastRow);d>0;d--)c.removeChild(c.lastChild);if(a.firstRowb.lastRow){var e=this.$renderLinesFragment(a,b.lastRow+1,a.lastRow);c.appendChild(e)}},this.$renderLinesFragment=function(a,b,c){var d=this.element.ownerDocument.createDocumentFragment(),f=b,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>c)break;var i=e.createElement("div"),j=[],k=this.session.getTokens(f,f);k.length==1&&this.$renderLine(j,f,k[0].tokens,!1),i.innerHTML=j.join("");if(this.$useLineGroups())i.className="ace_line_group",d.appendChild(i);else{var l=i.childNodes;while(l.length)d.appendChild(l[0])}f++}return d},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=a.firstRow,d=a.lastRow,f=c,g=this.session.getNextFoldLine(f),h=g?g.start.row:Infinity;for(;;){f>h&&(f=g.end.row+1,g=this.session.getNextFoldLine(f,g),h=g?g.start.row:Infinity);if(f>d)break;this.$useLineGroups()&&b.push("
");var i=this.session.getTokens(f,f);i.length==1&&this.$renderLine(b,f,i[0].tokens,!1),this.$useLineGroups()&&b.push("
"),f++}this.element=e.setInnerHtml(this.element,b.join(""))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(a,b,c,d){var e=this,f=/\t|&|<|( +)|([\u0000-\u0019\u00a0\u2000-\u200b\u2028\u2029\u3000])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,h=function(a,c,d,f,h){if(c)return(new Array(a.length+1)).join(" ");if(a=="&")return g.isOldGecko?"&":"&";if(a=="<")return"<";if(a==" "){var i=e.session.getScreenTabSize(b+f);return b+=i-1,e.$tabStrings[i]}if(a==" "){var j=e.showInvisibles?"ace_cjk ace_invisible":"ace_cjk",k=e.showInvisibles?e.SPACE_CHAR:"";return b+=1,""+k+""}return d?e.showInvisibles?""+e.SPACE_CHAR+"":" ":(b+=1,""+a+"")},i=d.replace(f,h);if(!this.$textToken[c.type]){var j="ace_"+c.type.replace(/\./g," ace_"),k="";c.type=="fold"&&(k=" style='width:"+c.value.length*this.config.characterWidth+"px;' "),a.push("",i,"")}else a.push(i);return b+d.length},this.$renderLineCore=function(a,b,c,d,e){var f=0,g=0,h,i=0,j=this;!d||d.length==0?h=Number.MAX_VALUE:h=d[0],e||a.push("
");for(var k=0;k=h)i=j.$renderToken(a,i,l,m.substring(0,h-f)),m=m.substring(h-f),f=h,e||a.push("
","
"),g++,i=0,h=d[g]||Number.MAX_VALUE;m.length!=0&&(f+=m.length,i=j.$renderToken(a,i,l,m))}}this.showInvisibles&&(b!==this.session.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+"")),e||a.push("
")},this.$renderLine=function(a,b,c,d){if(!this.session.isRowFolded(b)){var e=this.session.getRowSplitData(b);this.$renderLineCore(a,b,c,e,d)}else this.$renderFoldLine(a,b,c,d)},this.$renderFoldLine=function(a,b,c,d){function h(a,b,c){var d=0,e=0;while(e+a[d].value.lengthc-b&&(f=f.substring(0,c-b)),g.push({type:a[d].type,value:f}),e=b+f.length,d+=1}while(ec&&(f=f.substring(0,c-e)),g.push({type:a[d].type,value:f}),e+=f.length,d+=1}}var e=this.session,f=e.getFoldLine(b),g=[];f.walk(function(a,b,d,e,f){a?g.push({type:"fold",value:a}):(f&&(c=this.session.getTokens(b,b)[0].tokens),c.length!=0&&h(c,e,d))}.bind(this),f.end.row,this.session.getLine(f.end.row).length);var i=this.session.$useWrapMode?this.session.$wrapData[b]:null;this.$renderLineCore(a,b,g,i,d)},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(i.prototype),b.Text=i}),define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(a,b,c){"use strict";var d=a("../lib/dom"),e=function(a){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.cursors=[],this.cursor=this.addCursor()};(function(){this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.addCursor=function(){var a=d.createElement("div"),b="ace_cursor";return this.isVisible||(b+=" ace_hidden"),this.overwrite&&(b+=" ace_overwrite"),a.className=b,this.element.appendChild(a),this.cursors.push(a),a},this.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},this.hideCursor=function(){this.isVisible=!1;for(var a=this.cursors.length;a--;)d.addCssClass(this.cursors[a],"ace_hidden");clearInterval(this.blinkId)},this.showCursor=function(){this.isVisible=!0;for(var a=this.cursors.length;a--;)d.removeCssClass(this.cursors[a],"ace_hidden");this.element.style.visibility="",this.restartTimer()},this.restartTimer=function(){clearInterval(this.blinkId);if(!this.isVisible)return;var a=this.cursors.length==1?this.cursor:this.element;this.blinkId=setInterval(function(){a.style.visibility="hidden",setTimeout(function(){a.style.visibility=""},400)},1e3)},this.getPixelPosition=function(a,b){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var c=this.session.documentToScreenPosition(a),d=Math.round(this.$padding+c.column*this.config.characterWidth),e=(c.row-(b?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:d,top:e}},this.update=function(a){this.config=a;if(this.session.selectionMarkerCount>0){var b=this.session.$selectionMarkers,c=0,d,e=0;for(var c=b.length;c--;){d=b[c];var f=this.getPixelPosition(d.cursor,!0),g=(this.cursors[e++]||this.addCursor()).style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px"}if(e>1)while(this.cursors.length>e)this.removeCursor()}else{var f=this.getPixelPosition(null,!0),g=this.cursor.style;g.left=f.left+"px",g.top=f.top+"px",g.width=a.characterWidth+"px",g.height=a.lineHeight+"px";while(this.cursors.length>1)this.removeCursor()}var h=this.session.getOverwrite();h!=this.overwrite&&this.$setOverite(h),this.restartTimer()},this.$setOverite=function(a){this.overwrite=a;for(var b=this.cursors.length;b--;)a?d.addCssClass(this.cursors[b],"ace_overwrite"):d.removeCssClass(this.cursors[b],"ace_overwrite")},this.destroy=function(){clearInterval(this.blinkId)}}).call(e.prototype),b.Cursor=e}),define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/event_emitter").EventEmitter,h=function(a){this.element=e.createElement("div"),this.element.className="ace_sb",this.inner=e.createElement("div"),this.element.appendChild(this.inner),a.appendChild(this.element),this.width=e.scrollbarWidth(a.ownerDocument),this.element.style.width=(this.width||15)+5+"px",f.addListener(this.element,"scroll",this.onScroll.bind(this))};(function(){d.implement(this,g),this.onScroll=function(){this._emit("scroll",{data:this.element.scrollTop})},this.getWidth=function(){return this.width},this.setHeight=function(a){this.element.style.height=a+"px"},this.setInnerHeight=function(a){this.inner.style.height=a+"px"},this.setScrollTop=function(a){this.element.scrollTop=a}}).call(h.prototype),b.ScrollBar=h}),define("ace/renderloop",["require","exports","module","ace/lib/event"],function(a,b,c){"use strict";var d=a("./lib/event"),e=function(a,b){this.onRender=a,this.pending=!1,this.changes=0,this.window=b||window};(function(){this.schedule=function(a){this.changes=this.changes|a;if(!this.pending){this.pending=!0;var b=this;d.nextTick(function(){b.pending=!1;var a;while(a=b.changes)b.changes=0,b.onRender(a)},this.window)}}}).call(e.prototype),b.RenderLoop=e}),define("text!ace/css/editor.css",[],"\n.ace_editor {\n position: absolute;\n overflow: hidden;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace;\n font-size: 12px;\n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n cursor: text;\n}\n\n.ace_composition {\n position: absolute;\n background: #555;\n color: #DDD;\n z-index: 4;\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n height: 100%;\n width: auto;\n cursor: default;\n z-index: 1000;\n}\n\n.ace_gutter.horscroll {\n box-shadow: 0px 0px 20px rgba(0,0,0,0.4);\n}\n\n.ace_gutter-cell {\n padding-left: 19px;\n padding-right: 6px;\n}\n\n.ace_gutter-cell.ace_error {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%F5or%F5%87%88%F5nr%F4ns%EBmq%F5z%7F%DDJT%DEKS%DFOW%F1Yc%F2ah%CE(7%CE)8%D18E%DD%40M%F2KZ%EBU%60%F4%60m%DCir%C8%16(%C8%19*%CE%255%F1%3FR%F1%3FS%E6%AB%B5%CA%5DI%CEn%5E%F7%A2%9A%C9G%3E%E0a%5B%F7%89%85%F5yy%F6%82%80%ED%82%80%FF%BF%BF%E3%C4%C4%FF%FF%FF%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%25%00%2C%00%00%00%00%10%00%10%00%00%06p%C0%92pH%2C%1A%8F%C8%D2H%93%E1d4%23%E4%88%D3%09mB%1DN%B48%F5%90%40%60%92G%5B%94%20%3E%22%D2%87%24%FA%20%24%C5%06A%00%20%B1%07%02B%A38%89X.v%17%82%11%13q%10%0Fi%24%0F%8B%10%7BD%12%0Ei%09%92%09%0EpD%18%15%24%0A%9Ci%05%0C%18F%18%0B%07%04%01%04%06%A0H%18%12%0D%14%0D%12%A1I%B3%B4%B5IA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning {\n background-image: url(\"data:image/gif,GIF89a%10%00%10%00%D5%00%00%FF%DBr%FF%DE%81%FF%E2%8D%FF%E2%8F%FF%E4%96%FF%E3%97%FF%E5%9D%FF%E6%9E%FF%EE%C1%FF%C8Z%FF%CDk%FF%D0s%FF%D4%81%FF%D5%82%FF%D5%83%FF%DC%97%FF%DE%9D%FF%E7%B8%FF%CCl%7BQ%13%80U%15%82W%16%81U%16%89%5B%18%87%5B%18%8C%5E%1A%94d%1D%C5%83-%C9%87%2F%C6%84.%C6%85.%CD%8B2%C9%871%CB%8A3%CD%8B5%DC%98%3F%DF%9BB%E0%9CC%E1%A5U%CB%871%CF%8B5%D1%8D6%DB%97%40%DF%9AB%DD%99B%E3%B0p%E7%CC%AE%FF%FF%FF%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00!%F9%04%01%00%00%2F%00%2C%00%00%00%00%10%00%10%00%00%06a%C0%97pH%2C%1A%8FH%A1%ABTr%25%87%2B%04%82%F4%7C%B9X%91%08%CB%99%1C!%26%13%84*iJ9(%15G%CA%84%14%01%1A%97%0C%03%80%3A%9A%3E%81%84%3E%11%08%B1%8B%20%02%12%0F%18%1A%0F%0A%03'F%1C%04%0B%10%16%18%10%0B%05%1CF%1D-%06%07%9A%9A-%1EG%1B%A0%A1%A0U%A4%A5%A6BA%00%3B\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info {\n background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0;\n}\n\n.ace_editor .ace_print_margin_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden;\n margin: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n.ace_editor .ace_print_margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_editor textarea {\n position: fixed;\n z-index: 0;\n width: 10px;\n height: 30px;\n opacity: 0;\n background: transparent;\n appearance: none;\n -moz-appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n white-space: nowrap;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter .ace_layer {\n position: relative;\n min-width: 40px;\n text-align: right;\n pointer-events: auto;\n}\n\n.ace_text-layer {\n color: black;\n font: inherit !important;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n}\n\n.ace_cursor.ace_hidden {\n opacity: 0.2;\n}\n\n.ace_editor.multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected_word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n \n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n border-radius: 2px;\n \n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image: \n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n}\n\n.ace_dragging .ace_content {\n cursor: move;\n}\n\n.ace_folding-enabled > .ace_gutter-cell {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n\n margin: 0 -12px 1px 1px;\n display: inline-block;\n height: 14px;\n width: 11px;\n vertical-align: text-bottom;\n \n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\n background-repeat: no-repeat;\n background-position: center 5px;\n\n border-radius: 3px;\n}\n\n.ace_fold-widget.end {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget.closed {\n background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255, 0.7);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n background-position: center 4px;\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n -moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n -webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n box-shadow:inset 0 1px 1px rgba(255, 255, 255);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n\n.ace_fold-widget.invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n -moz-transition: 0.5s opacity;\n -webkit-transition: 0.5s opacity;\n -o-transition: 0.5s opacity;\n -ms-transition: 0.5s opacity;\n transition: 0.5s opacity;\n opacity: 0;\n}\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n -moz-transition-duration: 0.05s;\n -webkit-transition-duration: 0.05s;\n -o-transition-duration: 0.05s;\n -ms-transition-duration: 0.05s;\n transition-duration: 0.05s;\n -moz-transition-delay: 0.2s;\n -webkit-transition-delay: 0.2s;\n -o-transition-delay: 0.2s;\n -ms-transition-delay: 0.2s;\n transition-delay: 0.2s; \n opacity:1;\n}\n"),define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor"],function(a,b,c){function k(a,b,c){return j.$options.wrap=!0,j.$options.needle=b,j.$options.backwards=c==-1,j.find(a)}function n(a,b){return a.row==b.row&&a.column==b.column}function o(a){a.$onAddRange=a.$onAddRange.bind(a),a.$onRemoveRange=a.$onRemoveRange.bind(a),a.$onMultiSelect=a.$onMultiSelect.bind(a),a.$onSingleSelect=a.$onSingleSelect.bind(a),b.onSessionChange.call(a,a),a.on("changeSession",b.onSessionChange.bind(a)),a.on("mousedown",g),a.commands.addCommands(b.commands.defaultCommands),p(a)}function p(a){function e(){c&&(d.style.cursor="",c=!1)}var b=a.textInput.getElement(),c=!1,d=a.renderer.content;h.addListener(b,"keydown",function(a){a.keyCode==18&&!(a.ctrlKey||a.shiftKey||a.metaKey)?c||(d.style.cursor="crosshair",c=!0):c&&(d.style.cursor="")}),h.addListener(b,"keyup",e),h.addListener(b,"blur",e)}var d=a("./range_list").RangeList,e=a("./range").Range,f=a("./selection").Selection,g=a("./mouse/multi_select_handler").onMouseDown,h=a("./lib/event");b.commands=a("./commands/multi_select_commands");var i=a("./search").Search,j=new i,l=a("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(a,b){if(!a)return;if(!this.inMultiSelectMode&&this.rangeCount==0){var c=this.toOrientedRange();if(a.intersects(c))return b||this.fromOrientedRange(a);this.rangeList.add(c),this.$onAddRange(c)}a.cursor||(a.cursor=a.end);var d=this.rangeList.add(a);return this.$onAddRange(a),d.length&&this.$onRemoveRange(d),this.rangeCount>1&&!this.inMultiSelectMode&&(this._emit("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),b||this.fromOrientedRange(a)},this.toSingleRange=function(a){a=a||this.ranges[0];var b=this.rangeList.removeAll();b.length&&this.$onRemoveRange(b),a&&this.fromOrientedRange(a)},this.substractPoint=function(a){var b=this.rangeList.substractPoint(a);if(b)return this.$onRemoveRange(b),b[0]},this.mergeOverlappingRanges=function(){var a=this.rangeList.merge();a.length?this.$onRemoveRange(a):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(a){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(a),this._emit("addRange",{range:a})},this.$onRemoveRange=function(a){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var b=this.rangeList.ranges.pop();a.push(b),this.rangeCount=0}for(var c=a.length;c--;){var d=this.ranges.indexOf(a[c]);this.ranges.splice(d,1)}this._emit("removeRange",{ranges:a}),this.rangeCount==0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._emit("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),b=b||this.ranges[0],b&&!b.isEqual(this.getRange())&&this.fromOrientedRange(b)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new d,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeList.ranges.concat()},this.splitIntoLines=function(){if(this.rangeCount>1){var a=this.rangeList.ranges,b=a[a.length-1],c=e.fromPoints(a[0].start,b.end);this.toSingleRange(),this.setSelectionRange(c,b.cursor==b.start)}else{var c=this.getRange(),d=c.start.row,f=c.end.row;if(d==f)return;var g=[],h=this.getLineRange(d,!0);h.start.column=c.start.column,g.push(h);for(var i=d+1;i1){var a=this.rangeList.ranges,b=a[a.length-1],c=e.fromPoints(a[0].start,b.end);this.toSingleRange(),this.setSelectionRange(c,b.cursor==b.start)}else{var d=this.session.documentToScreenPosition(this.selectionLead),f=this.session.documentToScreenPosition(this.selectionAnchor),g=this.rectangularRangeBlock(d,f);g.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(a,b,c){var d=[],f=a.column0)p--;if(p>0){var q=0;while(d[q].isEmpty())q++}for(var r=p;r>=q;r--)d[r].isEmpty()&&d.splice(r,1)}return d}}.call(f.prototype);var m=a("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(a){a.cursor||(a.cursor=a.end);var b=this.getSelectionStyle();return a.marker=this.session.addMarker(a,"ace_selection",b),this.session.$selectionMarkers.push(a),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,a},this.removeSelectionMarker=function(a){if(!a.marker)return;this.session.removeMarker(a.marker);var b=this.session.$selectionMarkers.indexOf(a);b!=-1&&this.session.$selectionMarkers.splice(b,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(a){var b=this.session.$selectionMarkers;for(var c=a.length;c--;){var d=a[c];if(!d.marker)continue;this.session.removeMarker(d.marker);var e=b.indexOf(d);e!=-1&&b.splice(e,1)}this.session.selectionMarkerCount=b.length},this.$onAddRange=function(a){this.addSelectionMarker(a.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(a){this.removeSelectionMarkers(a.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(a){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("multiselect"),this.keyBinding.addKeyboardHandler(b.commands.keyboardHandler),this.commands.on("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(a){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("multiselect"),this.keyBinding.removeKeyboardHandler(b.commands.keyboardHandler),this.commands.removeEventListener("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelectExec=function(a){var b=a.command,c=a.editor;b.multiSelectAction?b.multiSelectAction=="forEach"?c.forEachSelection(b,a.args):b.multiSelectAction=="single"?(c.exitMultiSelectMode(),b.exec(c,a.args||{})):b.multiSelectAction(c,a.args||{}):(b.exec(c,a.args||{}),c.multiSelect.addRange(c.multiSelect.toOrientedRange()),c.multiSelect.mergeOverlappingRanges()),a.preventDefault()},this.forEachSelection=function(a,b){if(this.inVirtualSelectionMode)return;var c=this.session,d=this.selection,e=d.rangeList,g=d._eventRegistry;d._eventRegistry={};var h=new f(c);this.inVirtualSelectionMode=!0;for(var i=e.ranges.length;i--;)h.fromOrientedRange(e.ranges[i]),this.selection=c.selection=h,a.exec(this,b||{}),h.toOrientedRange(e.ranges[i]);h.detach(),this.selection=c.selection=d,this.inVirtualSelectionMode=!1,d._eventRegistry=g,d.mergeOverlappingRanges(),this.onCursorChange(),this.onSelectionChange()},this.exitMultiSelectMode=function(){if(this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getCopyText=function(){var a="";if(this.inMultiSelectMode){var b=this.multiSelect.rangeList.ranges;a=[];for(var c=0;cc.length){this.commands.exec("insertstring",this,a);return}for(var d=c.length;d--;){var e=c[d];e.isEmpty()||this.session.remove(e),this.session.insert(e.start,b[d])}},this.findAll=function(a,b,c){b=b||{},b.needle=a||b.needle,this.$search.set(b);var d=this.$search.findAll(this.session);if(!d.length)return 0;this.$blockScrolling+=1;var e=this.multiSelect;c||e.toSingleRange(d[0]);for(var f=d.length;f--;)e.addRange(d[f],!0);return this.$blockScrolling-=1,d.length},this.selectMoreLines=function(a,b){var c=this.selection.toOrientedRange(),d=c.cursor==c.end,f=this.session.documentToScreenPosition(c.cursor);this.selection.$desiredColumn&&(f.column=this.selection.$desiredColumn);var g=this.session.screenToDocumentPosition(f.row+a,f.column);if(!c.isEmpty())var h=this.session.documentToScreenPosition(d?c.end:c.start),i=this.session.screenToDocumentPosition(h.row+a,h.column);else var i=g;if(d){var j=e.fromPoints(g,i);j.cursor=j.start}else{var j=e.fromPoints(i,g);j.cursor=j.end}j.desiredColumn=f.column;if(!this.selection.inMultiSelectMode)this.selection.addRange(c);else if(b)var k=c.cursor;this.selection.addRange(j),k&&this.selection.substractPoint(k)},this.transposeSelections=function(a){var b=this.session,c=b.multiSelect,d=c.ranges;for(var e=d.length;e--;){var f=d[e];if(f.isEmpty()){var g=b.getWordRange(f.start.row,f.start.column);f.start.row=g.start.row,f.start.column=g.start.column,f.end.row=g.end.row,f.end.column=g.end.column}}c.mergeOverlappingRanges();var h=[];for(var e=d.length;e--;){var f=d[e];h.unshift(b.getTextRange(f))}a<0?h.unshift(h.pop()):h.push(h.shift());for(var e=d.length;e--;){var f=d[e],g=f.clone();b.replace(f,h[e]),f.start.row=g.start.row,f.start.column=g.start.column}},this.selectMore=function(a,b){var c=this.session,d=c.multiSelect,e=d.toOrientedRange();if(e.isEmpty()){var e=c.getWordRange(e.start.row,e.start.column);e.cursor=e.end,this.multiSelect.addRange(e)}var f=c.getTextRange(e),g=k(c,f,a);g&&(g.cursor=a==-1?g.start:g.end,this.multiSelect.addRange(g)),b&&this.multiSelect.substractPoint(e.cursor)}}).call(m.prototype),b.onSessionChange=function(a){var b=a.session;b.multiSelect||(b.$selectionMarkers=[],b.selection.$initRangeList(),b.multiSelect=b.selection),this.multiSelect=b.multiSelect;var c=a.oldSession;c&&(c.multiSelect&&c.multiSelect.editor==this&&(c.multiSelect.editor=null),b.multiSelect.removeEventListener("addRange",this.$onAddRange),b.multiSelect.removeEventListener("removeRange",this.$onRemoveRange),b.multiSelect.removeEventListener("multiSelect",this.$onMultiSelect),b.multiSelect.removeEventListener("singleSelect",this.$onSingleSelect)),b.multiSelect.on("addRange",this.$onAddRange),b.multiSelect.on("removeRange",this.$onRemoveRange),b.multiSelect.on("multiSelect",this.$onMultiSelect),b.multiSelect.on("singleSelect",this.$onSingleSelect),this.inMultiSelectMode!=b.selection.inMultiSelectMode&&(b.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},b.MultiSelect=o}),define("ace/range_list",["require","exports","module"],function(a,b,c){"use strict";var d=function(){this.ranges=[]};(function(){this.comparePoints=function(a,b){return a.row-b.row||a.column-b.column},this.pointIndex=function(a,b){var c=this.ranges;for(var d=b||0;d0)continue;return f==0?d:(f=this.comparePoints(a,e.start),f>=0?d:-d-1)}return-d-1},this.add=function(a){var b=this.pointIndex(a.start);b<0&&(b=-b-1);var c=this.pointIndex(a.end,b);return c<0?c=-c-1:c++,this.ranges.splice(b,c-b,a)},this.addList=function(a){var b=[];for(var c=a.length;c--;)b.push.call(b,this.add(a[c]));return b},this.substractPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges.splice(b,1)},this.merge=function(){var a=[],b=this.ranges,c=b[0],d;for(var e=1;e=0},this.containsPoint=function(a){return this.pointIndex(a)>=0},this.rangeAtPoint=function(a){var b=this.pointIndex(a);if(b>=0)return this.ranges[b]},this.clipRows=function(a,b){var c=this.ranges;if(c[0].start.row>b||c[c.length-1].start.rowe)break;l.start.row==e&&l.start.column>=c.column&&(l.start.column+=h,l.start.row+=g),l.end.row==e&&l.end.column>=c.column&&(l.end.column+=h,l.end.row+=g)}if(g!=0&&j=this.pos.column&&c.start.column<=this.pos.column+this.length+1){var f=c.start.column-this.pos.column;this.length+=e;if(!this.session.$fromUndo){if(b.action==="insertText")for(var g=this.others.length-1;g>=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=0;g--){var h=this.others[g],i={row:h.row,column:h.column+f};h.row===c.start.row&&c.start.column=this.pos.column&&b.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var a=0;a Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1728,21 +1733,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1769,10 +1774,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1832,82 +1837,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1918,14 +1922,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1950,10 +1954,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1961,7 +1965,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1981,16 +1985,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -2014,7 +2018,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -2025,7 +2029,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2051,14 +2055,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2092,7 +2096,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2122,15 +2126,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2146,12 +2150,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2170,9 +2174,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2180,7 +2184,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2202,10 +2206,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -3296,7 +3300,8 @@ define('ace/mode/coffee/coffee-script', ['require', 'exports', 'module' , 'ace/m exports.parse = function(code) { return parser.parse(lexer.tokenize(code)); }; -});/* +}); +/* * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person @@ -5079,7 +5084,8 @@ parse: function parse(input) { module.exports = parser; -});/* +}); +/* * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person diff --git a/build/src/worker-css.js b/build/src/worker-css.js index 291f8d0c..a86bbcb0 100644 --- a/build/src/worker-css.js +++ b/build/src/worker-css.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1568,7 +1571,8 @@ oop.inherits(Worker, Mirror); }).call(Worker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1610,7 +1614,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1690,11 +1695,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1702,21 +1707,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1743,10 +1748,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1806,82 +1811,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1892,14 +1896,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1924,10 +1928,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1935,7 +1939,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1955,16 +1959,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -1988,7 +1992,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -1999,7 +2003,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2025,14 +2029,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2066,7 +2070,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2096,15 +2100,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2120,12 +2124,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2144,9 +2148,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2154,7 +2158,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2176,10 +2180,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; diff --git a/build/src/worker-javascript.js b/build/src/worker-javascript.js index 3f87e76e..bd77cc7f 100644 --- a/build/src/worker-javascript.js +++ b/build/src/worker-javascript.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1590,7 +1593,8 @@ oop.inherits(JavaScriptWorker, Mirror); }).call(JavaScriptWorker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1632,7 +1636,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1712,11 +1717,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1724,21 +1729,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1765,10 +1770,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1828,82 +1833,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1914,14 +1918,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1946,10 +1950,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1957,7 +1961,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1977,16 +1981,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -2010,7 +2014,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -2021,7 +2025,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2047,14 +2051,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2088,7 +2092,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2118,15 +2122,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2142,12 +2146,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2166,9 +2170,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2176,7 +2180,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2198,10 +2202,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -7698,7 +7702,8 @@ loop: for (;;) { if (typeof exports === 'object' && exports) exports.JSHINT = JSHINT; -});/* -*- Mode: JS; tab-width: 4; indent-tabs-mode: nil; -*- +}); +/* -*- Mode: JS; tab-width: 4; indent-tabs-mode: nil; -*- * vim: set sw=4 ts=4 et tw=78: * ***** BEGIN LICENSE BLOCK ***** * @@ -9769,7 +9774,8 @@ exports.Parser = Parser; exports.Module = Module; exports.Export = Export; -});/* vim: set sw=4 ts=4 et tw=78: */ +}); +/* vim: set sw=4 ts=4 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -10366,7 +10372,8 @@ Tokenizer.prototype = { exports.isIdentifier = isIdentifier; exports.Tokenizer = Tokenizer; -});/* vim: set sw=4 ts=4 et tw=78: */ +}); +/* vim: set sw=4 ts=4 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -11061,7 +11068,8 @@ exports.Dict = Dict; exports.WeakMap = _WeakMap; exports.Stack = Stack; -});/* vim: set sw=4 ts=4 et tw=78: */ +}); +/* vim: set sw=4 ts=4 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -11121,4 +11129,4 @@ exports.mozillaMode = true; // Allow experimental paren-free mode? exports.parenFreeMode = false; -}); \ No newline at end of file +}); diff --git a/build/src/worker-json.js b/build/src/worker-json.js index 3054287e..cffed24f 100644 --- a/build/src/worker-json.js +++ b/build/src/worker-json.js @@ -154,7 +154,8 @@ define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/rege require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -1322,7 +1323,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1399,7 +1401,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -1442,7 +1444,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1605,7 +1608,8 @@ oop.inherits(JsonWorker, Mirror); }).call(JsonWorker.prototype); -});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { +}); +define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { "use strict"; var Document = require("../document").Document; @@ -1647,7 +1651,8 @@ var Mirror = exports.Mirror = function(sender) { }).call(Mirror.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1727,11 +1732,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -1739,21 +1744,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -1780,10 +1785,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -1843,82 +1848,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -1929,14 +1933,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -1961,10 +1965,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -1972,7 +1976,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -1992,16 +1996,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -2025,7 +2029,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -2036,7 +2040,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -2062,14 +2066,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -2103,7 +2107,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -2133,15 +2137,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -2157,12 +2161,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -2181,9 +2185,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -2191,7 +2195,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -2213,10 +2217,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -3590,4 +3594,4 @@ define('ace/mode/json/json_parse', ['require', 'exports', 'module' ], function(r return reviver.call(holder, key, value); }({'': result}, '') : result; }; -}); \ No newline at end of file +}); diff --git a/build/textarea/images/logo_half.png b/build/textarea/images/logo_half.png new file mode 100644 index 0000000000000000000000000000000000000000..f99b0c4bc8af1a17b985fb1a8135a88f24b75c63 GIT binary patch literal 19990 zcmV)#K##wPP){=00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z002WlNkl(74;~ z*Y?6&_MqF(HkfvN*!bDT2@?$lktG3=P%5cZB~`w+Za!)6wbpz;*4p9R zx>XYC8L-Y6XWVVOao|&NCH5@dxVI3 z00sbN0UQPJIDjVrEdNV8VESL6ku(5Y4&XWw*#}@7fLKH_5itOA00w|v^SNmNiioZN zpou5~&;{@~5gi2Z2>_1*a8Db}x6f@ifES6#4FEdMxjul^;57^Ys=b%i`Mdyth<85X z|A_%?00`vIJO+GxIYZwCN;mxx^KoEri-1K?CJjN-1&vJjDx$3(QA zAz1(m0Op-@05C>GFCn5A6Vc}Z{561sPaDm*&h1hWd98?CDk6&j9t+-r0H~T#kca>x zfH-d~;slVwatIV`i`d%^F+hZx9ThgUDk94wq5)jZ%-0jqrvUs(Fx01w=9~1^1n_zh zd7*P|CEyGIU=g8UBm{9H)Th=sZ((ztRn!zE;nqmOq>2do8f>Y z%axd1F*_*D#EQflk`TZ|Bmho0=ZJ`|C8Fzy=q~}h=V_z)=DS@bBL7}Q#zf=@04E|G z!VQZEiOrpu+!?5Nm`qF##i4-CR zG&6_^5P=9_oFI3CVeZh+E&5rGY|w}6EoJe-W5=7b4?NmfI{bKQR+p5HgmheZ90`9d z5p7`Rl!$&Cz{j69ntxtz`Qy&H>z#8?1aPVfV-b^yF*)^`Tehyw9JqY2>C)ZY*_5^# zDJGjS#!`i5q!1|r*Rig56xBoV&p8o@2y*Mt%N&*mITrgCtGym%=|nd@b>E|%6L;O$ z7|x$oQ4H2G5s?eP#{fu}c^fnT1%P)yZ8ZP?-^KvE#ag>ZL{1dAMMTJ1!!{eZUNW_5 zdFypo4Yyr;Q9QmuPc{=wwPLgrjfe>Xz=Np+*DPK7iWkt1YqoBhp5zNAo7m8fkwzL00xJaP zT(9a9Z#XeUriuufn@R$Ul?pzt{2jUzZ034DzkF{0vq-Yfafd*g8eXvG+B zL}(`pdEAMYr!U?;h{mSW!sBx)U+sf6*MRaefJ=#J1Ax1pHkxnj?Z=#Rmx{<~5z!*T z*5t|zd$iQqec{5Dul`Q8?XnG9CtH~5G!Q9<30^@8!zk|ppMg6#1Y;r!Mg=$sTreyr z;eRPU$8Zpc3(pCH=OV1|N^ zyT%KNgs_DY-;8)A1Va)Q#9pAgtb;OB!8J#92!58x{zKVhvk0BkTAmG^tJxaHcb`@GdN9%+()QXsEy%nmkrijr>6mpKaJHC5|EFNEpS5BTG zrJ0zEbUY=ZeMI!hk$nGYqxq_D-)F782*9dyPFZV}>91gU>Y_`!SH1eVW1R`wG?svf zLpbu@!ifvs#CrgM{c|A`a^*>OHLp<%S!Fg=L?)^kSnw+3v5e<&s4^HA@RE3sM+7u9 zBUcHpc6MEWxkG27-rOQ7&CCn{0}H2jnX5sazuLLP?%FkHtwHH?E`WG-ymxx&|k6#Oha zBqJWo1)e8Wj3KA0*Vr_pPCal;n|_~^roiD0iRh9bvFJZ-G+*6~MdXdv+BN`dtyLx) zs=krd(v`3Nj%a3oXSx|dvG*`V2y*q1RHoHZrrO@?R34*Brwb!1-b1DFRUD1qPKA34 zqpO8Lsf93C8IN-UCLm^DkW3~6N+#mt_a0^@$E?827C?)cn*hG}w9$O^;P*u$(zVtq zYpl-tUA46P=4Z*?=j@(n#E7+m4JwAhW0ZXETCV{F0PI5#KoI8*Ay^q4QK`Qxy-e74 zkx8NCX)3IPV%vh!@C1ZnZ=6F3s+D3e1ii+_j$N6{;>9B;NkzoWLPSF%+DSxT0I>43 z(R_tv4iWi&YwehbIAe^?2VGumZQaqo>XkRN+hg2JB7c4ho&;;sXrfv;8cnmSP~=L2 zPu6&k;yKift%hl;?bi&Y{(0wWV7mH#2S78y5u@MOxRFoXcTAgJkCg^9y8wzc5q;^K z&h>wjdzn4XxjiB>wAQjUMrFB8`nzwwIvSf+sb*MfVXcD|2kV^wKd`gbh3CYd<#i65e3f^M1T^| zl2G++o*MSbzVJ4OdTqkL<^*6Oq)M=Q!GYcVCqDPE9?m|YlvW`HZ)vTcrM3QG!5~{} z5u~O6VvME*Uzr{c|F^=?Hz9WS0nBTySB@MxqNb;(FHe%BZ>?3v_ zvDO~=215}LC;(oPsv=zgVZdV%A_mBnuNw#C&cRp*5&wFm7_kD#S)XG2t@@8JY7~l8 z)$qXiQ25T$012apM<^v0M1U1RtTdwblp0)c{Uz!Be|18c9L#K)InVR_>IWZu@FNJ_ z5mQrB*t&HqthL{^Mza;ZUE~T8*#=-L7z}y-Oo~f}h=@bD>>Fcdw{PFxbIvuKbJjV> zHXBk`wYSKYOEyQELy=HMPE-j-oddBdPgW)MrN9pRkkQL>jKvxkO()njnP9RRVZLW@ zaITMobA2c#B#{bivhzD_3&Sf6(iK0T%%)H?Bq@w2RLbG1^j(Nc160f~Td&yByZ?O~ zqC7ukl~zirTq$+IsZ*z>7Z(>#1Hg6HU5E8G?%&!*GXvme0M8PUT_R#dq#wMW(LQw@uy!#gc zNCmb8AR+W}i|Lf{E4S^$joV^$hdHu5!!WC52L!xmcZ#iJJMiz``xtt;L8J=95y0A# z`vLjLBowqag|V*LA8)z!%cXi;C-K{O58|3@ zt~sl<=3CWhE)$XO1#pRTZW+L1A?y_4Cg4yPsCp-GRv=D1QRYaTBY(13NU;zx2{9S# zRGu4cvVj_;)0=r>TguMBDOKgKBx_M@iE%(2&Zysup|Kc`8UOQN?ZU;=3iI6zMN0~= zG2!{X#g!X1zW1t0{N|@;F_uu3PS?S(lhN-k3`Q&f4)2l*;1I0=*HnRQXTh8Ib%wgV zp<%MFwvlqqWdQbX*|KF@9LK41ZWFxzxecI)s`qLxTx{KMW}}&eZxwm2b8abk6$DSB z!vQ8Z12MU?LdtNI=5eQ;H9F%qZnd0lGz>T~c@{w+8a89oA8@wX<<&E*kr{N|VAT#+ z=GpE)uqkeiK|)GgWH<${Taq>96&|ohQIvE*mKnVHg*$QC#t4gjgHZ2TpCBS&=mgi! zG@!&Gw-!`-76%Z6!nT2mMfT9l*Qor{)q6w&<0F;(t%GR-z>RS-lRGz=x%-~5amvm) ziK3`;%{AA&9e{GqnHq&e0S~J1c!`K+;oElZf!F6Oe6twMO(OC}5s5_PFsfFOp#HZc zd1kE$4|RLIKfZhGU}EP5d1w1(X^f9i+|VjYz)C?Wg(Rf5B7n6y@;rkb_QkEv58Ro< z^YZu?=V8JK18*c88sA(=N39GDUVPC6UUtbimIwKH4W@7$jX1*5 zg+4N4ptV9s&jQ*uCFxf_8GvmWLIMp?d7GM%5czDaj>tryq6GQGj;Z{_7n0an>zrey z)X+J1sFpa?z;}rU2|xm1f{30A;6;I1{xX110k{Le@Sn?Qe%Lv8n}{3_09T>Z=UPZU zbh$&+9ow;cb>n51;&s!>NrZMo zg^(C_lESt}U`Y+=mitu;A|pUp04lr;m3W5$h_m4F&COi6X@-MULm;w4STDL^@jbz1 znU#sG(%KPgB4!f*KGdvwRzyw_QIm*XNklItqQ3?37l9x9h8fKSyz+mGh&+L{ts=v| z>!wqi7k5AR`h4c{-D$IpsZ^m6YcO+>y98yN4F{5|-$eikkEEc5ER$-kxS@fjj*uk^ z-JwH2H?YoCU>Ck08_fQ&ItOCHFgJL?g_CF`3M+kCH*F&#v{Q|R)ggZQeFyP}ch4ei zHPK46HyD8jw^Rezb!ND3PzA;*&YeTm79%K`Vpml~%ZfXQL5*=eq-dOtwLLxEEyPS>E!!;9dAAo27UxxWcCjIY`9!j=R-AE^0HOPVh*(61;bKpi`ISU; zGZDQ5z!$#ag5Xo=dm01qv)0;;A~IWrBF8QtBFl|h+AGjAZGzk(l7@O3kq1i(*OYj=srY*7A(a5O;Q>Gr~| z=iNBmdHu!hW{Qb4LZlQNRRb4*v#o{-Zl$c5N{!Vmx%yG+eQkPL@*9Mnu~-@8Fjhu9 zlL)Zf8{(I4--Fjbb2GYw^}TVT8IPRq;$^>mH}WXOSSu~2M+BSUU^G(u8B}IQB_fkL zwgQNxb{wd7an!(aI5-rHjhUfH5GM&DSVW4!OrVerR;+eqJXV0*I%HNbFoNM=0JAb{ zqGR_w-adWLm&daC$CD($M%iHx zJ!(wOUHtM}&5mn#O|?>V8ZnqSw0s2p2~`EUGIW5eLti7nN+$Iz9-}Dq)x(N6tU}Bk zDMF$ZjPvDz0wXL93|@BWG=B1h7hsT?bBb=$h;iqUCH(cnD`>Zp5d$q`5EbaIT?pWH zSm`oXLWNXN1G;r_fs_SP#Xg+36NPpXAyK}EifRB~LdNABM!+=@mG!b_tk6m{bfd#& zdhcX+Gfco0>)oS>@lOvg;A4kYkVd+e5OJ7AQ*ekO zGospSXQ@nTp7N}eyzYev%${;+#tNNOqY?2)bSwL`LIzeBg!z4}UMs&v1d17nCNv^~ zjuP1EJ>%V}{rh{vVM{GMF{eo~A1{GW^IHKh9&pZ+3ct=}H2a)$|5ili;af%6TFWLI zP>&i@^Ot?st-N{v^khT%7FSoXol+83u6A|QBFso;A*Je{xB!?^v90y!MC7mRnxRwx zG*q_P!^OfoeuqW9KOF zFciX6@%Sv+5}}sW0jv}ftuU5qq>-u;fY2vCY9L%=x_z21C2ryogDJ&k@BpX%Nx%MD#hFN1wbN!xf3h8^WkDS6~>EXFSYZ zW8uPEpHG`EoSsM(q9C&@LQ*N{cCPF;^yPy}h+Y0IMch(}x~&b(_?5oa6@Ak|xLpXl zF(Uj9tsT2FboEs5!xgZ)V+J=kA#(7-U zNh3_847K|i8yBwqftSpx=}YtO609-ooN(ZDmaMf+0B;FJNuP zd^k`GJ8!LYg~SBQCa{6 zZ%AC}X@YlTt)Z31SfbI0R5(rykgsR?lW+aW7xrTIT6Mho?OcYLywRQ`D?|-U1&6IQQb`e`(uT`1fv$B!#&F_GAk8Z4To4O#F_&13sU(&Hj1k= z%mu|!vZjc%Mu!|QHp%^GyzV)3pZ`N_=pDTW&5i6)t>C`d*O9yk|2!~3KNk+8&ZH$=Q#|Z>Tw=nXiNIL;5uAQM&Pdq zs%0ld8cWPIaJ+fBY%t%qP^>DTUXpcG zv+HmHNP!ysdvYh}XAT=%3eVX!j*B)n(M}k>+~Kh^1Kf3V1t+==TN)aQL)fkf$D|}X zoxczO^m7a29QID7xMHS_jjaf|15Pau@WAOF4$rM3(u`QEKw`?M=BK=v>!h>8?b9Ktw}6Rv5 z_ly}lch5M+8d0qvOIYq3eCVM${O%{8z?p7_IAS;_CGlAk8r7KQQI?&E(25vtVx#U} z{@u@w?*8A)o#Eg#kSeV;h{#xLNh$RjBKq&^W=|sW0ui|yzBN?&c99-;qscA3i*LWa z*=%tV(TELHqdIDu5g9=NHH~gnoJ3tmi#pL43_2NJq2QVCd^|oEu zF_|DY0w#jeg#YKW$8gEa7&;A&b!-M&Gaf$O!(ZLE03AhD$fXM0QkZ^K{0|X0FqQ`f z-*Mpt-u{Zcxc$;;OeBolSQzVIt-x9bXB{RIg`4(H0?y)7hgT432>lTL;%&FpdvBIEQ}jpa^TGTu2R%1zZSMH3Gs1 z1r`UBPDXvllkur9AJI`{nK@8qG$f)6i0CoYhG`d8e?!Da|C zRtFY8a{Uah-qA)D((5=@xbw&|?mF7V%tRxo6wc0`K)~|A!h*rR5#OiICGw&Y928uQ zBSt@S_&;u%!SB3kA9hd0$c8yGQ;Ex~?GrNVVDlV5aNTBHzBxrdGoS)Q!&k-!MgXz+ zrQ7!4C!T)+5*7@H2G+@0+cQp(4Rc(yWejh)ZYz32Q|tF~rBS$|*BmZnvQ-j+ki}}n zNZ0~bLn6Bk-wYt3k(U#I|s)fGZz!+x3a1~;`jFt~1e z6R$h42{xQGW`+~se}4QJI;|8@#OE2oKv)@CSkydQ$ati@hbx%;{`E44AAj~1{Ks3i zgT;*)%egW%E8eR;XLkofQy9HJHd$ss#^4uk-Gi52u@QN0U~5Lc-u6HQu@<*owh5bB z8o6<0rd2lX6*Pu1<&Y+^wnlsSd#ngi6d}9tmdjTSPn$erYpn`nbo$S= zsH^RaF)APQxYypki&|5WCa=O5XDip|tp6Jt)d~YD(`Z+?!r&cBFCw*6vTBwuIEHF8 zNbo4GHbAJ%75w9Y6-=ZGKl7bC5ixvA3xFtMeEi@%K6+>c`!~0rto(+Rp(}Y8?^%4R z?*}rH2d4q-EcXq5`$FlQeUFh*L+e^*=86mANC#?LYDQ7#TwK*;FRngBbN(aSBD>xDdLO(P3v72VFdpbpKrPSdJbBlL;`Xp2wV`e-l z>oepT!Y#$+Z+&VDUdOqnim{xVM8hJ#Q<-I*5#tgi)*!MGAb*@A54%RC+bW z^3dUR2R7qX*KUS2W+c4nP^`?XE9+2eLzQO6SRBFHf_)F;RqC|`;?k?sOAlp|WvtgP zF<^IHzqf~YgEcwTyiLzJcX4Pz0ta!`W)ZQ0mtkje9&mFCn=YJGVoGMW9Ip{PP8n`$ zIH!zA#f&;@Lu}=8oK%5z3XC)Ixd5b{4KwlrJL+ov(;&vmz~RLgPvBKoZGbUVnSiyz zd+s`oPaPd1)d~}hCzlMZ44r3zgMkQDCsoKZ#F+y&wl#j~*6oNDjd~aYbfoZ(j~~G= z|Ls9vl|F~Z>17TkTwvWS$Nmi|e*8Hz;rNbv7%RX}zULmi_IEyq#a<4j&f#$iBd852 zsE&KBv`}M}ovpFS;T$Sh@c5RfH@Rnb-tV%tR=FVh7m*ZxaT0K-GZim*Pm>Ke?`+$w z(l&A6IjWL?Edg=0BT{-4SJK$l|A2nVv3xcT2XIl8w@eIA(mc_%OvQEV4We(SEYvOyZo~{_zBJE`F z`hV+=6L4u0n)EsZBPTbMKfCw+E8O9*N)|| z;^X(w2!_TYcLXB@TPqAM_Z?n;U^Bk+qG|Z?d(}yK;P?uD|E@WVwVSXaXeSDtMB!X? zun1tR;76Z5ga7w?_hP2yb;uwMumV^^NWnV6>kmvJ)?9+^>ckNqKGnlrCk9Akjm={b zl1QD^)W)pv5BHzJ7f)q~A`Q)g?>n#wXYrr#D!;oPU&4`P1088Zim_)y>+HrtF%G#E*QoQ|fGNP$-0n2qd6$Sv%dkoKa_M(=Y4%j2j&aR7e}h zr^Uwkbq0pHMQ(k?x1t2x2xHvM1kc>o#Q%BowwlVn3Nvs2#4+?ZMXVK^Fgl6yg+buF zK-gKqz6}lhz=0_YP2u(YePDo#rW4$8un!c>gT^;ovI9##(Shu;MV0M!sK3++0X>Um0^*{hq^l-o5Ne*dq1KiDZMenuL^Vh z&T-s+*%ti4XAa}>g+3C^Rjp8}S%E~A*16C``+ArKwWpGtbkkY86oxEOh)9zfwRMq1 zgpILS>E>t$D{;>GeJYe}CG{^=4Uwo^+6E!ZS?y-HY}+_qePA1&wR;L%$5Su^N9G53 z=N*Uf7x&I0jzR&@`od&U8t~UkCAa8i7O%TzBVK>qmXeXC(mOHU`=yguu?h#ax6q6j zom8Qz6>i=?CvU zj-UFg2hc-|R;){J-_Hdbn-Sjj^2@MyQyb5@a0=h^j?ZCnV7%<3m|hWtSyG?0A(b3e z-~gSdoT8SsLn;?o6R`lc=&BekL`1y2ykxt5avkQfie0Q9KqzDnwojiW@ad)oV2fVhJkMorZZ4B_QVRZM^cU51DZ%Qc*01b9SnOu_iCgyK zCvUrCeNU2SuvHjH;A$Ap*RzZhC~|nl_STcA2~i2q zAb4zc74P}{QT*i>PvP+ui%z=@RkX(tkUK$dkmFZgvL7$Ga!cvKR{I%FEUbdLQVU2; zPFo)V=YlsYjfWWENQ*cMsy;4y_H}3qCuYXN!a~;X4=75kgBTGBEyT5+E~#}0R&5xb zqgn1}_|A(r;7u>O=)5P{IYBE?XeH|GzF5>weEIkMw{v~ZlcE>`GUM>(zdwP8RyC$N zahUo^SQ;Aq*fTqL)fJs{c$q>i7;539{8%>B5i6HXcE&mM1`cn1?q)o9Z|9tI^N4`l z2<|_zh%Y?8gpWTmk2{}O#az##*-9}rp+c9c=VXS)A~zO4^P;_Y!;L%3tdfXu$HS*_ zc)pKjGaYGjA0?{R#Kzzim>EketG4BaXtcp~$*u-)hKOd2F>>b2nVgtYm-TbW2TszC zsv7fMK;5b)t_lS)2&@&fBEnm5zZ9A|U?Ez!!Tzb7=<>6)rV&I+C$|n$cXoHSb8_D5 zb8ZbD?<+K$ammT7W)44mWeab8&Nzw{SI)JKSP>{N+e9H#V**44eUR@Zw^r~oH&5e- zpE-TDlyuELeevi5{`K$Og8{sFzmcSvoC-2fXUoov)uBPc4!`!2{dnzl+e-B#vlnx{ z^W%>KtU&dS#R3Z!b-{pdeAKWbZC%4b&zxDA&&Q`X)z>h$T11{;=BpPM7kk}q*D))C z$uien9AbQP6VCY9TPxv~s#6+iA%>gU|gey39sRmdC>{qs;TLa{Mx3IXBb-P`arYVIb zs)w4Hb89Wl&CLx(L=zEQHZW%KL_gksY15gkCUIo=qJGtPUGyS3C%EOJ&F4Jfr95(w z<4Q-8^E@7N$}!*O}y#G3GAJUpW-%wT~jG$Ix!w!wP-}XMrB1XG{7*k*wSXa@w#nz<4rp- z-iStqR04!M56$5>KKuxptwz}?QPt>ZWIxspx%3f*0B7I^tGRU!XU?1%PESuW07XQz zT5CPm?RI-BD=S7RrJZx)jLYr9@l}YMu0+Y?dy@l*CdFlzVV%Q7s&MVjsV6-kAA9gL z{>|^-jbBynE7Bj6gTSPJ8N1ri_tTj1O`-_XIy-V(k%X8~eNCK}glPVkz` z8n|Icde((R=K1IVx|=yj+JtU501Da? zA}kIpUT{SRzxB!sv2iR~$6FEJci$QO@jWZpva#bQD6sNaf@?)dVps>nnh^7o+6*9q z+b>Ml4U0r;1`(YjjBf2{{K?Cw@Yte3W`Qkjg^84FVRRj=cCLC@cfd)&~rQ@oWrUW&z z3au+#jserGr0-!9xd=2v|ah6XSQwWpU|I*I@K(mj}JM(c*9$7Z|u>GvN+)NDd2 zRSjYU*Scf4^j=C66rV3yeiHmdgh6iciO2f5WnT-5&v~9pc6HBWG;;dSVl0U8(5W8o zIl78h9oTe!k0yfs8yncav2osgEn1czIk|!#`u#ic(7eTXy9FmU;2>EuvLlQ?sbx#m ztUwEa1G7SY=J6GmXPHVG!b~zhKcDA$-Xo%8EFxxUY3U)YwJv9uu##+LabrJeE`80Pcpb)Q-)?ytnResB?Q`S1$*x!}AEAu!UQFCu4+pdlhW ze5#Mv|JhOe_UD(%$r|VLf}`7$b&m~*aK}Tlc;#<@4v#GPxjHg3bb&^C%SPpr^_dLS z_!8J0`N>BXL|_0oW|rY_Xy@kUmgnc^AJZa&;c)nHnx;3wul(VN$cRYRefZO-rY^Z< zgOLg_`Cc&^$>5j?OZ^O|m;0D(C+EGQiGcrf>pr~x`t2}Qux%niqUV%M}^{&@YX$p8JVPaMM^-LrzpPAfFiQz=gX zd0a!RLFDgV>#LB9A1{KZXgY;Acx*n$5B<#&{`zQ)>B%;dMiXzpE5qtjXz^Wdd)=YM z+x~GDKl1lWSmqWc+6@>L<2ODzkIcBQ*drF+<)ITR`2OF!3qSwyWt01`g9tl zFwXCY3hPCncA<^RBZ{Uyj#A`@zp#)k&MuQuj)`uvjz=g!N~oXeH3pD7Xk^v=`x)sN0%tTP5; z?f0S3@v`!iJ*gmX4BB4uGhgP03MW_XSKti@?|-<5SHE`!pI>QVda?y!Mw%!*&`t0& zA6uN=f&d}I~h{imn!_Im`4@eUek3I~N&GsUM)5`O-Jr^-So(fRkUxX-N& z@wR_Bh*$jX7x96|dYGCXht{eR=TmJcL4DDAs_}DFbt)9CImN^ZhQaDXcbs%0Ln1ar zWQjdT2@nlukJ!lz4{R~%q(WdLs~Id*4kuDd;rM(H zuefGA+KuRIz!QGEe}2~~y!HLZ5jES0<0y=Ar2xX&7w5xOG=gEY1~Fr0D45U|H|$8( zJt6fIe0({_fBDoZ-gcKmmX2Yp6_>R(5Fw2fzIfW=-s3&&nILR#t8+BodHnUULj(NE z$5-&1cMdU+HYUbfo^+$C-jl`}pF29hmya%E&s2oXW6?Qwd_d~?I%1ZT#Xb?uO zJ>2W{J|nWG%sMtUb{jLlz*JIUP&)Sav@|tIym*ji0`2Po=If0-3;3-7yHj+5Zj8RcYkfJrMCA!*|B7;&I)(WJz zivRY41h?&9f7Hr+&)_c~=;NLD863+~jCWG6_%8r}8jbrat3#x=j~g}%p1&i)wlRgV zgkUUide!1frw#t;h{2(*g3}4c(x{qj}i>4dkhOLa}?`>iGc!aUU z>yGDo1_w{~@Ue#%@#Wb8mUE!hh>^w$&YG|egIC)XEw_H%h63<JE( zO1VjzBv}6Y|N6+OFaFbmQJO9>^D;AcwbmxfvUm4-y?f3I_*&}??RNV|j4_iUk~rta ztuf;encVxDpT2sy@!CzK@(gBo*=apCO4|4+<_VB!|4$r+H!j`u0?V0Nd z?mC&{6UPNdhA~?06lttRi+c5?3|u+80LBV>!yIOqBZ7qrCqHupry`_Lgd_^H@@nfQ zNO@J;&}eAN@_@;6bbCYCVIP_tH2mwC^HQT&Gm_X(oPaZahg?lKE8rRg#=F9t7Tvn>15Uaxm|S+6@=X5dc6alAWp(}{>EQXKV{7ELsmQxjJ_ zZ=#nOFUR6~`-wkcO8G1QqYusEgZCbX$t^l*gm$W-0^pO-hH`A7j}P5{20!4uV zY10oGDiVx>@+qgDD3k@h^0nHq3gKcGsr<@X(?kV0OU-e8S_qeOZc06L$*f4(^Ht92 zDc@J8T7seyQe&;%SrmuV=ID$}hc6rL1g-WM`k(xxlPB)}=;0`d`^>z`%)J_x`G81$ zp6EKAKuMBZl&0zTTWcH6xu$cjW33&xc|Nx9MX$RsefAG-URqp&(p(+gFeTg*HyR*D zf0!Z5EG8NXTgOsNwNs>#LS`Kn1{No~4)X(sN>a4iO@9)pJR2Yth3%=@*pJAU4}zB| z$vj5YN*gr3<#+?Gv`{4!tt|>RaujII!Ke)-C#gy|BP?7o$jYsGy|xxup^BqoO>e1( ziUND&-gATw*3!#3<2{D6<@_I510Z-1Yb$ownXn^aXIxkrD_|)UY;frNPTL*ChwoT< z@Q;7-%TC;a)=?3bdP=F@U@&;sa5#LlUNT#+qQ}J>$B*~f}n1PhfBqV@gsSPcR;s|LYh2;oyL*VGD!{KF%qdmfcjUZ72jaCy$5`&5~8eC>X zVC{h}QRqb~9;*O?l@CQ+a5m)S{G}1qer3%b%L;_99+%H6tUr5^MjUGS{&IpFSLAC+ zht${jsBufBWR>bQq2*s|hopyrD=1gGP*?{v33TS*JB&rM|RTaaXmWEVRbZil?ZcilVJVw4qpQh?tcVhuJTGx;xp3lBtWI z)$C>-fKd^qipf!7ylT;+Qq+kE^`7bQ9@gRWs!ZXDwf{@iYb6*ClN=~)qi(NtgDLN$ z!>y_)sLFFzma#_u=h|m$cdYrpWP!2f^#aTATF66X_Q|NXDHrQ)Qcx%sBi8(Ae=0*| z&^1YYY?{<2yH|Z91PSvEz3#a=Hi?OqL)k9=VgESh(>Qhy4mPD1R9-Di=$jYnhi#%a*Kf3tM&AO76o{>t)V zFqoC#VKQc38V-klp6B_4=Q5b5Vl)&CXVqGJNNc@`nWsb3lo0zlb<1Z?W^-ToU~fY! zjy7I&ARSVQEX)0HpWr2^}swu23rSS>CS3Da zSo0jJ5H{j*YO<9&i74ckfR>T9q6)TLO5hw?0IQ)2BDL9JC`mr+98}!ErVW!AJ9*dO z!FRpo=;L>P?4(kvt8~<@g(L&uM3!am$@BdFQ3Bx{V*Ib9HY6fhp68Dc(NJr>6+lEp zL8zm^L~iNyvElJgzqcDLJZ87<+7pj$+pjWcWLfST*blE0VLM1LCX~SH=x&+_(uF^5f>r-~IaRy?^qn$5s|*7qr%W_8HO& zGk29z7Qn-U!QfAgF^7r-=*i@cPgTru)}hl{Uz8-t?Ev;T=OX7^Dk4o0X*z3D>s*o~ zQFGS~FPogX`8DIX;6S?MQmm}>V2trA8&av2$RQTHfrWR)G%*E1_{rc_fSfx52A)`-2p>Z7(=B0}ki>aV%#Gh%%+ zyttxEGxzNz1&J5PJO6(UXH7W}A#F4;(TdPqdECx_^3RqY{m>ttSzb7^teA(abf1{I z1ay^BLuMXWYd<#}4&U#bn=e$Gqrc{BGn(}bhnRUfilUpMD7w)(H|d@<0uv6jR}; z24qJsfeV`+1Oea z1Bg0P8yj0Lzp=gXzzf^${nw}1bfNC64thDz9XOcG!I1|Y-Y}@d9IV!4MXKg8>Y;_# zd0w4WCL2wW*M^L>DYC0Q@75Se-H2)q-g}MOd+n%a3U$QlweUVycqEJ3+ME_z14&G1 z#0pK$5D(5s{=}EErTae7KY8beR!$%MLO09JfPhSCJ!IwqfIboRnK@_Xo^$R?S(bgo zT6-+)ojKcIetnGwYhWM)h{E57)_PwQMK=)9#Ue5m7UhTmBqEZCNbHP>oHw|*(P+dQ z_FmT5bk(z)ll!ks;_a8jG`(Bfbc&3QU=(0E{GwV(pztuHD;-unLmI(7b)%3q;8)hL zyE3{&_6Su{09bdnAxYh9)W;Iq>bVh*67J3h=D>}fI`%6tgAJesPZQ0B|VJ^E>i9zYl%^u)4v> zQ#F{c)@arXS1K5f0?^c2@6%czAfgKaOo~VZKs)DR5s3lBA`&@kwG&bB6{9FlV%?tF z5RGl#7B@F<)#--KN{@{*RODxPM7k2})j|r5EXBOekE3gxvnE}X%C<`gHC8Dl~95%+>X^gp7L>9xY<)cCLtMeN88jXi*Sf}(n%sivDzJ!@C zW#+BUxmIABwTMKa4LEYnX^3bMr<@a(vnx1XkNx~syVZxZ3x%FEVz$8`EP$Md3=!qw ze@jF|081kBh%x3KW6Z72d+`~1yjAZI;SEQMSPA%($|z%>|6Uqn^_9JAIQwAMc2oI4Rf zZec8W%~;&m<7DIOXgqb+q8_#sfH*87zKNN45YY@XZvikxM5%}*;r(lkg}#jqW?eFM zt+xpVl*7*x8p1DyJZr5zAtJ}EwZ}zd0l?}SuVU6@M)LLY5cmcfPd#+$HB?$kM6F;* z(*P!zd4h=AMAQI~5YZS$7c--8V}l_8xrp=%kSZd50Db3NFD&4; literal 0 HcmV?d00001 diff --git a/build/textarea/src/ace-bookmarklet.js b/build/textarea/src/ace-bookmarklet.js index 8ca51360..6b1c08cd 100644 --- a/build/textarea/src/ace-bookmarklet.js +++ b/build/textarea/src/ace-bookmarklet.js @@ -1162,7 +1162,8 @@ exports.keyCodeToString = function(keyCode) { return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); } -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1681,7 +1682,8 @@ exports.loadScript = function(path, callback) { s.onload = callback; }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1781,7 +1783,8 @@ exports.edit = function(el) { return editor; }; -});// vim:set ts=4 sts=4 sw=4 st: +}); +// vim:set ts=4 sts=4 sw=4 st: // -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License // -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project) // -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified @@ -1799,7 +1802,8 @@ __ace_shadowed__.define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module require("./regexp"); require("./es5-shim"); -});/* +}); +/* * Based on code from: * * XRegExp 1.5.0 @@ -2967,7 +2971,8 @@ var prepareString = "a"[0] != "a", } return Object(o); }; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -3047,6 +3052,7 @@ var Editor = function(renderer, session) { this.container = container; this.renderer = renderer; + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); this.textInput = new TextInput(renderer.getTextAreaContainer(), this); this.keyBinding = new KeyBinding(this); @@ -3063,7 +3069,6 @@ var Editor = function(renderer, session) { wrap: true }); - this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); this.setSession(session || new EditSession("")); }; @@ -3427,6 +3432,7 @@ var Editor = function(renderer, session) { this.$highlightBrackets(); this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); }; /** internal, hide @@ -3439,29 +3445,40 @@ var Editor = function(renderer, session) { if (session.$highlightLineMarker) session.removeMarker(session.$highlightLineMarker); + + session.$highlightLineMarker = null; + + if (this.$highlightActiveLine) { + var cursor = this.getCursorPosition(); + var foldLine = this.session.getFoldLine(cursor.row); + + if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { + var range; + if (foldLine) { + range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); + } else { + range = new Range(cursor.row, 0, cursor.row+1, 0); + } + session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); + } + } + }; + + /** internal, hide + * Editor.$updateHighlightGutterLine() + * + * + **/ + this.$updateHighlightGutterLine = function(){ if (typeof this.$lastrow == "number") this.renderer.removeGutterDecoration(this.$lastrow, "ace_gutter_active_line"); - session.$highlightLineMarker = null; this.$lastrow = null; - if (this.getHighlightActiveLine()) { - var cursor = this.getCursorPosition(), - foldLine = this.session.getFoldLine(cursor.row); - - if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) { - var range; - if (foldLine) { - range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0); - } else { - range = new Range(cursor.row, 0, cursor.row+1, 0); - } - session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background"); - } - - this.renderer.addGutterDecoration(this.$lastrow = cursor.row, "ace_gutter_active_line"); - } - }; + if (this.$highlightGutterLine) + this.renderer.addGutterDecoration( + this.$lastrow = this.getCursorPosition().row, "ace_gutter_active_line"); + } /** * Editor@onSelectionChange(e) @@ -3483,6 +3500,7 @@ var Editor = function(renderer, session) { session.$selectionMarker = session.addMarker(range, "ace_selection", style); } else { this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); } if (this.$highlightSelectedWord) @@ -3561,6 +3579,7 @@ var Editor = function(renderer, session) { // Update the active line marker as due to folding changes the current // line range on the screen might have changed. this.$updateHighlightActiveLine(); + this.$updateHighlightGutterLine(); // TODO: This might be too much updating. Okay for now. this.renderer.updateFull(); }; @@ -3579,15 +3598,34 @@ var Editor = function(renderer, session) { return text; }; + /** + * Editor.onCopy() + * + * Called whenever a text "copy" happens. + **/ + this.onCopy = function() { + this.commands.exec("copy", this); + }; + /** * Editor.onCut() * - * Emitted whenever a text "cut" happens. + * called whenever a text "cut" happens. **/ this.onCut = function() { this.commands.exec("cut", this); }; + /** + * Editor.onPaste() + * + * called whenever a text "paste" happens. + **/ + this.onPaste = function(text) { + this._emit("paste", text); + this.insert(text); + }; + /** * Editor.insert(text) * - text (String): The new text to add @@ -3693,11 +3731,8 @@ var Editor = function(renderer, session) { * * Emitted when text is entered. **/ - this.onTextInput = function(text, pasted) { - if (pasted) - this._emit("paste", text); - - this.keyBinding.onTextInput(text, pasted); + this.onTextInput = function(text) { + this.keyBinding.onTextInput(text); }; /** @@ -3813,7 +3848,8 @@ var Editor = function(renderer, session) { * **/ this.setHighlightActiveLine = function(shouldHighlight) { - if (this.$highlightActiveLine == shouldHighlight) return; + if (this.$highlightActiveLine == shouldHighlight) + return; this.$highlightActiveLine = shouldHighlight; this.$updateHighlightActiveLine(); @@ -3828,6 +3864,19 @@ var Editor = function(renderer, session) { return this.$highlightActiveLine; }; + this.$highlightGutterLine = true; + this.setHighlightGutterLine = function(shouldHighlightGutterLine) { + if (this.$highlightGutterLine == shouldHighlightGutterLine) + return; + + this.$highlightGutterLine = shouldHighlightGutterLine; + this.$updateHighlightGutterLine(); + }; + + this.getHighlightGutterLine = function() { + return this.$highlightGutterLine; + }; + this.$highlightSelectedWord = true; /** * Editor.setHighlightSelectedWord(shouldHighlight) @@ -3982,6 +4031,14 @@ var Editor = function(renderer, session) { return this.renderer.$gutterLayer.getShowFoldWidgets(); }; + this.setFadeFoldWidgets = function(show) { + this.renderer.setFadeFoldWidgets(show); + }; + + this.getFadeFoldWidgets = function() { + return this.renderer.getFadeFoldWidgets(); + }; + /** * Editor.remove(dir) * - dir (String): The direction of the deletion to occur, either "left" or "right" @@ -3991,7 +4048,7 @@ var Editor = function(renderer, session) { **/ this.remove = function(dir) { if (this.selection.isEmpty()){ - if(dir == "left") + if (dir == "left") this.selection.selectLeft(); else this.selection.selectRight(); @@ -4416,15 +4473,29 @@ var Editor = function(renderer, session) { return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; }; - this.$getPageDownRow = function() { - return this.renderer.getScrollBottomRow(); - }; + this.$moveByPage = function(dir, select) { + var renderer = this.renderer; + var config = this.renderer.layerConfig; + var rows = dir * Math.floor(config.height / config.lineHeight); - this.$getPageUpRow = function() { - var firstRow = this.renderer.getScrollTopRow(); - var lastRow = this.renderer.getScrollBottomRow(); + this.$blockScrolling++; + if (select == true) { + this.selection.$moveSelection(function(){ + this.moveCursorBy(rows, 0); + }); + } else if (select == false) { + this.selection.moveCursorBy(rows, 0); + this.selection.clearSelection(); + } + this.$blockScrolling--; - return firstRow - (lastRow - firstRow); + var scrollTop = renderer.scrollTop; + + renderer.scrollBy(0, rows * config.lineHeight); + if (select != null) + renderer.scrollCursorIntoView(null, 0.5); + + renderer.animateScrolling(scrollTop); }; /** @@ -4433,14 +4504,7 @@ var Editor = function(renderer, session) { * Selects the text from the current position of the document until where a "page down" finishes. **/ this.selectPageDown = function() { - var row = this.$getPageDownRow() + Math.floor(this.$getVisibleRowCount() / 2); - - this.scrollPageDown(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); + this.$moveByPage(1, true); }; /** @@ -4449,15 +4513,7 @@ var Editor = function(renderer, session) { * Selects the text from the current position of the document until where a "page up" finishes. **/ this.selectPageUp = function() { - var visibleRows = this.renderer.getScrollTopRow() - this.renderer.getScrollBottomRow(); - var row = this.$getPageUpRow() + Math.round(visibleRows / 2); - - this.scrollPageUp(); - - var selection = this.getSelection(); - var leadScreenPos = this.session.documentToScreenPosition(selection.getSelectionLead()); - var dest = this.session.screenToDocumentPosition(row, leadScreenPos.column); - selection.selectTo(dest.row, dest.column); + this.$moveByPage(-1, true); }; /** @@ -4466,11 +4522,7 @@ var Editor = function(renderer, session) { * Shifts the document to wherever "page down" is, as well as moving the cursor position. **/ this.gotoPageDown = function() { - var row = this.$getPageDownRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); + this.$moveByPage(1, false); }; /** @@ -4479,11 +4531,7 @@ var Editor = function(renderer, session) { * Shifts the document to wherever "page up" is, as well as moving the cursor position. **/ this.gotoPageUp = function() { - var row = this.$getPageUpRow(); - var column = this.getCursorPositionScreen().column; - - this.scrollToRow(row); - this.getSelection().moveCursorToScreen(row, column); + this.$moveByPage(-1, false); }; /** @@ -4492,7 +4540,7 @@ var Editor = function(renderer, session) { * Scrolls the document to wherever "page down" is, without changing the cursor position. **/ this.scrollPageDown = function() { - this.scrollToRow(this.$getPageDownRow()); + this.$moveByPage(1); }; /** @@ -4501,7 +4549,7 @@ var Editor = function(renderer, session) { * Scrolls the document to wherever "page up" is, without changing the cursor position. **/ this.scrollPageUp = function() { - this.renderer.scrollToRow(this.$getPageUpRow()); + this.$moveByPage(-1); }; /** related to: VirtualRenderer.scrollToRow @@ -4519,11 +4567,13 @@ var Editor = function(renderer, session) { * Editor.scrollToLine(line, center) * - line (Number): The line to scroll to * - center (Boolean): If `true` + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called when the animation has finished * - * TODO scrollsa to line, if center == true, puts line in middle of screen or attempts to) + * TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to) **/ - this.scrollToLine = function(line, center) { - this.renderer.scrollToLine(line, center); + this.scrollToLine = function(line, center, animate, callback) { + this.renderer.scrollToLine(line, center, animate, callback); }; /** @@ -4641,19 +4691,21 @@ var Editor = function(renderer, session) { * Editor.gotoLine(lineNumber, column) * - lineNumber (Number): The line number to go to * - column (Number): A column number to go to + * - animate (Boolean): If `true` animates scolling * * Moves the cursor to the specified line number, and also into the indiciated column. * **/ - this.gotoLine = function(lineNumber, column) { + this.gotoLine = function(lineNumber, column, animate) { this.selection.clearSelection(); this.session.unfold({row: lineNumber - 1, column: column || 0}); this.$blockScrolling += 1; - this.moveCursorTo(lineNumber-1, column || 0); + this.moveCursorTo(lineNumber - 1, column || 0); this.$blockScrolling -= 1; - if (!this.isRowFullyVisible(this.getCursorPosition().row)) - this.scrollToLine(lineNumber, true); + + if (!this.isRowFullyVisible(lineNumber - 1)) + this.scrollToLine(lineNumber - 1, true, animate); }; /** related to: Editor.moveCursorTo @@ -4759,8 +4811,10 @@ var Editor = function(renderer, session) { * Moves the cursor to the end of the current file. Note that this does de-select the current selection. **/ this.navigateFileEnd = function() { + var scrollTop = this.renderer.scrollTop; this.selection.moveCursorFileEnd(); this.clearSelection(); + this.renderer.animateScrolling(scrollTop); }; /** @@ -4769,8 +4823,10 @@ var Editor = function(renderer, session) { * Moves the cursor to the start of the current file. Note that this does de-select the current selection. **/ this.navigateFileStart = function() { + var scrollTop = this.renderer.scrollTop; this.selection.moveCursorFileStart(); this.clearSelection(); + this.renderer.animateScrolling(scrollTop); }; /** @@ -4879,44 +4935,45 @@ var Editor = function(renderer, session) { * Editor.find(needle, options) * - needle (String): The text to search for * - options (Object): An object defining various search properties + * - animate (Boolean): If `true` animate scrolling * * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. **/ - this.find = function(needle, options) { + this.find = function(needle, options, animate) { this.clearSelection(); options = options || {}; options.needle = needle; this.$search.set(options); - this.$find(); + this.$find(false, animate); }; /** related to: Editor.find * Editor.findNext(options) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling * * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. **/ - this.findNext = function(options) { + this.findNext = function(options, animate) { options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = false; this.$search.set(options); - this.$find(); + this.$find(false, animate); }; /** related to: Editor.find * Editor.findPrevious(options) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling * * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. **/ - this.findPrevious = function(options) { + this.findPrevious = function(options, animate) { options = options || {}; - if (typeof options.backwards == "undefined") - options.backwards = true; this.$search.set(options); - this.$find(); + this.$find(true, animate); }; - this.$find = function(backwards) { + this.$find = function(backwards, animate) { if (!this.selection.isEmpty()) this.$search.set({needle: this.session.getTextRange(this.getSelectionRange())}); @@ -4925,24 +4982,14 @@ var Editor = function(renderer, session) { var range = this.$search.find(this.session); if (range) { - this.session.unfold(range); - this.$blockScrolling += 1; + this.session.unfold(range); this.selection.setSelectionRange(range); this.$blockScrolling -= 1; - if (this.getAnimatedScroll()) { - var cursor = this.getCursorPosition(); - if (!this.isRowFullyVisible(cursor.row)) - this.scrollToLine(cursor.row, true); - - //@todo scroll X - //if (!this.isColumnFullyVisible(cursor.column)) - //this.scrollToRow(cursor.column); - } - else { - this.renderer.scrollSelectionIntoView(range.start, range.end); - } + var scrollTop = this.renderer.scrollTop; + this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); + this.renderer.animateScrolling(scrollTop); } }; @@ -4952,7 +4999,10 @@ var Editor = function(renderer, session) { * {:UndoManager.undo} **/ this.undo = function() { + this.$blockScrolling++; this.session.getUndoManager().undo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); }; /** related to: UndoManager.redo @@ -4961,7 +5011,10 @@ var Editor = function(renderer, session) { * {:UndoManager.redo} **/ this.redo = function() { + this.$blockScrolling++; this.session.getUndoManager().redo(); + this.$blockScrolling--; + this.renderer.scrollCursorIntoView(null, 0.5); }; /** @@ -5202,13 +5255,18 @@ var TextInput = function(parentNode, host) { if (!copied) { var value = valueToSend || text.value; if (value) { - if (value.charCodeAt(value.length-1) == PLACEHOLDER.charCodeAt(0)) { - value = value.slice(0, -1); - if (value) - host.onTextInput(value, pasted); + if (value.length > 1) { + if (value.charAt(0) == PLACEHOLDER) + value = value.substr(1); + else if (value.charAt(value.length - 1) == PLACEHOLDER) + value = value.slice(0, -1); } - else { - host.onTextInput(value, pasted); + + if (value && value != PLACEHOLDER) { + if (pasted) + host.onPaste(value); + else + host.onTextInput(value); } // If editor is no longer focused we quit immediately, since @@ -5229,7 +5287,7 @@ var TextInput = function(parentNode, host) { var onTextInput = function(e) { setTimeout(function () { if (!inCompostion) - sendText(e.data); + sendText(e.data); }, 0); }; @@ -5285,6 +5343,7 @@ var TextInput = function(parentNode, host) { }; event.addCommandKeyListener(text, host.onCommandKey.bind(host)); + if (useragent.isOldIE) { var keytable = { 13:1, 27:1 }; event.addListener(text, "keyup", function (e) { @@ -5607,6 +5666,19 @@ function DefaultHandlers(editor) { var selectionEmpty = selectionRange.isEmpty(); var state = STATE_UNKNOWN; + var button = ev.getButton(); + if (button !== 0) { + if (selectionEmpty) { + editor.moveCursorToPosition(pos); + editor.selection.clearSelection(); + } + if (button == 2) { + editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); + event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); + } + return; + } + // if this click caused the editor to be focused should not clear the // selection if ( @@ -5620,18 +5692,6 @@ function DefaultHandlers(editor) { return; } - var button = ev.getButton(); - if (button !== 0) { - if (selectionEmpty) { - editor.moveCursorToPosition(pos); - } - if (button == 2) { - editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty); - event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose); - } - return; - } - if (!inSelection) { // Directly pick STATE_SELECT, since the user is not clicking inside // a selection. @@ -5993,7 +6053,7 @@ EventEmitter._dispatchEvent = function(eventName, e) { } if (defaultHandler && !e.defaultPrevented) - defaultHandler(e); + return defaultHandler(e); }; EventEmitter.setDefaultHandler = function(eventName, callback) { @@ -6036,7 +6096,8 @@ EventEmitter.removeAllListeners = function(eventName) { exports.EventEmitter = EventEmitter; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -6089,7 +6150,8 @@ function GutterHandler(editor) { exports.GutterHandler = GutterHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -6303,7 +6365,8 @@ function FoldHandler(editor) { exports.FoldHandler = FoldHandler; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -6352,15 +6415,27 @@ require("../commands/default_commands"); var KeyBinding = function(editor) { this.$editor = editor; this.$data = { }; - this.$handlers = [this]; + this.$handlers = []; + this.setDefaultHandler(editor.commands); }; (function() { + this.setDefaultHandler = function(keyboardHandler) { + this.removeKeyboardHandler(this.$defaultHandler); + this.$defaultHandler = keyboardHandler; + if (keyboardHandler) + this.$handlers.unshift(keyboardHandler); + this.$data = { }; + }; + this.setKeyboardHandler = function(keyboardHandler) { if (this.$handlers[this.$handlers.length - 1] == keyboardHandler) return; this.$data = { }; - this.$handlers = keyboardHandler ? [this, keyboardHandler] : [this]; + this.$handlers = []; + this.setDefaultHandler(this.$defaultHandler); + if (keyboardHandler) + this.$handlers.push(keyboardHandler); }; this.addKeyboardHandler = function(keyboardHandler) { @@ -6398,7 +6473,7 @@ var KeyBinding = function(editor) { // allow keyboardHandler to consume keys if (toExecute.command != "null") - success = commands.exec(toExecute.command, this.$editor, toExecute.args); + success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); else success = true; @@ -6408,20 +6483,14 @@ var KeyBinding = function(editor) { return success; }; - this.handleKeyboard = function(data, hashId, keyString) { - return { - command: this.$editor.commands.findKeyCommand(hashId, keyString) - }; - }; - this.onCommandKey = function(e, hashId, keyCode) { var keyString = keyUtil.keyCodeToString(keyCode); this.$callKeyboardHandlers(hashId, keyString, keyCode, e); }; - this.onTextInput = function(text, pasted) { + this.onTextInput = function(text) { var success = false; - if (!pasted && text.length == 1) + if (text.length == 1) success = this.$callKeyboardHandlers(0, text); if (!success) this.$editor.commands.exec("insertstring", this.$editor, text); @@ -6744,7 +6813,7 @@ exports.commands = [{ multiSelectAction: "forEach" }, { name: "togglecomment", - bindKey: bindKey("Ctrl-7", "Command-7"), + bindKey: bindKey("Ctrl-/", "Command-/"), exec: function(editor) { editor.toggleCommentLines(); }, multiSelectAction: "forEach" }, { @@ -6966,10 +7035,7 @@ var EditSession = function(text, mode) { } this.selection = new Selection(this); - if (mode) - this.setMode(mode); - else - this.setMode(new TextMode()); + this.setMode(mode); }; @@ -7030,21 +7096,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession@onChangeFold(e) - * + * EditSession@onChangeFold(e) + * * Emitted when a code fold changes its state. * - **/ + **/ this.onChangeFold = function(e) { var fold = e.data; this.$resetRowCache(fold.start.row); }; /** - * EditSession@onChange(e) - * - * Emitted when the document changes. - **/ + * EditSession@onChange(e) + * + * Emitted when the document changes. + **/ this.onChange = function(e) { var delta = e.data; this.$modified = true; @@ -7069,12 +7135,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setValue(text) - * - text (String): The new text to place + * EditSession.setValue(text) + * - text (String): The new text to place * * Sets the session text. - * - **/ + * + **/ this.setValue = function(text) { this.doc.setValue(text); this.selection.moveCursorTo(0, 0); @@ -7105,16 +7171,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getSelection() -> String - * - * Returns the string of the current selection. - **/ + * EditSession.getSelection() -> String + * + * Returns the string of the current selection. + **/ this.getSelection = function() { return this.selection; }; /** related to: BackgroundTokenizer.getState - * EditSession.getState(row) -> Array + * EditSession.getState(row) -> Array * - row (Number): The row to start at * * {:BackgroundTokenizer.getState} @@ -7125,7 +7191,7 @@ var EditSession = function(text, mode) { }; /** related to: BackgroundTokenizer.getTokens - * EditSession.getTokens(firstRow, lastRow) -> Array + * EditSession.getTokens(firstRow, lastRow) -> Array * - firstRow (Number): The row to start at * - lastRow (Number): The row to finish at * @@ -7137,12 +7203,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTokenAt(row, column) -> Array - * - row (Number): The row number to retrieve from + * EditSession.getTokenAt(row, column) -> Array + * - row (Number): The row number to retrieve from * - column (Number): The column number to retrieve from * - * Returns an array of tokens at the indicated row and column. - **/ + * Returns an array of tokens at the indicated row and column. + **/ this.getTokenAt = function(row, column) { var tokens = this.bgTokenizer.getTokens(row, row)[0].tokens; var token, c = 0; @@ -7165,11 +7231,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoManager(undoManager) - * - undoManager (UndoManager): The new undo manager - * + * EditSession.setUndoManager(undoManager) + * - undoManager (UndoManager): The new undo manager + * * Sets the undo manager. - **/ + **/ this.setUndoManager = function(undoManager) { this.$undoManager = undoManager; this.$resetRowCache(0); @@ -7183,10 +7249,10 @@ var EditSession = function(text, mode) { if (undoManager) { var self = this; /** internal, hide - * EditSession.$syncInformUndoManager() - * - * - **/ + * EditSession.$syncInformUndoManager() + * + * + **/ this.$syncInformUndoManager = function() { self.$informUndoManager.cancel(); @@ -7227,19 +7293,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUndoManager() -> UndoManager - * - * Returns the current undo manager. - **/ + * EditSession.getUndoManager() -> UndoManager + * + * Returns the current undo manager. + **/ this.getUndoManager = function() { return this.$undoManager || this.$defaultUndoManager; }, /** - * EditSession.getTabString() -> String - * - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - **/ + * EditSession.getTabString() -> String + * + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + **/ this.getTabString = function() { if (this.getUseSoftTabs()) { return lang.stringRepeat(" ", this.getTabSize()); @@ -7250,12 +7316,12 @@ var EditSession = function(text, mode) { this.$useSoftTabs = true; /** - * EditSession.setUseSoftTabs(useSoftTabs) - * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs - * + * EditSession.setUseSoftTabs(useSoftTabs) + * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs + * * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). * - **/ + **/ this.setUseSoftTabs = function(useSoftTabs) { if (this.$useSoftTabs === useSoftTabs) return; @@ -7263,22 +7329,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseSoftTabs() -> Boolean - * - * Returns `true` if soft tabs are being used, `false` otherwise. + * EditSession.getUseSoftTabs() -> Boolean + * + * Returns `true` if soft tabs are being used, `false` otherwise. * - **/ + **/ this.getUseSoftTabs = function() { return this.$useSoftTabs; }; this.$tabSize = 4; /** - * EditSession.setTabSize(tabSize) - * - tabSize (Number): The new tab size - * + * EditSession.setTabSize(tabSize) + * - tabSize (Number): The new tab size + * * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - **/ + **/ this.setTabSize = function(tabSize) { if (isNaN(tabSize) || this.$tabSize === tabSize) return; @@ -7288,32 +7354,32 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getTabSize() -> Number - * - * Returns the current tab size. - **/ + * EditSession.getTabSize() -> Number + * + * Returns the current tab size. + **/ this.getTabSize = function() { return this.$tabSize; }; /** - * EditSession.isTabStop(position) -> Boolean - * - position (Object): The position to check - * + * EditSession.isTabStop(position) -> Boolean + * - position (Object): The position to check + * * Returns `true` if the character at the position is a soft tab. - **/ + **/ this.isTabStop = function(position) { return this.$useSoftTabs && (position.column % this.$tabSize == 0); }; this.$overwrite = false; /** - * EditSession.setOverwrite(overwrite) - * - overwrite (Boolean): Defines wheter or not to set overwrites - * + * EditSession.setOverwrite(overwrite) + * - overwrite (Boolean): Defines wheter or not to set overwrites + * * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * - **/ + **/ this.setOverwrite = function(overwrite) { if (this.$overwrite == overwrite) return; @@ -7322,39 +7388,39 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getOverwrite() -> Boolean - * - * Returns `true` if overwrites are enabled; `false` otherwise. - **/ + * EditSession.getOverwrite() -> Boolean + * + * Returns `true` if overwrites are enabled; `false` otherwise. + **/ this.getOverwrite = function() { return this.$overwrite; }; /** - * EditSession.toggleOverwrite() - * - * Sets the value of overwrite to the opposite of whatever it currently is. - **/ + * EditSession.toggleOverwrite() + * + * Sets the value of overwrite to the opposite of whatever it currently is. + **/ this.toggleOverwrite = function() { this.setOverwrite(!this.$overwrite); }; /** - * EditSession.getBreakpoints() -> Array - * - * Returns an array of numbers, indicating which rows have breakpoints. - **/ + * EditSession.getBreakpoints() -> Array + * + * Returns an array of numbers, indicating which rows have breakpoints. + **/ this.getBreakpoints = function() { return this.$breakpoints; }; /** - * EditSession.setBreakpoints(rows) - * - rows (Array): An array of row indicies - * + * EditSession.setBreakpoints(rows) + * - rows (Array): An array of row indicies + * * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * - **/ + **/ this.setBreakpoints = function(rows) { this.$breakpoints = []; for (var i=0; i Number - * - range (Range): Define the range of the marker + * EditSession.addMarker(range, clazz, type = "line", inFront) -> Number + * - range (Range): Define the range of the marker * - clazz (String): Set the CSS class for the marker * - type (Function | String): Identify the type of the marker * - inFront (Boolean): Set to `true` to establish a front marker * - * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. + * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. * - **/ + **/ this.addMarker = function(range, clazz, type, inFront) { var id = this.$markerId++; @@ -7428,12 +7494,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.removeMarker(markerId) - * - markerId (Number): A number representing a marker + * EditSession.removeMarker(markerId) + * - markerId (Number): A number representing a marker * * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. - * - **/ + * + **/ this.removeMarker = function(markerId) { var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId]; if (!marker) @@ -7447,12 +7513,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMarkers(inFront) -> Array - * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers + * EditSession.getMarkers(inFront) -> Array + * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers * * Returns an array containing the IDs of all the markers, either front or back. - * - **/ + * + **/ this.getMarkers = function(inFront) { return inFront ? this.$frontMarkers : this.$backMarkers; }; @@ -7467,11 +7533,11 @@ var EditSession = function(text, mode) { * } */ /** - * EditSession.setAnnotations(annotations) - * - annotations (Array): A list of annotations + * EditSession.setAnnotations(annotations) + * - annotations (Array): A list of annotations * - * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - **/ + * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. + **/ this.setAnnotations = function(annotations) { this.$annotations = {}; for (var i=0; i Object - * - * Returns the annotations for the `EditSession`. - **/ + * EditSession.getAnnotations() -> Object + * + * Returns the annotations for the `EditSession`. + **/ this.getAnnotations = function() { return this.$annotations || {}; }; /** - * EditSession.clearAnnotations() - * - * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. - **/ + * EditSession.clearAnnotations() + * + * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. + **/ this.clearAnnotations = function() { this.$annotations = {}; this._emit("changeAnnotation", {}); }; /** internal, hide - * EditSession.$detectNewLine(text) - * - text (String): A block of text - * + * EditSession.$detectNewLine(text) + * - text (String): A block of text + * * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. * - **/ + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r?\n)/m); if (match) { @@ -7521,13 +7587,13 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWordRange(row, column) -> Range - * - row (Number): The row to start at + * EditSession.getWordRange(row, column) -> Range + * - row (Number): The row to start at * - column (Number): The column to start at * - * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. * - **/ + **/ this.getWordRange = function(row, column) { var line = this.getLine(row); @@ -7560,12 +7626,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getAWordRange(row, column) -> Range - * - row (Number): The row number to start from + * EditSession.getAWordRange(row, column) -> Range + * - row (Number): The row number to start from * - column (Number): The column number to start from - * + * * Gets the range of a word, including its right whitespace. - **/ + **/ this.getAWordRange = function(row, column) { var wordRange = this.getWordRange(row, column); var line = this.getLine(wordRange.end.row); @@ -7577,20 +7643,20 @@ var EditSession = function(text, mode) { }; /** related to: Document.setNewLineMode - * EditSession.setNewLineMode(newLineMode) - * - newLineMode (String): {:Document.setNewLineMode.param} + * EditSession.setNewLineMode(newLineMode) + * - newLineMode (String): {:Document.setNewLineMode.param} * - * {:Document.setNewLineMode.desc} - **/ + * {:Document.setNewLineMode.desc} + **/ this.setNewLineMode = function(newLineMode) { this.doc.setNewLineMode(newLineMode); }; /** related to: Document.getNewLineMode - * EditSession.getNewLineMode() -> String - * - * Returns the current new line mode. - **/ + * EditSession.getNewLineMode() -> String + * + * Returns the current new line mode. + **/ this.getNewLineMode = function() { return this.doc.getNewLineMode(); }; @@ -7598,12 +7664,12 @@ var EditSession = function(text, mode) { this.$useWorker = true; /** - * EditSession.setUseWorker(useWorker) - * - useWorker (Boolean): Set to `true` to use a worker - * + * EditSession.setUseWorker(useWorker) + * - useWorker (Boolean): Set to `true` to use a worker + * * Identifies if you want to use a worker for the `EditSession`. * - **/ + **/ this.setUseWorker = function(useWorker) { if (this.$useWorker == useWorker) return; @@ -7616,19 +7682,19 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWorker() -> Boolean - * - * Returns `true` if workers are being used. - **/ + * EditSession.getUseWorker() -> Boolean + * + * Returns `true` if workers are being used. + **/ this.getUseWorker = function() { return this.$useWorker; }; /** - * EditSession@onReloadTokenizer(e) - * - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ + * EditSession@onReloadTokenizer(e) + * + * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. + **/ this.onReloadTokenizer = function(e) { var rows = e.data; this.bgTokenizer.start(rows.first); @@ -7639,7 +7705,7 @@ var EditSession = function(text, mode) { this._loadMode = function(mode, callback) { if (this.$modes[mode]) return callback(this.$modes[mode]); - + var _self = this; var module; try { @@ -7647,16 +7713,17 @@ var EditSession = function(text, mode) { } catch (e) {}; if (module) return done(module); - + fetch(function() { require([mode], done); }); - + function done(module) { if (_self.$modes[mode]) return callback(_self.$modes[mode]); - + _self.$modes[mode] = new module.Mode(); + _self.$modes[mode].$id = mode; _self._emit("loadmode", { name: mode, mode: _self.$modes[mode] @@ -7667,40 +7734,48 @@ var EditSession = function(text, mode) { function fetch(callback) { if (!config.get("packaged")) return callback(); - + var base = mode.split("/").pop(); var filename = config.get("modePath") + "/mode-" + base + config.get("suffix"); net.loadScript(filename, callback); } }; + /** + * EditSession.setMode(mode) + * - mode (TextMode): Set a new text mode + * + * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. + * + **/ this.$mode = null; - this.$origMode = null; - /** - * EditSession.setMode(mode) - * - mode (TextMode): Set a new text mode - * - * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * - **/ + this.$modeId = null; this.setMode = function(mode) { - this.$origMode = mode; - // load on demand if (typeof mode === "string") { + if (this.$modeId == mode) + return; + + this.$modeId = mode; var _self = this; this._loadMode(mode, function(module) { - if (_self.$origMode !== mode) + if (_self.$modeId !== mode) return; - + _self.setMode(module); }); return; + } else if (mode == null) { + mode = "ace/mode/text" + this.$modeId = mode; + this.$modes[mode] = this.$modes[mode] || (new TextMode()); + this.setMode(this.$modes[mode]); + return; } - + if (this.$mode === mode) return; this.$mode = mode; - + this.$modeId = mode.$id; this.$stopWorker(); @@ -7767,21 +7842,21 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getMode() -> TextMode - * - * Returns the current text mode. - **/ + * EditSession.getMode() -> TextMode + * + * Returns the current text mode. + **/ this.getMode = function() { return this.$mode; }; - + this.$scrollTop = 0; /** - * EditSession.setScrollTop(scrollTop) - * - scrollTop (Number): The new scroll top value + * EditSession.setScrollTop(scrollTop) + * - scrollTop (Number): The new scroll top value * - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - **/ + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. + **/ this.setScrollTop = function(scrollTop) { scrollTop = Math.round(Math.max(0, scrollTop)); if (this.$scrollTop === scrollTop) @@ -7792,20 +7867,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollTop() -> Number - * - * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - **/ + * EditSession.getScrollTop() -> Number + * + * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} + **/ this.getScrollTop = function() { return this.$scrollTop; }; - + this.$scrollLeft = 0; /** - * EditSession.setScrollLeft(scrollLeft) - * - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - **/ + * EditSession.setScrollLeft(scrollLeft) + * + * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + **/ this.setScrollLeft = function(scrollLeft) { scrollLeft = Math.round(Math.max(0, scrollLeft)); if (this.$scrollLeft === scrollLeft) @@ -7816,29 +7891,29 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScrollLeft() -> Number - * - * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - **/ + * EditSession.getScrollLeft() -> Number + * + * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} + **/ this.getScrollLeft = function() { return this.$scrollLeft; }; /** - * EditSession.getWidth() -> Number - * - * Returns the width of the document. - **/ + * EditSession.getWidth() -> Number + * + * Returns the width of the document. + **/ this.getWidth = function() { this.$computeWidth(); return this.width; }; /** - * EditSession.getScreenWidth() -> Number - * - * Returns the width of the screen. - **/ + * EditSession.getScreenWidth() -> Number + * + * Returns the width of the screen. + **/ this.getScreenWidth = function() { this.$computeWidth(); return this.screenWidth; @@ -7884,18 +7959,18 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLine - * EditSession.getLine(row) -> String - * - row (Number): The row to retrieve from - * + * EditSession.getLine(row) -> String + * - row (Number): The row to retrieve from + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.doc.getLine(row); }; /** related to: Document.getLines - * EditSession.getLines(firstRow, lastRow) -> Array + * EditSession.getLines(firstRow, lastRow) -> Array * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve * @@ -7907,7 +7982,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getLength - * EditSession.getLength()-> Number + * EditSession.getLength()-> Number * * Returns the number of rows in the document. **/ @@ -7916,7 +7991,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.getTextRange - * EditSession.getTextRange(range) -> Array + * EditSession.getTextRange(range) -> Array * - range (String): The range to work with * * {:Document.getTextRange.desc} @@ -7926,7 +8001,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insert - * EditSession.insert(position, text) -> Number + * EditSession.insert(position, text) -> Number * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. @@ -7940,7 +8015,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.remove - * EditSession.remove(range) -> Object + * EditSession.remove(range) -> Object * - range (Range): A specified Range to remove * + (Object): The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * @@ -7953,12 +8028,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.undoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.undoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): [If `true`, doesn't select the range of where the change occured]{: #dontSelect} * - * Reverts previous changes to your document. - **/ + * Reverts previous changes to your document. + **/ this.undoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -7986,12 +8061,12 @@ var EditSession = function(text, mode) { }; /** - * EditSession.redoChanges(deltas, dontSelect) -> Range - * - deltas (Array): An array of previous changes + * EditSession.redoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes * - dontSelect (Boolean): {:dontSelect} * - * Re-implements a previously undone change to your document. - **/ + * Re-implements a previously undone change to your document. + **/ this.redoChanges = function(deltas, dontSelect) { if (!deltas.length) return; @@ -8015,20 +8090,20 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUndoSelect(enable) - * - enable (Boolean): If `true`, selects the range of the reinserted change + * EditSession.setUndoSelect(enable) + * - enable (Boolean): If `true`, selects the range of the reinserted change * - * ENables or disables highlighting of the range where an undo occured. - **/ + * ENables or disables highlighting of the range where an undo occured. + **/ this.setUndoSelect = function(enable) { this.$undoSelect = enable; }; /** internal, hide - * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range - * - * - **/ + * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range + * + * + **/ this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { function isInsert(delta) { var insert = @@ -8084,7 +8159,7 @@ var EditSession = function(text, mode) { }, /** related to: Document.replace - * EditSession.replace(range, text) -> Object + * EditSession.replace(range, text) -> Object * - range (Range): A specified Range to replace * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this:
@@ -8102,17 +8177,17 @@ var EditSession = function(text, mode) { }; /** - * EditSession.moveText(fromRange, toPosition) -> Range - * - fromRange (Range): The range of text you want moved within the document + * EditSession.moveText(fromRange, toPosition) -> Range + * - fromRange (Range): The range of text you want moved within the document * - toPosition (Object): The location (row and column) where you want to move the text to * + (Range): The new range where the text was moved to. * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: * * { row: newRowLocation, column: newColumnLocation } - * + * * * - **/ + **/ this.moveText = function(fromRange, toPosition) { var text = this.getTextRange(fromRange); this.remove(fromRange); @@ -8144,16 +8219,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.indentRows(startRow, endRow, indentString) - * - startRow (Number): Starting row + * EditSession.indentRows(startRow, endRow, indentString) + * - startRow (Number): Starting row * - endRow (Number): Ending row * - indentString (String): The indent token * - * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. + * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. * * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. * - **/ + **/ this.indentRows = function(startRow, endRow, indentString) { indentString = indentString.replace(/\t/g, this.getTabString()); for (var row=startRow; row<=endRow; row++) @@ -8192,15 +8267,15 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesUp(firstRow, lastRow) -> Number - * - firstRow (Number): The starting row to move up + * EditSession.moveLinesUp(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to move up * - lastRow (Number): The final row to move up - * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. * * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. * * - **/ + **/ this.moveLinesUp = function(firstRow, lastRow) { if (firstRow <= 0) return 0; @@ -8210,7 +8285,7 @@ var EditSession = function(text, mode) { }; /** related to: Document.insertLines - * EditSession.moveLinesDown(firstRow, lastRow) -> Number + * EditSession.moveLinesDown(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to move down * - lastRow (Number): The final row to move down * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. @@ -8227,16 +8302,16 @@ var EditSession = function(text, mode) { }; /** - * EditSession.duplicateLines(firstRow, lastRow) -> Number + * EditSession.duplicateLines(firstRow, lastRow) -> Number * - firstRow (Number): The starting row to duplicate * - lastRow (Number): The final row to duplicate - * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. * * Duplicates all the text between `firstRow` and `lastRow`. * * * - **/ + **/ this.duplicateLines = function(firstRow, lastRow) { var firstRow = this.$clipRowToDocument(firstRow); var lastRow = this.$clipRowToDocument(lastRow); @@ -8292,7 +8367,7 @@ var EditSession = function(text, mode) { range.start.column ); } - + var len = this.doc.getLength() - 1; if (range.end.row > len) { range.end.row = len; @@ -8315,11 +8390,11 @@ var EditSession = function(text, mode) { }; /** - * EditSession.setUseWrapMode(useWrapMode) - * - useWrapMode (Boolean): Enable (or disable) wrap mode + * EditSession.setUseWrapMode(useWrapMode) + * - useWrapMode (Boolean): Enable (or disable) wrap mode * - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - **/ + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. + **/ this.setUseWrapMode = function(useWrapMode) { if (useWrapMode != this.$useWrapMode) { this.$useWrapMode = useWrapMode; @@ -8341,10 +8416,10 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getUseWrapMode() -> Boolean - * - * Returns `true` if wrap mode is being used; `false` otherwise. - **/ + * EditSession.getUseWrapMode() -> Boolean + * + * Returns `true` if wrap mode is being used; `false` otherwise. + **/ this.getUseWrapMode = function() { return this.$useWrapMode; }; @@ -8354,12 +8429,12 @@ var EditSession = function(text, mode) { // in that direction. Or set both parameters to the same number to pin // the limit to that value. /** - * EditSession.setWrapLimitRange(min, max) - * - min (Number): The minimum wrap value (the left side wrap) + * EditSession.setWrapLimitRange(min, max) + * - min (Number): The minimum wrap value (the left side wrap) * - max (Number): The maximum wrap value (the right side wrap) * - * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. - **/ + * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. + **/ this.setWrapLimitRange = function(min, max) { if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { this.$wrapLimitRange.min = min; @@ -8371,11 +8446,11 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.adjustWrapLimit(desiredLimit) -> Boolean - * - desiredLimit (Number): The new wrap limit + * EditSession.adjustWrapLimit(desiredLimit) -> Boolean + * - desiredLimit (Number): The new wrap limit * - * This should generally only be called by the renderer when a resize is detected. - **/ + * This should generally only be called by the renderer when a resize is detected. + **/ this.adjustWrapLimit = function(desiredLimit) { var wrapLimit = this.$constrainWrapLimit(desiredLimit); if (wrapLimit != this.$wrapLimit && wrapLimit > 0) { @@ -8410,22 +8485,22 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getWrapLimit() -> Number - * - * Returns the value of wrap limit. - **/ + * EditSession.getWrapLimit() -> Number + * + * Returns the value of wrap limit. + **/ this.getWrapLimit = function() { return this.$wrapLimit; }; /** - * EditSession.getWrapLimitRange() -> Object - * - * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: + * EditSession.getWrapLimitRange() -> Object + * + * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: * * { min: wrapLimitRange_min, max: wrapLimitRange_max } * - **/ + **/ this.getWrapLimitRange = function() { // Avoid unexpected mutation by returning a copy return { @@ -8778,10 +8853,10 @@ var EditSession = function(text, mode) { } /** internal, hide - * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] - * - str (String): The string to calculate the screen width of + * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] + * - str (String): The string to calculate the screen width of * - maxScreenColumn (Number): - * - screenColumn (Number): + * - screenColumn (Number): * + ([Number]): Returns an `int[]` array with two elements:
* The first position indicates the number of columns for `str` on screen.
* The second value contains the position of the document column that this function read until. @@ -8789,7 +8864,7 @@ var EditSession = function(text, mode) { * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. * * - **/ + **/ this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { if (maxScreenColumn == 0) { return [0, 0]; @@ -8822,12 +8897,12 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowLength(row) -> Number - * - row (Number): The row number to check + * EditSession.getRowLength(row) -> Number + * - row (Number): The row number to check * * - * Returns the length of the indicated row. - **/ + * Returns the length of the indicated row. + **/ this.getRowLength = function(row) { if (!this.$useWrapMode || !this.$wrapData[row]) { return 1; @@ -8837,8 +8912,8 @@ var EditSession = function(text, mode) { } /** - * EditSession.getRowHeight(config, row) -> Number - * - config (Object): An object containing a parameter indicating the `lineHeight`. + * EditSession.getRowHeight(config, row) -> Number + * - config (Object): An object containing a parameter indicating the `lineHeight`. * - row (Number): The row number to check * * Returns the height of the indicated row. This is mostly relevant for situations where wrapping occurs, and a single line spans across multiple rows. @@ -8849,40 +8924,40 @@ var EditSession = function(text, mode) { } /** internal, hide, related to: EditSession.documentToScreenColumn - * EditSession.getScreenLastRowColumn(screenRow) -> Number - * - screenRow (Number): The screen row to check + * EditSession.getScreenLastRowColumn(screenRow) -> Number + * - screenRow (Number): The screen row to check * - * Returns the column position (on screen) for the last character in the provided row. - **/ + * Returns the column position (on screen) for the last character in the provided row. + **/ this.getScreenLastRowColumn = function(screenRow) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE) return this.documentToScreenColumn(pos.row, pos.column); }; /** internal, hide - * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number - * - docRow (Number): + * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number + * - docRow (Number): * - docColumn (Number): * - **/ + **/ this.getDocumentLastRowColumn = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.getScreenLastRowColumn(screenRow); }; /** internal, hide - * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number - * - **/ + * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number + * + **/ this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); }; /** internal, hide - * EditSession.getRowSplitData(row) -> undefined | String + * EditSession.getRowSplitData(row) -> undefined | String * - **/ + **/ this.getRowSplitData = function(row) { if (!this.$useWrapMode) { return undefined; @@ -8892,41 +8967,41 @@ var EditSession = function(text, mode) { }; /** - * EditSession.getScreenTabSize(screenColumn) -> Number + * EditSession.getScreenTabSize(screenColumn) -> Number * - screenColumn (Number): The screen column to check - * - * The distance to the next tab stop at the specified screen column. - **/ + * + * The distance to the next tab stop at the specified screen column. + **/ this.getScreenTabSize = function(screenColumn) { return this.$tabSize - screenColumn % this.$tabSize; }; /** internal, hide - * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentRow = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).row; }; /** internal, hide - * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number - * - * - **/ + * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentColumn = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).column; }; /** related to: EditSession.documentToScreenPosition - * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object - * - screenRow (Number): The screen row to check + * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object + * - screenRow (Number): The screen row to check * - screenColumn (Number): The screen column to check - * + (Object): The object returned has two properties: `row` and `column`. + * + (Object): The object returned has two properties: `row` and `column`. * * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * + * * **/ this.screenToDocumentPosition = function(screenRow, screenColumn) { @@ -9025,12 +9100,12 @@ var EditSession = function(text, mode) { }; /** related to: EditSession.screenToDocumentPosition - * EditSession.documentToScreenPosition(docRow, docColumn) -> Object - * - docRow (Number): The document row to check + * EditSession.documentToScreenPosition(docRow, docColumn) -> Object + * - docRow (Number): The document row to check * - docColumn (Number): The document column to check * + (Object): The object returned by this method has two properties: `row` and `column`. * - * Converts document coordinates to screen coordinates. {:conversionConsiderations} + * Converts document coordinates to screen coordinates. {:conversionConsiderations} * * * @@ -9139,28 +9214,28 @@ var EditSession = function(text, mode) { }; /** internal, hide - * EditSession.documentToScreenColumn(row, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenColumn(row, docColumn) -> Number + * + * + **/ this.documentToScreenColumn = function(row, docColumn) { return this.documentToScreenPosition(row, docColumn).column; }; /** internal, hide - * EditSession.documentToScreenRow(docRow, docColumn) -> Number - * - * - **/ + * EditSession.documentToScreenRow(docRow, docColumn) -> Number + * + * + **/ this.documentToScreenRow = function(docRow, docColumn) { return this.documentToScreenPosition(docRow, docColumn).row; }; /** - * EditSession.getScreenLength() -> Number - * - * Returns the length of the screen. - **/ + * EditSession.getScreenLength() -> Number + * + * Returns the length of the screen. + **/ this.getScreenLength = function() { var screenRows = 0; var fold = null; @@ -9366,7 +9441,8 @@ function deHyphenate(str) { return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); }); } -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -9455,10 +9531,10 @@ var Selection = function(session) { oop.implement(this, EventEmitter); /** - * Selection.isEmpty() -> Boolean - * - * Returns `true` if the selection is empty. - **/ + * Selection.isEmpty() -> Boolean + * + * Returns `true` if the selection is empty. + **/ this.isEmpty = function() { return (this.$isEmpty || ( this.selectionAnchor.row == this.selectionLead.row && @@ -9467,10 +9543,10 @@ var Selection = function(session) { }; /** - * Selection.isMultiLine() -> Boolean - * - * Returns `true` if the selection is a multi-line. - **/ + * Selection.isMultiLine() -> Boolean + * + * Returns `true` if the selection is a multi-line. + **/ this.isMultiLine = function() { if (this.isEmpty()) { return false; @@ -9480,7 +9556,7 @@ var Selection = function(session) { }; /** - * Selection.getCursor() -> Number + * Selection.getCursor() -> Number * * Gets the current position of the cursor. **/ @@ -9489,12 +9565,12 @@ var Selection = function(session) { }; /** - * Selection.setSelectionAnchor(row, column) - * - row (Number): The new row - * - column (Number): The new column + * Selection.setSelectionAnchor(row, column) + * - row (Number): The new row + * - column (Number): The new column * * Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event. - **/ + **/ this.setSelectionAnchor = function(row, column) { this.selectionAnchor.setPosition(row, column); @@ -9505,11 +9581,11 @@ var Selection = function(session) { }; /** related to: Anchor.getPosition - * Selection.getSelectionAnchor() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection anchor. + * Selection.getSelectionAnchor() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection anchor. * - **/ + **/ this.getSelectionAnchor = function() { if (this.$isEmpty) return this.getSelectionLead() @@ -9518,21 +9594,21 @@ var Selection = function(session) { }; /** - * Selection.getSelectionLead() -> Object - * - * Returns an object containing the `row` and `column` of the calling selection lead. - **/ + * Selection.getSelectionLead() -> Object + * + * Returns an object containing the `row` and `column` of the calling selection lead. + **/ this.getSelectionLead = function() { return this.selectionLead.getPosition(); }; /** - * Selection.shiftSelection(columns) - * - columns (Number): The number of columns to shift by - * + * Selection.shiftSelection(columns) + * - columns (Number): The number of columns to shift by + * * Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns. * - **/ + **/ this.shiftSelection = function(columns) { if (this.$isEmpty) { this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns); @@ -9555,10 +9631,10 @@ var Selection = function(session) { }; /** - * Selection.isBackwards() -> Boolean - * - * Returns `true` if the selection is going backwards in the document. - **/ + * Selection.isBackwards() -> Boolean + * + * Returns `true` if the selection is going backwards in the document. + **/ this.isBackwards = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -9566,10 +9642,10 @@ var Selection = function(session) { }; /** - * Selection.getRange() -> Range - * - * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} - **/ + * Selection.getRange() -> Range + * + * [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange} + **/ this.getRange = function() { var anchor = this.selectionAnchor; var lead = this.selectionLead; @@ -9586,10 +9662,10 @@ var Selection = function(session) { }; /** - * Selection.clearSelection() - * - * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} - **/ + * Selection.clearSelection() + * + * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} + **/ this.clearSelection = function() { if (!this.$isEmpty) { this.$isEmpty = true; @@ -9598,10 +9674,10 @@ var Selection = function(session) { }; /** - * Selection.selectAll() - * - * Selects all the text in the document. - **/ + * Selection.selectAll() + * + * Selects all the text in the document. + **/ this.selectAll = function() { var lastRow = this.doc.getLength() - 1; this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length); @@ -9609,13 +9685,13 @@ var Selection = function(session) { }; /** - * Selection.setSelectionRange(range, reverse) - * - range (Range): The range of text to select - * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not + * Selection.setSelectionRange(range, reverse) + * - range (Range): The range of text to select + * - reverse (Boolean): Indicates if the range should go backwards (`true`) or not * * Sets the selection to the provided range. * - **/ + **/ this.setSelectionRange = function(range, reverse) { if (reverse) { this.setSelectionAnchor(range.end.row, range.end.column); @@ -9636,13 +9712,13 @@ var Selection = function(session) { }; /** - * Selection.selectTo(row, column) - * - row (Number): The row to select to - * - column (Number): The column to select to + * Selection.selectTo(row, column) + * - row (Number): The row to select to + * - column (Number): The column to select to * * Moves the selection cursor to the indicated row and column. * - **/ + **/ this.selectTo = function(row, column) { this.$moveSelection(function() { this.moveCursorTo(row, column); @@ -9650,12 +9726,12 @@ var Selection = function(session) { }; /** - * Selection.selectToPosition(pos) - * - pos (Object): An object containing the row and column - * + * Selection.selectToPosition(pos) + * - pos (Object): An object containing the row and column + * * Moves the selection cursor to the row and column indicated by `pos`. * - **/ + **/ this.selectToPosition = function(pos) { this.$moveSelection(function() { this.moveCursorToPosition(pos); @@ -9663,10 +9739,10 @@ var Selection = function(session) { }; /** - * Selection.selectUp() - * - * Moves the selection up one row. - **/ + * Selection.selectUp() + * + * Moves the selection up one row. + **/ this.selectUp = function() { this.$moveSelection(this.moveCursorUp); }; @@ -9699,10 +9775,10 @@ var Selection = function(session) { }; /** - * Selection.selectLineStart() - * - * Moves the selection to the beginning of the current line. - **/ + * Selection.selectLineStart() + * + * Moves the selection to the beginning of the current line. + **/ this.selectLineStart = function() { this.$moveSelection(this.moveCursorLineStart); }; @@ -9753,34 +9829,36 @@ var Selection = function(session) { }; /** related to: EditSession.getWordRange - * Selection.selectWord() - * - * Moves the selection to highlight the entire word. - **/ + * Selection.selectWord() + * + * Moves the selection to highlight the entire word. + **/ + this.getWordRange = function(row, column) { + if (typeof column == "undefined") { + var cursor = row || this.selectionLead; + row = cursor.row; + column = cursor.column; + } + return this.session.getWordRange(row, column); + }; + this.selectWord = function() { - var cursor = this.getCursor(); - var range = this.session.getWordRange(cursor.row, cursor.column); - this.setSelectionRange(range); + this.setSelectionRange(this.getWordRange()); }; /** related to: EditSession.getAWordRange - * Selection.selectAWord() - * - * Selects a word, including its right whitespace. - **/ + * Selection.selectAWord() + * + * Selects a word, including its right whitespace. + **/ this.selectAWord = function() { var cursor = this.getCursor(); var range = this.session.getAWordRange(cursor.row, cursor.column); this.setSelectionRange(range); }; - /** - * Selection.selectLine() - * - * Selects the entire line. - **/ - this.selectLine = function() { - var rowStart = this.selectionLead.row; + this.getLineRange = function(row, excludeLastChar) { + var rowStart = typeof row == "number" ? row : this.selectionLead.row; var rowEnd; var foldLine = this.session.getFoldLine(rowStart); @@ -9790,35 +9868,44 @@ var Selection = function(session) { } else { rowEnd = rowStart; } - this.setSelectionAnchor(rowStart, 0); - this.$moveSelection(function() { - this.moveCursorTo(rowEnd + 1, 0); - }); + if (excludeLastChar) + return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length); + else + return new Range(rowStart, 0, rowEnd + 1, 0); + }; + + /** + * Selection.selectLine() + * + * Selects the entire line. + **/ + this.selectLine = function() { + this.setSelectionRange(this.getLineRange()); }; /** - * Selection.moveCursorUp() - * - * Moves the cursor up one row. - **/ + * Selection.moveCursorUp() + * + * Moves the cursor up one row. + **/ this.moveCursorUp = function() { this.moveCursorBy(-1, 0); }; /** - * Selection.moveCursorDown() + * Selection.moveCursorDown() * * Moves the cursor down one row. - **/ + **/ this.moveCursorDown = function() { this.moveCursorBy(1, 0); }; /** - * Selection.moveCursorLeft() + * Selection.moveCursorLeft() * * Moves the cursor left one column. - **/ + **/ this.moveCursorLeft = function() { var cursor = this.selectionLead.getPosition(), fold; @@ -9841,7 +9928,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorRight() + * Selection.moveCursorRight() * * Moves the cursor right one column. **/ @@ -9867,7 +9954,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineStart() + * Selection.moveCursorLineStart() * * Moves the cursor to the start of the line. **/ @@ -9900,7 +9987,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorLineEnd() + * Selection.moveCursorLineEnd() * * Moves the cursor to the end of the line. **/ @@ -9915,7 +10002,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileEnd() + * Selection.moveCursorFileEnd() * * Moves the cursor to the end of the file. **/ @@ -9926,7 +10013,7 @@ var Selection = function(session) { }; /** - * Selection.moveCursorFileStart() + * Selection.moveCursorFileStart() * * Moves the cursor to the start of the file. **/ @@ -9935,11 +10022,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordRight() + * Selection.moveCursorLongWordRight() * * Moves the cursor to the word on the right. **/ - this.moveCursorWordRight = function() { + this.moveCursorLongWordRight = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; var line = this.doc.getLine(row); @@ -9982,11 +10069,11 @@ var Selection = function(session) { }; /** - * Selection.moveCursorWordLeft() + * Selection.moveCursorLongWordLeft() * * Moves the cursor to the word on the left. **/ - this.moveCursorWordLeft = function() { + this.moveCursorLongWordLeft = function() { var row = this.selectionLead.row; var column = this.selectionLead.column; @@ -10032,8 +10119,94 @@ var Selection = function(session) { this.moveCursorTo(row, column); }; + this.$shortWordEndIndex = function(rightOfCursor) { + var match, index = 0, ch; + var whitespaceRe = /\s/; + var tokenRe = this.session.tokenRe; + + tokenRe.lastIndex = 0; + if (match = this.session.tokenRe.exec(rightOfCursor)) { + index = this.session.tokenRe.lastIndex; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + + if (index <= 1) { + tokenRe.lastIndex = 0; + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + tokenRe.lastIndex = 0; + index ++; + if (whitespaceRe.test(ch)) { + if (index > 2) { + index-- + break; + } else { + while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) + index ++; + if (index > 2) + break + } + } + } + } + } + tokenRe.lastIndex = 0; + + return index; + }; + + this.moveCursorShortWordRight = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + var line = this.doc.getLine(row); + var rightOfCursor = line.substring(column); + + var fold = this.session.getFoldAt(row, column, 1); + if (fold) + return this.moveCursorTo(fold.end.row, fold.end.column); + + if (column == line.length) + return this.moveCursorRight(); + + var index = this.$shortWordEndIndex(rightOfCursor); + + this.moveCursorTo(row, column + index); + }; + + this.moveCursorShortWordLeft = function() { + var row = this.selectionLead.row; + var column = this.selectionLead.column; + + var fold; + if (fold = this.session.getFoldAt(row, column, -1)) + return this.moveCursorTo(fold.start.row, fold.start.column); + + if (column == 0) + return this.moveCursorLeft(); + + var str = this.session.getLine(row).substring(0, column); + var leftOfCursor = lang.stringReverse(str); + var index = this.$shortWordEndIndex(leftOfCursor); + + return this.moveCursorTo(row, column - index); + }; + + this.moveCursorWordRight = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordRight(); + else + this.moveCursorShortWordRight(); + }; + + this.moveCursorWordLeft = function() { + if (this.session.$selectLongWords) + this.moveCursorLongWordLeft(); + else + this.moveCursorShortWordLeft(); + }; + /** related to: EditSession.documentToScreenPosition - * Selection.moveCursorBy(rows, chars) + * Selection.moveCursorBy(rows, chars) * - rows (Number): The number of rows to move by * - chars (Number): The number of characters to move by * @@ -10059,23 +10232,23 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToPosition(position) - * - position (Object): The position to move to - * + * Selection.moveCursorToPosition(position) + * - position (Object): The position to move to + * * Moves the selection to the position indicated by its `row` and `column`. - **/ + **/ this.moveCursorToPosition = function(position) { this.moveCursorTo(position.row, position.column); }; /** - * Selection.moveCursorTo(row, column, keepDesiredColumn) - * - row (Number): The row to move to - * - column (Number): The column to move to + * Selection.moveCursorTo(row, column, keepDesiredColumn) + * - row (Number): The row to move to + * - column (Number): The column to move to * - keepDesiredColumn (Boolean): [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} * * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} - **/ + **/ this.moveCursorTo = function(row, column, keepDesiredColumn) { // Ensure the row/column is not inside of a fold. var fold = this.session.getFoldAt(row, column, 1); @@ -10093,13 +10266,13 @@ var Selection = function(session) { }; /** - * Selection.moveCursorToScreen(row, column, keepDesiredColumn) + * Selection.moveCursorToScreen(row, column, keepDesiredColumn) * - row (Number): The row to move to * - column (Number): The column to move to * - keepDesiredColumn (Boolean): {:preventUpdateBool} * * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} - **/ + **/ this.moveCursorToScreen = function(row, column, keepDesiredColumn) { var pos = this.session.screenToDocumentPosition(row, column); this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); @@ -11341,7 +11514,8 @@ var Behaviour = function() { }).call(Behaviour.prototype); exports.Behaviour = Behaviour; -});__ace_shadowed__.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { +}); +__ace_shadowed__.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) { "use strict"; /* @@ -11447,7 +11621,8 @@ function addUnicodePackage (pack) { exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); }; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -11527,11 +11702,11 @@ var Document = function(text) { oop.implement(this, EventEmitter); /** - * Document.setValue(text) -> Void - * - text (String): The text to use - * + * Document.setValue(text) -> Void + * - text (String): The text to use + * * Replaces all the lines in the current `Document` with the value of `text`. - **/ + **/ this.setValue = function(text) { var len = this.getLength(); this.remove(new Range(0, 0, len, this.getLine(len-1).length)); @@ -11539,21 +11714,21 @@ var Document = function(text) { }; /** - * Document.getValue() -> String - * - * Returns all the lines in the document as a single string, split by the new line character. - **/ + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. + **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Document.createAnchor(row, column) -> Anchor - * - row (Number): The row number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use * - column (Number): The column number to use * - * Creates a new `Anchor` to define a floating point in the document. - **/ + * Creates a new `Anchor` to define a floating point in the document. + **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; @@ -11580,10 +11755,10 @@ var Document = function(text) { /** internal, hide - * Document.$detectNewLine(text) -> Void - * - * - **/ + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); if (match) { @@ -11643,82 +11818,81 @@ var Document = function(text) { }; /** - * Document.isNewLine(text) -> Boolean - * - text (String): The text to check + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check * - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). + * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). * - **/ + **/ this.isNewLine = function(text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; /** - * Document.getLine(row) -> String - * - row (Number): The row index to retrieve - * + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document * - **/ + **/ this.getLine = function(row) { return this.$lines[row] || ""; }; /** - * Document.getLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row index to retrieve + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve * - lastRow (Number): The final row index to retrieve - * + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. * - **/ + **/ this.getLines = function(firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; /** - * Document.getAllLines() -> [String] - * - * Returns all lines in the document as string array. Warning: The caller should not modify this array! - **/ + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! + **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** - * Document.getLength() -> Number - * - * Returns the number of rows in the document. - **/ + * Document.getLength() -> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.$lines.length; }; /** - * Document.getTextRange(range) -> String - * - range (Range): The range to work with - * + * Document.getTextRange(range) -> String + * - range (Range): The range to work with + * * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - **/ + **/ this.getTextRange = function(range) { if (range.start.row == range.end.row) { return this.$lines[range.start.row].substring(range.start.column, range.end.column); } else { - var lines = []; - lines.push(this.$lines[range.start.row].substring(range.start.column)); - lines.push.apply(lines, this.getLines(range.start.row+1, range.end.row-1)); - lines.push(this.$lines[range.end.row].substring(0, range.end.column)); + var lines = this.getLines(range.start.row+1, range.end.row-1); + lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); + lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); return lines.join(this.getNewLineCharacter()); } }; /** internal, hide - * Document.$clipPosition(position) -> Number - * + * Document.$clipPosition(position) -> Number * - **/ + * + **/ this.$clipPosition = function(position) { var length = this.getLength(); if (position.row >= length) { @@ -11729,14 +11903,14 @@ var Document = function(text) { }; /** - * Document.insert(position, text) -> Number - * - position (Number): The position to start inserting at + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at * - text (String): A chunk of text to insert - * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. * Inserts a block of `text` and the indicated `position`. * * - **/ + **/ this.insert = function(position, text) { if (!text || text.length === 0) return position; @@ -11761,10 +11935,10 @@ var Document = function(text) { }; /** - * Document.insertLines(row, lines) -> Object - * - row (Number): The index of the row to insert at + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at * - lines (Array): An array of strings - * + (Object): Returns an object containing the final row and column, like this:
+ * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}```
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
* ```{row: row, column: 0}``` @@ -11772,7 +11946,7 @@ var Document = function(text) { * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. * * - **/ + **/ this.insertLines = function(row, lines) { if (lines.length == 0) return {row: row, column: 0}; @@ -11792,16 +11966,16 @@ var Document = function(text) { }; /** - * Document.insertNewLine(position) -> Object - * - position (String): The position to insert at - * + (Object): Returns an object containing the final row and column, like this:
+ * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
* ```{row: endRow, column: 0}``` * * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. * * * - **/ + **/ this.insertNewLine = function(position) { position = this.$clipPosition(position); var line = this.$lines[position.row] || ""; @@ -11825,7 +11999,7 @@ var Document = function(text) { }; /** - * Document.insertInLine(position, text) -> Object | Number + * Document.insertInLine(position, text) -> Object | Number * - position (Number): The position to insert at * - text (String): A chunk of text * + (Object): Returns an object containing the final row and column, like this:
@@ -11836,7 +12010,7 @@ var Document = function(text) { * * * - **/ + **/ this.insertInLine = function(position, text) { if (text.length == 0) return position; @@ -11862,14 +12036,14 @@ var Document = function(text) { }; /** - * Document.remove(range) -> Object - * - range (Range): A specified Range to remove - * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. * * Removes the `range` from the document. * * - **/ + **/ this.remove = function(range) { // clip to document range.start = this.$clipPosition(range.start); @@ -11903,7 +12077,7 @@ var Document = function(text) { }; /** - * Document.removeInLine(row, startColumn, endColumn) -> Object + * Document.removeInLine(row, startColumn, endColumn) -> Object * - row (Number): The row to remove from * - startColumn (Number): The column to start removing at * - endColumn (Number): The column to stop removing at @@ -11933,15 +12107,15 @@ var Document = function(text) { }; /** - * Document.removeLines(firstRow, lastRow) -> [String] - * - firstRow (Number): The first row to be removed + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed * - lastRow (Number): The last row to be removed * + ([String]): Returns all the removed lines. * * Removes a range of full lines. This method also triggers the `'change'` event. * * - **/ + **/ this.removeLines = function(firstRow, lastRow) { var range = new Range(firstRow, 0, lastRow + 1, 0); var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); @@ -11957,12 +12131,12 @@ var Document = function(text) { }; /** - * Document.removeNewLine(row) -> Void - * - row (Number): The row to check - * + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * - **/ + **/ this.removeNewLine = function(row) { var firstLine = this.getLine(row); var secondLine = this.getLine(row+1); @@ -11981,9 +12155,9 @@ var Document = function(text) { }; /** - * Document.replace(range, text) -> Object + * Document.replace(range, text) -> Object * - range (Range): A specified Range to replace - * - text (String): The new text to use as a replacement + * - text (String): The new text to use as a replacement * + (Object): Returns an object containing the final row and column, like this: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. @@ -11991,7 +12165,7 @@ var Document = function(text) { * * Replaces a range in the document with the new `text`. * - **/ + **/ this.replace = function(range, text) { if (text.length == 0 && range.isEmpty()) return range.start; @@ -12013,10 +12187,10 @@ var Document = function(text) { }; /** - * Document.applyDeltas(deltas) -> Void - * - * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.applyDeltas = function(deltas) { for (var i=0; i Void - * - * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ + * Document.revertDeltas(deltas) -> Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. + **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { var delta = deltas[i]; @@ -13508,7 +13682,9 @@ function FoldLine(foldData, folds) { && fold.start.column != column && fold.start.row != row) { - throw "Moving characters inside of a fold should never be reached"; + //throwing here breaks whole editor + //@todo properly handle this + window.console && window.console.log(row, column, fold); } else if (fold.start.row == row) { folds = this.folds; var i = folds.indexOf(fold); @@ -13602,7 +13778,8 @@ function FoldLine(foldData, folds) { }).call(FoldLine.prototype); exports.FoldLine = FoldLine; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -13717,7 +13894,8 @@ var Fold = exports.Fold = function(range, placeholder) { }).call(Fold.prototype); -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -14537,7 +14715,7 @@ var CommandManager = function(platform, commands) { this.addCommands(commands); this.setDefaultHandler("exec", function(e) { - e.command.exec(e.editor, e.args || {}); + return e.command.exec(e.editor, e.args || {}); }); }; @@ -14557,8 +14735,18 @@ oop.inherits(CommandManager, HashHandler); if (editor && editor.$readOnly && !command.readOnly) return false; - this._emit("exec", {editor: editor, command: command, args: args}); - return true; + try { + var retvalue = this._emit("exec", { + editor: editor, + command: command, + args: args + }); + } catch (e) { + window.console && window.console.log(e); + return true; + } + + return retvalue === false ? false : true; }; this.toggleRecording = function() { @@ -14700,6 +14888,18 @@ function HashHandler(config, platform) { } }; + this.bindKey = function(key, command) { + if(!key) + return; + + var ckb = this.commmandKeyBinding; + key.split("|").forEach(function(keyPart) { + var binding = this.parseKeys(keyPart, command); + var hashId = binding.hashId; + (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; + }, this); + }; + this.addCommands = function(commands) { commands && Object.keys(commands).forEach(function(name) { var command = commands[name]; @@ -14722,18 +14922,6 @@ function HashHandler(config, platform) { }, this); }; - this.bindKey = function(key, command) { - if(!key) - return; - - var ckb = this.commmandKeyBinding; - key.split("|").forEach(function(keyPart) { - var binding = parseKeys(keyPart, command); - var hashId = binding.hashId; - (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; - }); - }; - this.bindKeys = function(keyList) { Object.keys(keyList).forEach(function(key) { this.bindKey(key, keyList[key]); @@ -14749,10 +14937,10 @@ function HashHandler(config, platform) { this.bindKey(key, command); }; - function parseKeys(keys, val, ret) { + this.parseKeys = function(keys, val) { var key; var hashId = 0; - var parts = splitSafe(keys.toLowerCase()); + var parts = keys.toLowerCase().trim().split(/\s*\-\s*/); for (var i = 0, l = parts.length; i < l; i++) { if (keyUtil.KEY_MODS[parts[i]]) @@ -14765,17 +14953,12 @@ function HashHandler(config, platform) { key: key, hashId: hashId }; - } - - function splitSafe(s) { - return (s.trim() - .split(new RegExp("[\\s ]*\\-[\\s ]*", "g"), 999)); - } + }; this.findKeyCommand = function findKeyCommand(hashId, keyString) { var ckbr = this.commmandKeyBinding; return ckbr[hashId] && ckbr[hashId][keyString.toLowerCase()]; - } + }; this.handleKeyboard = function(data, hashId, keyString, keyCode) { return { @@ -14786,7 +14969,8 @@ function HashHandler(config, platform) { }).call(HashHandler.prototype) exports.HashHandler = HashHandler; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -15031,6 +15215,7 @@ var VirtualRenderer = function(container, theme) { this.$gutterLayer = new GutterLayer(this.$gutter); this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true)); + this.setFadeFoldWidgets(true); this.$markerBack = new MarkerLayer(this.content); @@ -15046,14 +15231,15 @@ var VirtualRenderer = function(container, theme) { this.$cursorPadding = 8; // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = true; - this.$horizScrollAlwaysVisible = true; + this.$horizScroll = false; + this.$horizScrollAlwaysVisible = false; this.$animatedScroll = false; this.scrollBar = new ScrollBar(container); this.scrollBar.addEventListener("scroll", function(e) { - _self.session.setScrollTop(e.data); + if (!_self.$inScrollAnimation) + _self.session.setScrollTop(e.data); }); this.scrollTop = 0; @@ -15064,12 +15250,9 @@ var VirtualRenderer = function(container, theme) { _self.scrollLeft = scrollLeft; _self.session.setScrollLeft(scrollLeft); - if (scrollLeft == 0) { - _self.$gutter.className = "ace_gutter"; - } - else { - _self.$gutter.className = "ace_gutter horscroll"; - } + _self.scroller.className = scrollLeft == 0 + ? "ace_scroller" + : "ace_scroller horscroll"; }); this.cursorPos = { @@ -15141,12 +15324,16 @@ var VirtualRenderer = function(container, theme) { **/ this.setSession = function(session) { this.session = session; + + this.scroller.className = "ace_scroller"; + this.$cursorLayer.setSession(session); this.$markerBack.setSession(session); this.$markerFront.setSession(session); this.$gutterLayer.setSession(session); this.$textLayer.setSession(session); this.$loop.schedule(this.CHANGE_FULL); + }; /** @@ -15365,6 +15552,17 @@ var VirtualRenderer = function(container, theme) { this.onResize(true); }; + this.getFadeFoldWidgets = function(){ + return dom.hasCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + + this.setFadeFoldWidgets = function(show) { + if (show) + dom.addCssClass(this.$gutter, "ace_fade-fold-widgets"); + else + dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets"); + }; + this.$updatePrintMargin = function() { var containerEl; @@ -15808,18 +16006,18 @@ var VirtualRenderer = function(container, theme) { this.$cursorLayer.showCursor(); }; - this.scrollSelectionIntoView = function(anchor, lead) { + this.scrollSelectionIntoView = function(anchor, lead, offset) { // first scroll anchor into view then scroll lead into view - this.scrollCursorIntoView(anchor); - this.scrollCursorIntoView(lead); + this.scrollCursorIntoView(anchor, offset); + this.scrollCursorIntoView(lead, offset); }; /** - * VirtualRenderer.scrollCursorIntoView() -> Void + * VirtualRenderer.scrollCursorIntoView(cursor, offset) -> Void * * Scrolls the cursor into the first visibile area of the editor **/ - this.scrollCursorIntoView = function(cursor) { + this.scrollCursorIntoView = function(cursor, offset) { // the editor is not visible if (this.$size.scrollerHeight === 0) return; @@ -15830,10 +16028,12 @@ var VirtualRenderer = function(container, theme) { var top = pos.top; if (this.scrollTop > top) { + if (offset) + top -= offset * this.$size.scrollerHeight; this.session.setScrollTop(top); - } - - if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + } else if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) { + if (offset) + top += offset * this.$size.scrollerHeight; this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); } @@ -15843,9 +16043,7 @@ var VirtualRenderer = function(container, theme) { if (left < this.$padding + 2 * this.layerConfig.characterWidth) left = 0; this.session.setScrollLeft(left); - } - - if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { + } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); } }; @@ -15896,36 +16094,70 @@ var VirtualRenderer = function(container, theme) { this.session.setScrollTop(row * this.lineHeight); }; + this.STEPS = 8; + this.$calcSteps = function(fromValue, toValue){ + var i = 0; + var l = this.STEPS; + var steps = []; + + var func = function(t, x_min, dx) { + return dx * (Math.pow(t - 1, 3) + 1) + x_min; + }; + + for (i = 0; i < l; ++i) + steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); + + return steps; + }; + /** - * VirtualRenderer.scrollToLine(line, center) -> Void + * VirtualRenderer.scrollToLine(line, center, animate, callback) -> Void * - line (Number): A line number * - center (Boolean): If `true`, centers the editor the to indicated line - * + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called after the animation has finished + * * Gracefully scrolls the editor to the row indicated. **/ - this.scrollToLine = function(line, center) { + this.scrollToLine = function(line, center, animate, callback) { var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); var offset = pos.top; if (center) offset -= this.$size.scrollerHeight / 2; - if (this.$animatedScroll && Math.abs(offset - this.scrollTop) < 10000) { - var _self = this; - var steps = _self.$calcSteps(this.scrollTop, offset); - - clearInterval(this.$timer); - this.$timer = setInterval(function() { - _self.session.setScrollTop(steps.shift()); - - if (!steps.length) - clearInterval(_self.$timer); - }, 10); - } - else { + var initialScroll = this.scrollTop; this.session.setScrollTop(offset); - } + if (animate !== false) + this.animateScrolling(initialScroll, callback); }; + this.animateScrolling = function(fromValue, callback) { + var toValue = this.scrollTop; + if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) { + var _self = this; + var steps = _self.$calcSteps(fromValue, toValue); + this.$inScrollAnimation = true; + + clearInterval(this.$timer); + + _self.session.setScrollTop(steps.shift()); + this.$timer = setInterval(function() { + if (steps.length) { + _self.session.setScrollTop(steps.shift()); + // trick session to think it's already scrolled to not loose toValue + _self.session.$scrollTop = toValue; + } else { + this.$inScrollAnimation = false; + clearInterval(_self.$timer); + + _self.session.$scrollTop = -1; + _self.session.setScrollTop(toValue); + callback && callback(); + } + }, 10); + } + }; + /** * VirtualRenderer.scrollToY(scrollTop) -> Number * - scrollTop (Number): The position to scroll to @@ -16602,7 +16834,8 @@ var Marker = function(parentEl) { exports.Marker = Marker; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -16994,21 +17227,18 @@ var Text = function(parentEl) { this.$renderToken = function(stringBuilder, screenColumn, token, value) { var self = this; - var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g; + var replaceReg = /\t|&|<|( +)|([\u0000-\u0019\u00a0\u2000-\u200b\u2028\u2029\u3000])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; var replaceFunc = function(c, a, b, tabIdx, idx4) { - if (c.charCodeAt(0) == 32) { + if (a) { return new Array(c.length+1).join(" "); + } else if (c == "&") { + return useragent.isOldGecko ? "&" : "&"; + } else if (c == "<") { + return "<"; } else if (c == "\t") { var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); screenColumn += tabSize - 1; return self.$tabStrings[tabSize]; - } else if (c == "&") { - if (useragent.isOldGecko) - return "&"; - else - return "&"; - } else if (c == "<") { - return "<"; } else if (c == "\u3000") { // U+3000 is both invisible AND full-width, so must be handled uniquely var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; @@ -17017,13 +17247,11 @@ var Text = function(parentEl) { return "" + space + ""; - } else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) { - if (self.showInvisibles) { - var space = new Array(c.length+1).join(self.SPACE_CHAR); - return "" + space + ""; - } else { + } else if (b) { + if (self.showInvisibles) + return "" + self.SPACE_CHAR + ""; + else return " "; - } } else { screenColumn += 1; return " 1) { + var ranges = this.rangeList.ranges; + var lastRange = ranges[ranges.length - 1]; + var range = Range.fromPoints(ranges[0].start, lastRange.end); + + this.toSingleRange(); + this.setSelectionRange(range, lastRange.cursor == lastRange.start); + } else { + var range = this.getRange(); + var startRow = range.start.row; + var endRow = range.end.row; + if (startRow == endRow) + return; + + var rectSel = []; + var r = this.getLineRange(startRow, true); + r.start.column = range.start.column; + rectSel.push(r); + + for (var i = startRow + 1; i < endRow; i++) + rectSel.push(this.getLineRange(i, true)); + + r = this.getLineRange(endRow, true); + r.end.column = range.end.column; + rectSel.push(r); + + rectSel.forEach(this.addRange, this); + } + }; + + this.toggleBlockSelection = function () { if (this.rangeCount > 1) { var ranges = this.rangeList.ranges; var lastRange = ranges[ranges.length - 1]; @@ -18231,7 +18509,7 @@ var EditSession = require("./edit_session").EditSession; // extend Editor var Editor = require("./editor").Editor; (function() { - + /** extension * Editor.updateSelectionMarkers() * @@ -18295,13 +18573,13 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onRemoveRange = function(e) { this.removeSelectionMarkers(e.ranges); this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onMultiSelect = function(e) { if (this.inMultiSelectMode) return; @@ -18314,7 +18592,7 @@ var Editor = require("./editor").Editor; this.renderer.updateCursor(); this.renderer.updateBackMarkers(); }; - + this.$onSingleSelect = function(e) { if (this.session.multiSelect.inVirtualMode) return; @@ -18382,9 +18660,9 @@ var Editor = require("./editor").Editor; this.onCursorChange(); this.onSelectionChange(); }; - + /** extension - * Editor.exitMultiSelectMode() + * Editor.exitMultiSelectMode() -> Void * * Removes all the selections except the last added one. **/ @@ -18410,15 +18688,35 @@ var Editor = require("./editor").Editor; return text; }; + this.onPaste = function(text) { + this._emit("paste", text); + if (!this.inMultiSelectMode) + return this.insert(text); + + var lines = text.split(this.session.getDocument().getNewLineCharacter()); + var ranges = this.selection.rangeList.ranges; + + if (lines.length > ranges.length) { + this.commands.exec("insertstring", this, text); + return; + } + + for (var i = ranges.length; i--; ) { + var range = ranges[i]; + if (!range.isEmpty()) + this.session.remove(range); + + this.session.insert(range.start, lines[i]); + } + }; + /** extension - * Editor.findAll(needle, dir, additive) -> Number - * - needle (String): The text to find - * - options (Object): Any of the additional [[Search search options]] - * - additive (Boolean): TODO - * + (Number): The number of found ranges. + * Editor.findAll(dir, options) -> Number + * - needle: text to find + * - options: search options + * - additive: keeps * * Finds and selects all the occurences of `needle`. - * **/ this.findAll = function(needle, options, additive) { options = options || {}; @@ -18431,10 +18729,10 @@ var Editor = require("./editor").Editor; this.$blockScrolling += 1; var selection = this.multiSelect; - + if (!additive) selection.toSingleRange(ranges[0]); - + for (var i = ranges.length; i--; ) selection.addRange(ranges[i], true); @@ -18494,7 +18792,6 @@ var Editor = require("./editor").Editor; * - dir (Number): The direction to rotate selections * * Transposes the selected ranges. - * **/ this.transposeSelections = function(dir) { var session = this.session; @@ -18512,7 +18809,7 @@ var Editor = require("./editor").Editor; } } sel.mergeOverlappingRanges(); - + var words = []; for (var i = all.length; i--; ) { var range = all[i]; @@ -18619,7 +18916,7 @@ function MultiSelect(editor) { editor.on("mousedown", onMouseDown); editor.commands.addCommands(exports.commands.defaultCommands); - + addAltCursorListeners(editor); } @@ -18627,7 +18924,7 @@ function addAltCursorListeners(editor){ var el = editor.textInput.getElement(); var altCursor = false; var contentEl = editor.renderer.content; - el.addEventListener("keydown", function(e) { + event.addListener(el, "keydown", function(e) { if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) { if (!altCursor) { contentEl.style.cursor = "crosshair"; @@ -18637,9 +18934,9 @@ function addAltCursorListeners(editor){ contentEl.style.cursor = ""; } }); - - el.addEventListener("keyup", reset); - el.addEventListener("blur", reset); + + event.addListener(el, "keyup", reset); + event.addListener(el, "blur", reset); function reset() { if (altCursor) { contentEl.style.cursor = ""; @@ -18650,7 +18947,8 @@ function addAltCursorListeners(editor){ exports.MultiSelect = MultiSelect; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -19047,7 +19345,8 @@ function onMouseDown(e) { exports.onMouseDown = onMouseDown; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -19133,20 +19432,22 @@ exports.defaultCommands = [{ exec: function(editor) { editor.multiSelect.splitIntoLines(); }, bindKey: {win: "Ctrl-Shift-L", mac: "Ctrl-Shift-L"}, readonly: true -}]; - -// commands active in multiselect mode -exports.multiEditCommands = [{ +}, { name: "singleSelection", bindKey: "esc", exec: function(editor) { editor.exitMultiSelectMode(); }, - readonly: true + readonly: true, + isAvailable: function(editor) {return editor.inMultiSelectMode} }]; +// commands active in multiselect mode +exports.multiEditCommands = {"singleSelection": "esc"}; + var HashHandler = require("../keyboard/hash_handler").HashHandler; exports.keyboardHandler = new HashHandler(exports.multiEditCommands); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -19948,8 +20249,8 @@ exports.cssText = ".ace-tm .ace_editor {\ }\ \ .ace-tm .ace_line .ace_invalid {\ - background-color: rgb(153, 0, 0);\ - color: white;\ + background-color: rgba(255, 0, 0, 0.1);\ + color: red;\ }\ \ .ace-tm .ace_line .ace_support.ace_function {\ @@ -20036,6 +20337,9 @@ exports.cssText = ".ace-tm .ace_editor {\ .ace-tm .ace_marker-layer .ace_active_line {\ background: rgba(0, 0, 0, 0.07);\ }\ +.ace-tm .ace_gutter_active_line{\ + background-color : #dcdcdc;\ +}\ \ .ace-tm .ace_marker-layer .ace_selected_word {\ background: rgb(250, 250, 255);\ diff --git a/build/textarea/src/mode-c_cpp.js b/build/textarea/src/mode-c_cpp.js index 09454170..44145d6e 100644 --- a/build/textarea/src/mode-c_cpp.js +++ b/build/textarea/src/mode-c_cpp.js @@ -708,7 +708,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -802,7 +803,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-coffee.js b/build/textarea/src/mode-coffee.js index 66133902..68b9704d 100644 --- a/build/textarea/src/mode-coffee.js +++ b/build/textarea/src/mode-coffee.js @@ -118,7 +118,8 @@ oop.inherits(Mode, TextMode); exports.Mode = Mode; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -490,7 +491,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-coldfusion.js b/build/textarea/src/mode-coldfusion.js index 47cf619c..56d59ab3 100644 --- a/build/textarea/src/mode-coldfusion.js +++ b/build/textarea/src/mode-coldfusion.js @@ -480,7 +480,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -704,7 +705,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -965,7 +967,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1965,7 +1968,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-csharp.js b/build/textarea/src/mode-csharp.js index e43d1742..c7796443 100644 --- a/build/textarea/src/mode-csharp.js +++ b/build/textarea/src/mode-csharp.js @@ -558,7 +558,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -652,7 +653,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-css.js b/build/textarea/src/mode-css.js index 5f102f4f..9398d0f0 100644 --- a/build/textarea/src/mode-css.js +++ b/build/textarea/src/mode-css.js @@ -525,7 +525,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-groovy.js b/build/textarea/src/mode-groovy.js index 7db69e93..36f92e6f 100644 --- a/build/textarea/src/mode-groovy.js +++ b/build/textarea/src/mode-groovy.js @@ -1039,7 +1039,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1133,7 +1134,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-haxe.js b/build/textarea/src/mode-haxe.js index 958cb7a4..f3cb5e11 100644 --- a/build/textarea/src/mode-haxe.js +++ b/build/textarea/src/mode-haxe.js @@ -558,7 +558,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -652,7 +653,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-html.js b/build/textarea/src/mode-html.js index bb12ee42..d058d3dd 100644 --- a/build/textarea/src/mode-html.js +++ b/build/textarea/src/mode-html.js @@ -1098,7 +1098,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1192,7 +1193,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2034,7 +2036,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2119,7 +2122,8 @@ var FoldMode = exports.FoldMode = function() { oop.inherits(FoldMode, MixedFoldMode); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2206,7 +2210,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2467,4 +2472,4 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -}); \ No newline at end of file +}); diff --git a/build/textarea/src/mode-java.js b/build/textarea/src/mode-java.js index b1548318..014f2153 100644 --- a/build/textarea/src/mode-java.js +++ b/build/textarea/src/mode-java.js @@ -1040,7 +1040,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1134,7 +1135,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-javascript.js b/build/textarea/src/mode-javascript.js index f952ef41..29e6083c 100644 --- a/build/textarea/src/mode-javascript.js +++ b/build/textarea/src/mode-javascript.js @@ -1015,7 +1015,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1109,7 +1110,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-json.js b/build/textarea/src/mode-json.js index be945e38..05fbcfa9 100644 --- a/build/textarea/src/mode-json.js +++ b/build/textarea/src/mode-json.js @@ -97,7 +97,8 @@ oop.inherits(Mode, TextMode); }).call(Mode.prototype); exports.Mode = Mode; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -489,7 +490,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -583,7 +585,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-less.js b/build/textarea/src/mode-less.js index ba4c7d42..15f7af2d 100644 --- a/build/textarea/src/mode-less.js +++ b/build/textarea/src/mode-less.js @@ -539,7 +539,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-lua.js b/build/textarea/src/mode-lua.js index 7544bfb4..b6aab7a8 100644 --- a/build/textarea/src/mode-lua.js +++ b/build/textarea/src/mode-lua.js @@ -56,7 +56,7 @@ oop.inherits(Mode, TextMode); var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; - + var chunks = ["function", "then", "do", "repeat"]; if (state == "start") { @@ -198,7 +198,7 @@ var LuaHighlightRules = function() { this.$rules = { "start" : - + // bracketed comments [{ token : "comment", // --[[ comment @@ -219,9 +219,9 @@ var LuaHighlightRules = function() { token : "comment", // --[====+[ comment regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' }, - - // multiline bracketed comments - { + + // multiline bracketed comments + { token : "comment", // --[[ comment regex : strPre + '\\-\\-\\[\\[.*$', merge : true, @@ -271,7 +271,7 @@ var LuaHighlightRules = function() { }, // bracketed strings - { + { token : "string", // [[ string regex : strPre + '\\[\\[.*\\]\\]' }, { @@ -290,8 +290,8 @@ var LuaHighlightRules = function() { token : "string", // [====+[ string regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' }, - - // multiline bracketed strings + + // multiline bracketed strings { token : "string", // [[ string regex : strPre + '\\[\\[.*$', diff --git a/build/textarea/src/mode-markdown.js b/build/textarea/src/mode-markdown.js index c8273983..f8d570c6 100644 --- a/build/textarea/src/mode-markdown.js +++ b/build/textarea/src/mode-markdown.js @@ -78,7 +78,8 @@ oop.inherits(Mode, TextMode); }).call(Mode.prototype); exports.Mode = Mode; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1095,7 +1096,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1189,7 +1191,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1713,7 +1716,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1974,7 +1978,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2634,7 +2639,8 @@ var FoldMode = exports.FoldMode = function() { oop.inherits(FoldMode, MixedFoldMode); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2721,7 +2727,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2915,4 +2922,4 @@ var MarkdownHighlightRules = function() { oop.inherits(MarkdownHighlightRules, TextHighlightRules); exports.MarkdownHighlightRules = MarkdownHighlightRules; -}); \ No newline at end of file +}); diff --git a/build/textarea/src/mode-perl.js b/build/textarea/src/mode-perl.js index 079d8e20..24a60d81 100644 --- a/build/textarea/src/mode-perl.js +++ b/build/textarea/src/mode-perl.js @@ -458,7 +458,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-php.js b/build/textarea/src/mode-php.js index 2afbfc54..84155259 100644 --- a/build/textarea/src/mode-php.js +++ b/build/textarea/src/mode-php.js @@ -1674,7 +1674,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1768,7 +1769,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-powershell.js b/build/textarea/src/mode-powershell.js index 24861489..9ddf6f92 100644 --- a/build/textarea/src/mode-powershell.js +++ b/build/textarea/src/mode-powershell.js @@ -499,7 +499,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -593,7 +594,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-python.js b/build/textarea/src/mode-python.js index 03c4f919..bbc111f3 100644 --- a/build/textarea/src/mode-python.js +++ b/build/textarea/src/mode-python.js @@ -391,7 +391,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-scad.js b/build/textarea/src/mode-scad.js index f9663ffa..adc07d35 100644 --- a/build/textarea/src/mode-scad.js +++ b/build/textarea/src/mode-scad.js @@ -696,7 +696,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -790,7 +791,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-scala.js b/build/textarea/src/mode-scala.js index 8b050523..1631e377 100644 --- a/build/textarea/src/mode-scala.js +++ b/build/textarea/src/mode-scala.js @@ -1040,7 +1040,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1134,7 +1135,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-scss.js b/build/textarea/src/mode-scss.js index 07ae5959..60bf8ef3 100644 --- a/build/textarea/src/mode-scss.js +++ b/build/textarea/src/mode-scss.js @@ -563,7 +563,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-svg.js b/build/textarea/src/mode-svg.js index 003140fa..8ab120f1 100644 --- a/build/textarea/src/mode-svg.js +++ b/build/textarea/src/mode-svg.js @@ -487,7 +487,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -711,7 +712,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -972,7 +974,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -1972,7 +1975,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -2130,4 +2134,4 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -}); \ No newline at end of file +}); diff --git a/build/textarea/src/mode-xml.js b/build/textarea/src/mode-xml.js index 502028f1..e5bf388a 100644 --- a/build/textarea/src/mode-xml.js +++ b/build/textarea/src/mode-xml.js @@ -409,7 +409,8 @@ var XmlBehaviour = function () { oop.inherits(XmlBehaviour, Behaviour); exports.XmlBehaviour = XmlBehaviour; -});/* vim:ts=4:sts=4:sw=4: +}); +/* vim:ts=4:sts=4:sw=4: * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -633,7 +634,8 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -894,7 +896,8 @@ oop.inherits(FoldMode, BaseFoldMode); }).call(FoldMode.prototype); -});/* ***** BEGIN LICENSE BLOCK ***** +}); +/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version diff --git a/build/textarea/src/mode-xquery.js b/build/textarea/src/mode-xquery.js index df4e3df5..acab0196 100644 --- a/build/textarea/src/mode-xquery.js +++ b/build/textarea/src/mode-xquery.js @@ -537,4 +537,4 @@ var CstyleBehaviour = function () { oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; -}); \ No newline at end of file +}); diff --git a/build/textarea/src/theme-monokai.js b/build/textarea/src/theme-monokai.js index 00e8b261..a2f49455 100644 --- a/build/textarea/src/theme-monokai.js +++ b/build/textarea/src/theme-monokai.js @@ -49,8 +49,8 @@ exports.cssText = "\ }\ \ .ace-monokai .ace_gutter {\ - background: #e8e8e8;\ - color: #333;\ + background: #292a24;\ + color: #f1f1f1;\ }\ \ .ace-monokai .ace_print_margin {\ @@ -94,9 +94,12 @@ exports.cssText = "\ border: 1px solid #49483E;\ }\ \ -.ace-monokai .ace_marker-layer .ace_active_line {\ +.ace-monokai .ace_marker-layer .ace_active_line{\ background: #49483E;\ }\ +.ace-monokai .ace_gutter_active_line{\ + background: #191916;\ +}\ \ .ace-monokai .ace_marker-layer .ace_selected_word {\ border: 1px solid #49483E;\ diff --git a/build/textarea/src/theme-solarized_dark.js b/build/textarea/src/theme-solarized_dark.js index 9029c310..efb9955c 100644 --- a/build/textarea/src/theme-solarized_dark.js +++ b/build/textarea/src/theme-solarized_dark.js @@ -49,8 +49,8 @@ exports.cssText = "\ }\ \ .ace-solarized-dark .ace_gutter {\ - background: #e8e8e8;\ - color: #333;\ + background: #09222b;\ + color: #d0edf7;\ }\ \ .ace-solarized-dark .ace_print_margin {\ @@ -97,6 +97,9 @@ exports.cssText = "\ .ace-solarized-dark .ace_marker-layer .ace_active_line {\ background: #073642;\ }\ +.ace-solarized-dark .ace_gutter_active_line{\ + background: #0d3440;\ +}\ \ .ace-solarized-dark .ace_marker-layer .ace_selected_word {\ border: 1px solid #073642;\ diff --git a/build/textarea/src/theme-tomorrow_night_blue.js b/build/textarea/src/theme-tomorrow_night_blue.js index 7decc08c..756cbf19 100644 --- a/build/textarea/src/theme-tomorrow_night_blue.js +++ b/build/textarea/src/theme-tomorrow_night_blue.js @@ -49,8 +49,8 @@ exports.cssText = "\ }\ \ .ace-tomorrow-night-blue .ace_gutter {\ - background: #e8e8e8;\ - color: #333;\ + background: #022346;\ + color: #7388b5;\ }\ \ .ace-tomorrow-night-blue .ace_print_margin {\ @@ -94,9 +94,12 @@ exports.cssText = "\ border: 1px solid #404F7D;\ }\ \ -.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line {\ +.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line{\ background: #00346E;\ }\ +.ace-tomorrow-night-blue .ace_gutter_active_line{\ + background: #022040;\ +}\ \ .ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\ border: 1px solid #003F8E;\ diff --git a/build/textarea/style.css b/build/textarea/style.css index b452add7..43f46d0e 100644 --- a/build/textarea/style.css +++ b/build/textarea/style.css @@ -1,3 +1,5 @@ +@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono); + body { margin:0; padding:0;