ace-rails-ap 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -1
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace/ace.js +6911 -5290
- data/vendor/assets/javascripts/ace/ext-chromevox.js +537 -0
- data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +301 -0
- data/vendor/assets/javascripts/ace/ext-emmet.js +1109 -0
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +207 -0
- data/vendor/assets/javascripts/ace/ext-language_tools.js +1665 -0
- data/vendor/assets/javascripts/ace/ext-modelist.js +168 -0
- data/vendor/assets/javascripts/ace/ext-old_ie.js +500 -0
- data/vendor/assets/javascripts/ace/ext-options.js +252 -0
- data/vendor/assets/javascripts/ace/ext-searchbox.js +421 -0
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +632 -0
- data/vendor/assets/javascripts/ace/ext-spellcheck.js +68 -0
- data/vendor/assets/javascripts/ace/ext-split.js +271 -0
- data/vendor/assets/javascripts/ace/ext-static_highlight.js +178 -0
- data/vendor/assets/javascripts/ace/ext-statusbar.js +47 -0
- data/vendor/assets/javascripts/ace/ext-textarea.js +478 -0
- data/vendor/assets/javascripts/ace/ext-themelist.js +86 -0
- data/vendor/assets/javascripts/ace/ext-whitespace.js +206 -0
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +822 -131
- data/vendor/assets/javascripts/ace/keybinding-vim.js +382 -258
- data/vendor/assets/javascripts/ace/mode-abap.js +261 -0
- data/vendor/assets/javascripts/ace/mode-actionscript.js +257 -0
- data/vendor/assets/javascripts/ace/mode-ada.js +118 -0
- data/vendor/assets/javascripts/ace/mode-asciidoc.js +373 -0
- data/vendor/assets/javascripts/ace/mode-assembly_x86.js +217 -0
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +225 -0
- data/vendor/assets/javascripts/ace/mode-batchfile.js +213 -0
- data/vendor/assets/javascripts/ace/mode-c9search.js +144 -124
- data/vendor/assets/javascripts/ace/mode-c_cpp.js +296 -254
- data/vendor/assets/javascripts/ace/mode-clojure.js +113 -177
- data/vendor/assets/javascripts/ace/mode-cobol.js +125 -0
- data/vendor/assets/javascripts/ace/mode-coffee.js +152 -235
- data/vendor/assets/javascripts/ace/mode-coldfusion.js +823 -835
- data/vendor/assets/javascripts/ace/mode-csharp.js +325 -187
- data/vendor/assets/javascripts/ace/mode-css.js +583 -297
- data/vendor/assets/javascripts/ace/mode-curly.js +2423 -0
- data/vendor/assets/javascripts/ace/mode-d.js +492 -0
- data/vendor/assets/javascripts/ace/mode-dart.js +993 -0
- data/vendor/assets/javascripts/ace/mode-diff.js +124 -204
- data/vendor/assets/javascripts/ace/mode-django.js +2448 -0
- data/vendor/assets/javascripts/ace/mode-dot.js +361 -0
- data/vendor/assets/javascripts/ace/mode-ejs.js +2817 -0
- data/vendor/assets/javascripts/ace/mode-erlang.js +987 -0
- data/vendor/assets/javascripts/ace/mode-forth.js +280 -0
- data/vendor/assets/javascripts/ace/mode-ftl.js +1061 -0
- data/vendor/assets/javascripts/ace/mode-glsl.js +313 -275
- data/vendor/assets/javascripts/ace/mode-golang.js +268 -275
- data/vendor/assets/javascripts/ace/mode-groovy.js +347 -492
- data/vendor/assets/javascripts/ace/mode-haml.js +498 -0
- data/vendor/assets/javascripts/ace/mode-handlebars.js +2433 -0
- data/vendor/assets/javascripts/ace/mode-haskell.js +362 -0
- data/vendor/assets/javascripts/ace/mode-haxe.js +226 -202
- data/vendor/assets/javascripts/ace/mode-html.js +1099 -802
- data/vendor/assets/javascripts/ace/mode-html_completions.js +309 -0
- data/vendor/assets/javascripts/ace/mode-html_ruby.js +2822 -0
- data/vendor/assets/javascripts/ace/mode-ini.js +185 -0
- data/vendor/assets/javascripts/ace/mode-jack.js +653 -0
- data/vendor/assets/javascripts/ace/mode-jade.js +2081 -0
- data/vendor/assets/javascripts/ace/mode-java.js +339 -488
- data/vendor/assets/javascripts/ace/mode-javascript.js +342 -478
- data/vendor/assets/javascripts/ace/mode-json.js +215 -178
- data/vendor/assets/javascripts/ace/mode-jsoniq.js +2761 -0
- data/vendor/assets/javascripts/ace/mode-jsp.js +1553 -0
- data/vendor/assets/javascripts/ace/mode-jsx.js +325 -289
- data/vendor/assets/javascripts/ace/mode-julia.js +286 -0
- data/vendor/assets/javascripts/ace/mode-latex.js +141 -46
- data/vendor/assets/javascripts/ace/mode-less.js +493 -151
- data/vendor/assets/javascripts/ace/mode-liquid.js +594 -656
- data/vendor/assets/javascripts/ace/mode-lisp.js +137 -0
- data/vendor/assets/javascripts/ace/mode-livescript.js +288 -0
- data/vendor/assets/javascripts/ace/mode-logiql.js +669 -0
- data/vendor/assets/javascripts/ace/mode-lsl.js +890 -0
- data/vendor/assets/javascripts/ace/mode-lua.js +274 -368
- data/vendor/assets/javascripts/ace/mode-luapage.js +1331 -1107
- data/vendor/assets/javascripts/ace/mode-lucene.js +64 -0
- data/vendor/assets/javascripts/ace/mode-makefile.js +332 -0
- data/vendor/assets/javascripts/ace/mode-markdown.js +1303 -948
- data/vendor/assets/javascripts/ace/mode-matlab.js +230 -0
- data/vendor/assets/javascripts/ace/mode-mushcode.js +705 -0
- data/vendor/assets/javascripts/ace/mode-mushcode_high_rules.js +569 -0
- data/vendor/assets/javascripts/ace/mode-mysql.js +185 -0
- data/vendor/assets/javascripts/ace/mode-nix.js +935 -0
- data/vendor/assets/javascripts/ace/mode-objectivec.js +699 -0
- data/vendor/assets/javascripts/ace/mode-ocaml.js +44 -63
- data/vendor/assets/javascripts/ace/mode-pascal.js +233 -0
- data/vendor/assets/javascripts/ace/mode-perl.js +116 -189
- data/vendor/assets/javascripts/ace/mode-pgsql.js +886 -500
- data/vendor/assets/javascripts/ace/mode-php.js +1158 -380
- data/vendor/assets/javascripts/ace/mode-plain_text.js +56 -0
- data/vendor/assets/javascripts/ace/mode-powershell.js +222 -167
- data/vendor/assets/javascripts/ace/mode-prolog.js +354 -0
- data/vendor/assets/javascripts/ace/mode-properties.js +100 -0
- data/vendor/assets/javascripts/ace/mode-protobuf.js +885 -0
- data/vendor/assets/javascripts/ace/mode-python.js +99 -201
- data/vendor/assets/javascripts/ace/mode-r.js +337 -0
- data/vendor/assets/javascripts/ace/mode-rdoc.js +210 -0
- data/vendor/assets/javascripts/ace/mode-rhtml.js +2663 -0
- data/vendor/assets/javascripts/ace/mode-ruby.js +262 -136
- data/vendor/assets/javascripts/ace/mode-rust.js +245 -0
- data/vendor/assets/javascripts/ace/mode-sass.js +443 -0
- data/vendor/assets/javascripts/ace/mode-scad.js +225 -240
- data/vendor/assets/javascripts/ace/mode-scala.js +340 -494
- data/vendor/assets/javascripts/ace/mode-scheme.js +143 -0
- data/vendor/assets/javascripts/ace/mode-scss.js +499 -157
- data/vendor/assets/javascripts/ace/mode-sh.js +180 -110
- data/vendor/assets/javascripts/ace/mode-sjs.js +1154 -0
- data/vendor/assets/javascripts/ace/mode-snippets.js +198 -0
- data/vendor/assets/javascripts/ace/mode-soy_template.js +2707 -0
- data/vendor/assets/javascripts/ace/mode-space.js +160 -0
- data/vendor/assets/javascripts/ace/mode-sql.js +48 -69
- data/vendor/assets/javascripts/ace/mode-stylus.js +447 -0
- data/vendor/assets/javascripts/ace/mode-svg.js +552 -605
- data/vendor/assets/javascripts/ace/mode-tcl.js +139 -98
- data/vendor/assets/javascripts/ace/mode-tex.js +187 -0
- data/vendor/assets/javascripts/ace/mode-textile.js +29 -40
- data/vendor/assets/javascripts/ace/mode-tmsnippet.js +200 -0
- data/vendor/assets/javascripts/ace/mode-toml.js +177 -0
- data/vendor/assets/javascripts/ace/mode-twig.js +2228 -0
- data/vendor/assets/javascripts/ace/mode-typescript.js +1018 -0
- data/vendor/assets/javascripts/ace/mode-vbscript.js +250 -0
- data/vendor/assets/javascripts/ace/mode-velocity.js +1621 -0
- data/vendor/assets/javascripts/ace/mode-verilog.js +127 -0
- data/vendor/assets/javascripts/ace/mode-vhdl.js +139 -0
- data/vendor/assets/javascripts/ace/mode-xml.js +350 -242
- data/vendor/assets/javascripts/ace/mode-xquery.js +2490 -300
- data/vendor/assets/javascripts/ace/mode-yaml.js +146 -45
- data/vendor/assets/javascripts/ace/theme-ambiance.js +202 -0
- data/vendor/assets/javascripts/ace/theme-chaos.js +179 -0
- data/vendor/assets/javascripts/ace/theme-chrome.js +97 -153
- data/vendor/assets/javascripts/ace/theme-clouds.js +78 -119
- data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +79 -120
- data/vendor/assets/javascripts/ace/theme-cobalt.js +89 -140
- data/vendor/assets/javascripts/ace/theme-crimson_editor.js +93 -145
- data/vendor/assets/javascripts/ace/theme-dawn.js +84 -143
- data/vendor/assets/javascripts/ace/theme-dreamweaver.js +99 -162
- data/vendor/assets/javascripts/ace/theme-eclipse.js +78 -111
- data/vendor/assets/javascripts/ace/theme-github.js +70 -121
- data/vendor/assets/javascripts/ace/theme-idle_fingers.js +75 -134
- data/vendor/assets/javascripts/ace/theme-kr.js +135 -0
- data/vendor/assets/javascripts/ace/theme-merbivore.js +80 -143
- data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +81 -149
- data/vendor/assets/javascripts/ace/theme-mono_industrial.js +87 -146
- data/vendor/assets/javascripts/ace/theme-monokai.js +88 -146
- data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +82 -142
- data/vendor/assets/javascripts/ace/theme-solarized_dark.js +83 -144
- data/vendor/assets/javascripts/ace/theme-solarized_light.js +76 -133
- data/vendor/assets/javascripts/ace/theme-terminal.js +145 -0
- data/vendor/assets/javascripts/ace/theme-textmate.js +101 -158
- data/vendor/assets/javascripts/ace/theme-tomorrow.js +89 -163
- data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +89 -163
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +89 -165
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +101 -162
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +90 -160
- data/vendor/assets/javascripts/ace/theme-twilight.js +87 -158
- data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +75 -140
- data/vendor/assets/javascripts/ace/theme-xcode.js +120 -0
- data/vendor/assets/javascripts/ace/worker-coffee.js +3049 -2665
- data/vendor/assets/javascripts/ace/worker-css.js +1779 -4376
- data/vendor/assets/javascripts/ace/worker-javascript.js +8701 -9008
- data/vendor/assets/javascripts/ace/worker-json.js +709 -1340
- data/vendor/assets/javascripts/ace/worker-lua.js +3525 -0
- data/vendor/assets/javascripts/ace/worker-php.js +6893 -0
- data/vendor/assets/javascripts/ace/worker-xquery.js +19924 -64507
- metadata +100 -17
@@ -1,41 +1,34 @@
|
|
1
1
|
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
-
*
|
2
|
+
* Distributed under the BSD license:
|
3
3
|
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
28
|
-
* of those above. If you wish to allow use of your version of this file only
|
29
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
30
|
-
* use your version of this file under the terms of the MPL, indicate your
|
31
|
-
* decision by deleting the provisions above and replace them with the notice
|
32
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
33
|
-
* the provisions above, a recipient may use your version of this file under
|
34
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
28
|
*
|
36
29
|
* ***** END LICENSE BLOCK ***** */
|
37
30
|
|
38
|
-
define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
31
|
+
define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
39
32
|
|
40
33
|
|
41
34
|
var oop = require("../lib/oop");
|
@@ -44,11 +37,13 @@ var Tokenizer = require("../tokenizer").Tokenizer;
|
|
44
37
|
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
45
38
|
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
46
39
|
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
40
|
+
var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
47
41
|
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
48
42
|
|
49
43
|
var Mode = function() {
|
50
|
-
this
|
44
|
+
this.HighlightRules = CssHighlightRules;
|
51
45
|
this.$outdent = new MatchingBraceOutdent();
|
46
|
+
this.$behaviour = new CssBehaviour();
|
52
47
|
this.foldingRules = new CStyleFoldMode();
|
53
48
|
};
|
54
49
|
oop.inherits(Mode, TextMode);
|
@@ -56,12 +51,11 @@ oop.inherits(Mode, TextMode);
|
|
56
51
|
(function() {
|
57
52
|
|
58
53
|
this.foldingRules = "cStyle";
|
54
|
+
this.blockComment = {start: "/*", end: "*/"};
|
59
55
|
|
60
56
|
this.getNextLineIndent = function(state, line, tab) {
|
61
57
|
var indent = this.$getIndent(line);
|
62
|
-
|
63
|
-
// ignore braces in comments
|
64
|
-
var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
|
58
|
+
var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
|
65
59
|
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
66
60
|
return indent;
|
67
61
|
}
|
@@ -81,28 +75,23 @@ oop.inherits(Mode, TextMode);
|
|
81
75
|
this.autoOutdent = function(state, doc, row) {
|
82
76
|
this.$outdent.autoOutdent(doc, row);
|
83
77
|
};
|
84
|
-
|
78
|
+
|
85
79
|
this.createWorker = function(session) {
|
86
80
|
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
|
87
81
|
worker.attachToDocument(session.getDocument());
|
88
|
-
|
82
|
+
|
89
83
|
worker.on("csslint", function(e) {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
text: message.message,
|
96
|
-
type: message.type,
|
97
|
-
lint: message
|
98
|
-
});
|
99
|
-
});
|
100
|
-
|
101
|
-
session.setAnnotations(errors);
|
84
|
+
session.setAnnotations(e.data);
|
85
|
+
});
|
86
|
+
|
87
|
+
worker.on("terminate", function() {
|
88
|
+
session.clearAnnotations();
|
102
89
|
});
|
90
|
+
|
103
91
|
return worker;
|
104
92
|
};
|
105
93
|
|
94
|
+
this.$id = "ace/mode/css";
|
106
95
|
}).call(Mode.prototype);
|
107
96
|
|
108
97
|
exports.Mode = Mode;
|
@@ -115,198 +104,136 @@ define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/li
|
|
115
104
|
var oop = require("../lib/oop");
|
116
105
|
var lang = require("../lib/lang");
|
117
106
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
107
|
+
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
|
108
|
+
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
|
109
|
+
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
|
110
|
+
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
|
111
|
+
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
|
118
112
|
|
119
|
-
var
|
120
|
-
|
121
|
-
|
122
|
-
("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|")
|
123
|
-
);
|
124
|
-
|
125
|
-
var functions = lang.arrayToMap(
|
126
|
-
("rgb|rgba|url|attr|counter|counters").split("|")
|
127
|
-
);
|
113
|
+
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
114
|
+
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
|
115
|
+
var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
|
128
116
|
|
129
|
-
|
130
|
-
("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|")
|
131
|
-
);
|
132
|
-
|
133
|
-
var colors = lang.arrayToMap(
|
134
|
-
("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
|
135
|
-
"purple|red|silver|teal|white|yellow").split("|")
|
136
|
-
);
|
137
|
-
|
138
|
-
var fonts = lang.arrayToMap(
|
139
|
-
("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
|
140
|
-
"symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
|
141
|
-
"serif|monospace").split("|")
|
142
|
-
);
|
143
|
-
|
144
|
-
// regexp must not have capturing parentheses. Use (?:) instead.
|
145
|
-
// regexps are ordered -> the first match is used
|
146
|
-
|
147
|
-
var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
148
|
-
var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
|
149
|
-
var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
|
150
|
-
|
151
|
-
var base_ruleset = [
|
152
|
-
{
|
153
|
-
token : "comment", // multi line comment
|
154
|
-
merge : true,
|
155
|
-
regex : "\\/\\*",
|
156
|
-
next : "ruleset_comment"
|
157
|
-
}, {
|
158
|
-
token : "string", // single line
|
159
|
-
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
160
|
-
}, {
|
161
|
-
token : "string", // single line
|
162
|
-
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
163
|
-
}, {
|
164
|
-
token : ["constant.numeric", "keyword"],
|
165
|
-
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
|
166
|
-
}, {
|
167
|
-
token : ["constant.numeric"],
|
168
|
-
regex : "([0-9]+)"
|
169
|
-
}, {
|
170
|
-
token : "constant.numeric", // hex6 color
|
171
|
-
regex : "#[a-f0-9]{6}"
|
172
|
-
}, {
|
173
|
-
token : "constant.numeric", // hex3 color
|
174
|
-
regex : "#[a-f0-9]{3}"
|
175
|
-
}, {
|
176
|
-
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
|
177
|
-
regex : pseudoElements
|
178
|
-
}, {
|
179
|
-
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
|
180
|
-
regex : pseudoClasses
|
181
|
-
}, {
|
182
|
-
token : function(value) {
|
183
|
-
if (properties.hasOwnProperty(value.toLowerCase())) {
|
184
|
-
return "support.type";
|
185
|
-
}
|
186
|
-
else if (functions.hasOwnProperty(value.toLowerCase())) {
|
187
|
-
return "support.function";
|
188
|
-
}
|
189
|
-
else if (constants.hasOwnProperty(value.toLowerCase())) {
|
190
|
-
return "support.constant";
|
191
|
-
}
|
192
|
-
else if (colors.hasOwnProperty(value.toLowerCase())) {
|
193
|
-
return "support.constant.color";
|
194
|
-
}
|
195
|
-
else if (fonts.hasOwnProperty(value.toLowerCase())) {
|
196
|
-
return "support.constant.fonts";
|
197
|
-
}
|
198
|
-
else {
|
199
|
-
return "text";
|
200
|
-
}
|
201
|
-
},
|
202
|
-
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
203
|
-
}
|
204
|
-
];
|
205
|
-
|
206
|
-
var ruleset = lang.copyArray(base_ruleset);
|
207
|
-
ruleset.unshift({
|
208
|
-
token : "paren.rparen",
|
209
|
-
regex : "\\}",
|
210
|
-
next: "start"
|
211
|
-
});
|
212
|
-
|
213
|
-
var media_ruleset = lang.copyArray( base_ruleset );
|
214
|
-
media_ruleset.unshift({
|
215
|
-
token : "paren.rparen",
|
216
|
-
regex : "\\}",
|
217
|
-
next: "media"
|
218
|
-
});
|
219
|
-
|
220
|
-
var base_comment = [{
|
221
|
-
token : "comment", // comment spanning whole line
|
222
|
-
merge : true,
|
223
|
-
regex : ".+"
|
224
|
-
}];
|
225
|
-
|
226
|
-
var comment = lang.copyArray(base_comment);
|
227
|
-
comment.unshift({
|
228
|
-
token : "comment", // closing comment
|
229
|
-
regex : ".*?\\*\\/",
|
230
|
-
next : "start"
|
231
|
-
});
|
232
|
-
|
233
|
-
var media_comment = lang.copyArray(base_comment);
|
234
|
-
media_comment.unshift({
|
235
|
-
token : "comment", // closing comment
|
236
|
-
regex : ".*?\\*\\/",
|
237
|
-
next : "media"
|
238
|
-
});
|
117
|
+
var CssHighlightRules = function() {
|
239
118
|
|
240
|
-
var
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
119
|
+
var keywordMapper = this.createKeywordMapper({
|
120
|
+
"support.function": supportFunction,
|
121
|
+
"support.constant": supportConstant,
|
122
|
+
"support.type": supportType,
|
123
|
+
"support.constant.color": supportConstantColor,
|
124
|
+
"support.constant.fonts": supportConstantFonts
|
125
|
+
}, "text", true);
|
246
126
|
|
247
127
|
this.$rules = {
|
248
128
|
"start" : [{
|
249
129
|
token : "comment", // multi line comment
|
250
|
-
merge : true,
|
251
130
|
regex : "\\/\\*",
|
252
|
-
|
131
|
+
push : "comment"
|
253
132
|
}, {
|
254
133
|
token: "paren.lparen",
|
255
134
|
regex: "\\{",
|
256
|
-
|
135
|
+
push: "ruleset"
|
257
136
|
}, {
|
258
137
|
token: "string",
|
259
138
|
regex: "@.*?{",
|
260
|
-
|
261
|
-
},{
|
139
|
+
push: "media"
|
140
|
+
}, {
|
262
141
|
token: "keyword",
|
263
142
|
regex: "#[a-z0-9-_]+"
|
264
|
-
},{
|
143
|
+
}, {
|
265
144
|
token: "variable",
|
266
145
|
regex: "\\.[a-z0-9-_]+"
|
267
|
-
},{
|
146
|
+
}, {
|
268
147
|
token: "string",
|
269
148
|
regex: ":[a-z0-9-_]+"
|
270
|
-
},{
|
149
|
+
}, {
|
271
150
|
token: "constant",
|
272
151
|
regex: "[a-z0-9-_]+"
|
152
|
+
}, {
|
153
|
+
caseInsensitive: true
|
273
154
|
}],
|
274
155
|
|
275
|
-
"media" : [
|
156
|
+
"media" : [{
|
276
157
|
token : "comment", // multi line comment
|
277
|
-
merge : true,
|
278
158
|
regex : "\\/\\*",
|
279
|
-
|
159
|
+
push : "comment"
|
280
160
|
}, {
|
281
161
|
token: "paren.lparen",
|
282
162
|
regex: "\\{",
|
283
|
-
|
284
|
-
},{
|
163
|
+
push: "ruleset"
|
164
|
+
}, {
|
285
165
|
token: "string",
|
286
166
|
regex: "\\}",
|
287
|
-
next: "
|
288
|
-
},{
|
167
|
+
next: "pop"
|
168
|
+
}, {
|
289
169
|
token: "keyword",
|
290
170
|
regex: "#[a-z0-9-_]+"
|
291
|
-
},{
|
171
|
+
}, {
|
292
172
|
token: "variable",
|
293
173
|
regex: "\\.[a-z0-9-_]+"
|
294
|
-
},{
|
174
|
+
}, {
|
295
175
|
token: "string",
|
296
176
|
regex: ":[a-z0-9-_]+"
|
297
|
-
},{
|
177
|
+
}, {
|
298
178
|
token: "constant",
|
299
179
|
regex: "[a-z0-9-_]+"
|
180
|
+
}, {
|
181
|
+
caseInsensitive: true
|
300
182
|
}],
|
301
183
|
|
302
|
-
"comment" :
|
303
|
-
|
304
|
-
|
305
|
-
|
184
|
+
"comment" : [{
|
185
|
+
token : "comment",
|
186
|
+
regex : "\\*\\/",
|
187
|
+
next : "pop"
|
188
|
+
}, {
|
189
|
+
defaultToken : "comment"
|
190
|
+
}],
|
306
191
|
|
307
|
-
"
|
308
|
-
|
192
|
+
"ruleset" : [
|
193
|
+
{
|
194
|
+
token : "paren.rparen",
|
195
|
+
regex : "\\}",
|
196
|
+
next: "pop"
|
197
|
+
}, {
|
198
|
+
token : "comment", // multi line comment
|
199
|
+
regex : "\\/\\*",
|
200
|
+
push : "comment"
|
201
|
+
}, {
|
202
|
+
token : "string", // single line
|
203
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
204
|
+
}, {
|
205
|
+
token : "string", // single line
|
206
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
207
|
+
}, {
|
208
|
+
token : ["constant.numeric", "keyword"],
|
209
|
+
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
|
210
|
+
}, {
|
211
|
+
token : "constant.numeric",
|
212
|
+
regex : numRe
|
213
|
+
}, {
|
214
|
+
token : "constant.numeric", // hex6 color
|
215
|
+
regex : "#[a-f0-9]{6}"
|
216
|
+
}, {
|
217
|
+
token : "constant.numeric", // hex3 color
|
218
|
+
regex : "#[a-f0-9]{3}"
|
219
|
+
}, {
|
220
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
|
221
|
+
regex : pseudoElements
|
222
|
+
}, {
|
223
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
|
224
|
+
regex : pseudoClasses
|
225
|
+
}, {
|
226
|
+
token : ["support.function", "string", "support.function"],
|
227
|
+
regex : "(url\\()(.*)(\\))"
|
228
|
+
}, {
|
229
|
+
token : keywordMapper,
|
230
|
+
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
231
|
+
}, {
|
232
|
+
caseInsensitive: true
|
233
|
+
}]
|
309
234
|
};
|
235
|
+
|
236
|
+
this.normalizeRules();
|
310
237
|
};
|
311
238
|
|
312
239
|
oop.inherits(CssHighlightRules, TextHighlightRules);
|
@@ -347,12 +274,7 @@ var MatchingBraceOutdent = function() {};
|
|
347
274
|
};
|
348
275
|
|
349
276
|
this.$getIndent = function(line) {
|
350
|
-
|
351
|
-
if (match) {
|
352
|
-
return match[1];
|
353
|
-
}
|
354
|
-
|
355
|
-
return "";
|
277
|
+
return line.match(/^\s*/)[0];
|
356
278
|
};
|
357
279
|
|
358
280
|
}).call(MatchingBraceOutdent.prototype);
|
@@ -360,138 +282,502 @@ var MatchingBraceOutdent = function() {};
|
|
360
282
|
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
361
283
|
});
|
362
284
|
|
363
|
-
define('ace/mode/
|
285
|
+
define('ace/mode/behaviour/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
|
364
286
|
|
365
287
|
|
366
288
|
var oop = require("../../lib/oop");
|
367
|
-
var
|
368
|
-
var
|
289
|
+
var Behaviour = require("../behaviour").Behaviour;
|
290
|
+
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
291
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
369
292
|
|
370
|
-
var
|
371
|
-
oop.inherits(FoldMode, BaseFoldMode);
|
293
|
+
var CssBehaviour = function () {
|
372
294
|
|
373
|
-
(
|
295
|
+
this.inherit(CstyleBehaviour);
|
374
296
|
|
375
|
-
this.
|
376
|
-
|
297
|
+
this.add("colon", "insertion", function (state, action, editor, session, text) {
|
298
|
+
if (text === ':') {
|
299
|
+
var cursor = editor.getCursorPosition();
|
300
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
301
|
+
var token = iterator.getCurrentToken();
|
302
|
+
if (token && token.value.match(/\s+/)) {
|
303
|
+
token = iterator.stepBackward();
|
304
|
+
}
|
305
|
+
if (token && token.type === 'support.type') {
|
306
|
+
var line = session.doc.getLine(cursor.row);
|
307
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
308
|
+
if (rightChar === ':') {
|
309
|
+
return {
|
310
|
+
text: '',
|
311
|
+
selection: [1, 1]
|
312
|
+
}
|
313
|
+
}
|
314
|
+
if (!line.substring(cursor.column).match(/^\s*;/)) {
|
315
|
+
return {
|
316
|
+
text: ':;',
|
317
|
+
selection: [1, 1]
|
318
|
+
}
|
319
|
+
}
|
320
|
+
}
|
321
|
+
}
|
322
|
+
});
|
323
|
+
|
324
|
+
this.add("colon", "deletion", function (state, action, editor, session, range) {
|
325
|
+
var selected = session.doc.getTextRange(range);
|
326
|
+
if (!range.isMultiLine() && selected === ':') {
|
327
|
+
var cursor = editor.getCursorPosition();
|
328
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
329
|
+
var token = iterator.getCurrentToken();
|
330
|
+
if (token && token.value.match(/\s+/)) {
|
331
|
+
token = iterator.stepBackward();
|
332
|
+
}
|
333
|
+
if (token && token.type === 'support.type') {
|
334
|
+
var line = session.doc.getLine(range.start.row);
|
335
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
336
|
+
if (rightChar === ';') {
|
337
|
+
range.end.column ++;
|
338
|
+
return range;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
}
|
342
|
+
});
|
343
|
+
|
344
|
+
this.add("semicolon", "insertion", function (state, action, editor, session, text) {
|
345
|
+
if (text === ';') {
|
346
|
+
var cursor = editor.getCursorPosition();
|
347
|
+
var line = session.doc.getLine(cursor.row);
|
348
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
349
|
+
if (rightChar === ';') {
|
350
|
+
return {
|
351
|
+
text: '',
|
352
|
+
selection: [1, 1]
|
353
|
+
}
|
354
|
+
}
|
355
|
+
}
|
356
|
+
});
|
357
|
+
|
358
|
+
}
|
359
|
+
oop.inherits(CssBehaviour, CstyleBehaviour);
|
360
|
+
|
361
|
+
exports.CssBehaviour = CssBehaviour;
|
362
|
+
});
|
363
|
+
|
364
|
+
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
|
365
|
+
|
366
|
+
|
367
|
+
var oop = require("../../lib/oop");
|
368
|
+
var Behaviour = require("../behaviour").Behaviour;
|
369
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
370
|
+
var lang = require("../../lib/lang");
|
371
|
+
|
372
|
+
var SAFE_INSERT_IN_TOKENS =
|
373
|
+
["text", "paren.rparen", "punctuation.operator"];
|
374
|
+
var SAFE_INSERT_BEFORE_TOKENS =
|
375
|
+
["text", "paren.rparen", "punctuation.operator", "comment"];
|
376
|
+
|
377
|
+
|
378
|
+
var autoInsertedBrackets = 0;
|
379
|
+
var autoInsertedRow = -1;
|
380
|
+
var autoInsertedLineEnd = "";
|
381
|
+
var maybeInsertedBrackets = 0;
|
382
|
+
var maybeInsertedRow = -1;
|
383
|
+
var maybeInsertedLineStart = "";
|
384
|
+
var maybeInsertedLineEnd = "";
|
385
|
+
|
386
|
+
var CstyleBehaviour = function () {
|
377
387
|
|
378
|
-
|
379
|
-
var
|
380
|
-
var
|
381
|
-
if (
|
382
|
-
var
|
388
|
+
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
389
|
+
var cursor = editor.getCursorPosition();
|
390
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
391
|
+
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
|
392
|
+
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
|
393
|
+
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
|
394
|
+
return false;
|
395
|
+
}
|
396
|
+
iterator.stepForward();
|
397
|
+
return iterator.getCurrentTokenRow() !== cursor.row ||
|
398
|
+
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
399
|
+
};
|
400
|
+
|
401
|
+
CstyleBehaviour.$matchTokenType = function(token, types) {
|
402
|
+
return types.indexOf(token.type || token) > -1;
|
403
|
+
};
|
404
|
+
|
405
|
+
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
406
|
+
var cursor = editor.getCursorPosition();
|
407
|
+
var line = session.doc.getLine(cursor.row);
|
408
|
+
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
|
409
|
+
autoInsertedBrackets = 0;
|
410
|
+
autoInsertedRow = cursor.row;
|
411
|
+
autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
412
|
+
autoInsertedBrackets++;
|
413
|
+
};
|
414
|
+
|
415
|
+
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
416
|
+
var cursor = editor.getCursorPosition();
|
417
|
+
var line = session.doc.getLine(cursor.row);
|
418
|
+
if (!this.isMaybeInsertedClosing(cursor, line))
|
419
|
+
maybeInsertedBrackets = 0;
|
420
|
+
maybeInsertedRow = cursor.row;
|
421
|
+
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
422
|
+
maybeInsertedLineEnd = line.substr(cursor.column);
|
423
|
+
maybeInsertedBrackets++;
|
424
|
+
};
|
425
|
+
|
426
|
+
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
427
|
+
return autoInsertedBrackets > 0 &&
|
428
|
+
cursor.row === autoInsertedRow &&
|
429
|
+
bracket === autoInsertedLineEnd[0] &&
|
430
|
+
line.substr(cursor.column) === autoInsertedLineEnd;
|
431
|
+
};
|
432
|
+
|
433
|
+
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
434
|
+
return maybeInsertedBrackets > 0 &&
|
435
|
+
cursor.row === maybeInsertedRow &&
|
436
|
+
line.substr(cursor.column) === maybeInsertedLineEnd &&
|
437
|
+
line.substr(0, cursor.column) == maybeInsertedLineStart;
|
438
|
+
};
|
439
|
+
|
440
|
+
CstyleBehaviour.popAutoInsertedClosing = function() {
|
441
|
+
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
|
442
|
+
autoInsertedBrackets--;
|
443
|
+
};
|
444
|
+
|
445
|
+
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
446
|
+
maybeInsertedBrackets = 0;
|
447
|
+
maybeInsertedRow = -1;
|
448
|
+
};
|
383
449
|
|
384
|
-
|
385
|
-
|
450
|
+
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
451
|
+
var cursor = editor.getCursorPosition();
|
452
|
+
var line = session.doc.getLine(cursor.row);
|
453
|
+
if (text == '{') {
|
454
|
+
var selection = editor.getSelectionRange();
|
455
|
+
var selected = session.doc.getTextRange(selection);
|
456
|
+
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
457
|
+
return {
|
458
|
+
text: '{' + selected + '}',
|
459
|
+
selection: false
|
460
|
+
};
|
461
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
462
|
+
if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
|
463
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "}");
|
464
|
+
return {
|
465
|
+
text: '{}',
|
466
|
+
selection: [1, 1]
|
467
|
+
};
|
468
|
+
} else {
|
469
|
+
CstyleBehaviour.recordMaybeInsert(editor, session, "{");
|
470
|
+
return {
|
471
|
+
text: '{',
|
472
|
+
selection: [1, 1]
|
473
|
+
};
|
474
|
+
}
|
475
|
+
}
|
476
|
+
} else if (text == '}') {
|
477
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
478
|
+
if (rightChar == '}') {
|
479
|
+
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
480
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
481
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
482
|
+
return {
|
483
|
+
text: '',
|
484
|
+
selection: [1, 1]
|
485
|
+
};
|
486
|
+
}
|
487
|
+
}
|
488
|
+
} else if (text == "\n" || text == "\r\n") {
|
489
|
+
var closing = "";
|
490
|
+
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
|
491
|
+
closing = lang.stringRepeat("}", maybeInsertedBrackets);
|
492
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
493
|
+
}
|
494
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
495
|
+
if (rightChar === '}') {
|
496
|
+
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
|
497
|
+
if (!openBracePos)
|
498
|
+
return null;
|
499
|
+
var next_indent = this.$getIndent(session.getLine(openBracePos.row));
|
500
|
+
} else if (closing) {
|
501
|
+
var next_indent = this.$getIndent(line);
|
502
|
+
} else {
|
503
|
+
return;
|
504
|
+
}
|
505
|
+
var indent = next_indent + session.getTabString();
|
506
|
+
|
507
|
+
return {
|
508
|
+
text: '\n' + indent + '\n' + next_indent + closing,
|
509
|
+
selection: [1, indent.length, 1, indent.length]
|
510
|
+
};
|
511
|
+
} else {
|
512
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
513
|
+
}
|
514
|
+
});
|
386
515
|
|
387
|
-
|
388
|
-
|
389
|
-
|
516
|
+
this.add("braces", "deletion", function (state, action, editor, session, range) {
|
517
|
+
var selected = session.doc.getTextRange(range);
|
518
|
+
if (!range.isMultiLine() && selected == '{') {
|
519
|
+
var line = session.doc.getLine(range.start.row);
|
520
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
521
|
+
if (rightChar == '}') {
|
522
|
+
range.end.column++;
|
523
|
+
return range;
|
524
|
+
} else {
|
525
|
+
maybeInsertedBrackets--;
|
526
|
+
}
|
390
527
|
}
|
528
|
+
});
|
391
529
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
530
|
+
this.add("parens", "insertion", function (state, action, editor, session, text) {
|
531
|
+
if (text == '(') {
|
532
|
+
var selection = editor.getSelectionRange();
|
533
|
+
var selected = session.doc.getTextRange(selection);
|
534
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
535
|
+
return {
|
536
|
+
text: '(' + selected + ')',
|
537
|
+
selection: false
|
538
|
+
};
|
539
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
540
|
+
CstyleBehaviour.recordAutoInsert(editor, session, ")");
|
541
|
+
return {
|
542
|
+
text: '()',
|
543
|
+
selection: [1, 1]
|
544
|
+
};
|
545
|
+
}
|
546
|
+
} else if (text == ')') {
|
547
|
+
var cursor = editor.getCursorPosition();
|
548
|
+
var line = session.doc.getLine(cursor.row);
|
549
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
550
|
+
if (rightChar == ')') {
|
551
|
+
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
552
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
553
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
554
|
+
return {
|
555
|
+
text: '',
|
556
|
+
selection: [1, 1]
|
557
|
+
};
|
558
|
+
}
|
559
|
+
}
|
560
|
+
}
|
561
|
+
});
|
398
562
|
|
399
|
-
|
400
|
-
|
401
|
-
|
563
|
+
this.add("parens", "deletion", function (state, action, editor, session, range) {
|
564
|
+
var selected = session.doc.getTextRange(range);
|
565
|
+
if (!range.isMultiLine() && selected == '(') {
|
566
|
+
var line = session.doc.getLine(range.start.row);
|
567
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
568
|
+
if (rightChar == ')') {
|
569
|
+
range.end.column++;
|
402
570
|
return range;
|
403
571
|
}
|
572
|
+
}
|
573
|
+
});
|
404
574
|
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
575
|
+
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
576
|
+
if (text == '[') {
|
577
|
+
var selection = editor.getSelectionRange();
|
578
|
+
var selected = session.doc.getTextRange(selection);
|
579
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
580
|
+
return {
|
581
|
+
text: '[' + selected + ']',
|
582
|
+
selection: false
|
583
|
+
};
|
584
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
585
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "]");
|
586
|
+
return {
|
587
|
+
text: '[]',
|
588
|
+
selection: [1, 1]
|
589
|
+
};
|
590
|
+
}
|
591
|
+
} else if (text == ']') {
|
592
|
+
var cursor = editor.getCursorPosition();
|
593
|
+
var line = session.doc.getLine(cursor.row);
|
594
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
595
|
+
if (rightChar == ']') {
|
596
|
+
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
597
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
598
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
599
|
+
return {
|
600
|
+
text: '',
|
601
|
+
selection: [1, 1]
|
602
|
+
};
|
603
|
+
}
|
604
|
+
}
|
605
|
+
}
|
606
|
+
});
|
607
|
+
|
608
|
+
this.add("brackets", "deletion", function (state, action, editor, session, range) {
|
609
|
+
var selected = session.doc.getTextRange(range);
|
610
|
+
if (!range.isMultiLine() && selected == '[') {
|
611
|
+
var line = session.doc.getLine(range.start.row);
|
612
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
613
|
+
if (rightChar == ']') {
|
614
|
+
range.end.column++;
|
615
|
+
return range;
|
616
|
+
}
|
617
|
+
}
|
618
|
+
});
|
410
619
|
|
411
|
-
|
412
|
-
|
620
|
+
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
621
|
+
if (text == '"' || text == "'") {
|
622
|
+
var quote = text;
|
623
|
+
var selection = editor.getSelectionRange();
|
624
|
+
var selected = session.doc.getTextRange(selection);
|
625
|
+
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
626
|
+
return {
|
627
|
+
text: quote + selected + quote,
|
628
|
+
selection: false
|
629
|
+
};
|
630
|
+
} else {
|
631
|
+
var cursor = editor.getCursorPosition();
|
632
|
+
var line = session.doc.getLine(cursor.row);
|
633
|
+
var leftChar = line.substring(cursor.column-1, cursor.column);
|
634
|
+
if (leftChar == '\\') {
|
635
|
+
return null;
|
636
|
+
}
|
637
|
+
var tokens = session.getTokens(selection.start.row);
|
638
|
+
var col = 0, token;
|
639
|
+
var quotepos = -1; // Track whether we're inside an open quote.
|
640
|
+
|
641
|
+
for (var x = 0; x < tokens.length; x++) {
|
642
|
+
token = tokens[x];
|
643
|
+
if (token.type == "string") {
|
644
|
+
quotepos = -1;
|
645
|
+
} else if (quotepos < 0) {
|
646
|
+
quotepos = token.value.indexOf(quote);
|
647
|
+
}
|
648
|
+
if ((token.value.length + col) > selection.start.column) {
|
649
|
+
break;
|
650
|
+
}
|
651
|
+
col += tokens[x].value.length;
|
652
|
+
}
|
653
|
+
if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
|
654
|
+
if (!CstyleBehaviour.isSaneInsertion(editor, session))
|
655
|
+
return;
|
656
|
+
return {
|
657
|
+
text: quote + quote,
|
658
|
+
selection: [1,1]
|
659
|
+
};
|
660
|
+
} else if (token && token.type === "string") {
|
661
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
662
|
+
if (rightChar == quote) {
|
663
|
+
return {
|
664
|
+
text: '',
|
665
|
+
selection: [1, 1]
|
666
|
+
};
|
667
|
+
}
|
668
|
+
}
|
669
|
+
}
|
670
|
+
}
|
671
|
+
});
|
413
672
|
|
414
|
-
|
673
|
+
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
|
674
|
+
var selected = session.doc.getTextRange(range);
|
675
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
676
|
+
var line = session.doc.getLine(range.start.row);
|
677
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
678
|
+
if (rightChar == selected) {
|
679
|
+
range.end.column++;
|
680
|
+
return range;
|
681
|
+
}
|
415
682
|
}
|
416
|
-
};
|
417
|
-
|
418
|
-
}
|
683
|
+
});
|
684
|
+
|
685
|
+
};
|
419
686
|
|
687
|
+
oop.inherits(CstyleBehaviour, Behaviour);
|
688
|
+
|
689
|
+
exports.CstyleBehaviour = CstyleBehaviour;
|
420
690
|
});
|
421
691
|
|
422
|
-
define('ace/mode/folding/
|
692
|
+
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
423
693
|
|
424
694
|
|
695
|
+
var oop = require("../../lib/oop");
|
425
696
|
var Range = require("../../range").Range;
|
697
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
426
698
|
|
427
|
-
var FoldMode = exports.FoldMode = function() {
|
699
|
+
var FoldMode = exports.FoldMode = function(commentRegex) {
|
700
|
+
if (commentRegex) {
|
701
|
+
this.foldingStartMarker = new RegExp(
|
702
|
+
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
703
|
+
);
|
704
|
+
this.foldingStopMarker = new RegExp(
|
705
|
+
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
706
|
+
);
|
707
|
+
}
|
708
|
+
};
|
709
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
428
710
|
|
429
711
|
(function() {
|
430
712
|
|
431
|
-
this.foldingStartMarker =
|
432
|
-
this.foldingStopMarker =
|
713
|
+
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
714
|
+
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
433
715
|
|
434
|
-
|
435
|
-
this.getFoldWidget = function(session, foldStyle, row) {
|
716
|
+
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
436
717
|
var line = session.getLine(row);
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
&& this.foldingStopMarker
|
441
|
-
&& this.foldingStopMarker.test(line))
|
442
|
-
return "end";
|
443
|
-
return "";
|
444
|
-
};
|
718
|
+
var match = line.match(this.foldingStartMarker);
|
719
|
+
if (match) {
|
720
|
+
var i = match.index;
|
445
721
|
|
446
|
-
|
447
|
-
|
448
|
-
|
722
|
+
if (match[1])
|
723
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
724
|
+
|
725
|
+
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
726
|
+
|
727
|
+
if (range && !range.isMultiLine()) {
|
728
|
+
if (forceMultiline) {
|
729
|
+
range = this.getSectionRange(session, row);
|
730
|
+
} else if (foldStyle != "all")
|
731
|
+
range = null;
|
732
|
+
}
|
733
|
+
|
734
|
+
return range;
|
735
|
+
}
|
449
736
|
|
450
|
-
|
451
|
-
var re = /\S/;
|
452
|
-
var line = session.getLine(row);
|
453
|
-
var startLevel = line.search(re);
|
454
|
-
if (startLevel == -1)
|
737
|
+
if (foldStyle === "markbegin")
|
455
738
|
return;
|
456
739
|
|
457
|
-
var
|
458
|
-
|
740
|
+
var match = line.match(this.foldingStopMarker);
|
741
|
+
if (match) {
|
742
|
+
var i = match.index + match[0].length;
|
743
|
+
|
744
|
+
if (match[1])
|
745
|
+
return this.closingBracketBlock(session, match[1], row, i);
|
746
|
+
|
747
|
+
return session.getCommentFoldRange(row, i, -1);
|
748
|
+
}
|
749
|
+
};
|
750
|
+
|
751
|
+
this.getSectionRange = function(session, row) {
|
752
|
+
var line = session.getLine(row);
|
753
|
+
var startIndent = line.search(/\S/);
|
459
754
|
var startRow = row;
|
755
|
+
var startColumn = line.length;
|
756
|
+
row = row + 1;
|
460
757
|
var endRow = row;
|
461
|
-
|
758
|
+
var maxRow = session.getLength();
|
462
759
|
while (++row < maxRow) {
|
463
|
-
|
464
|
-
|
465
|
-
if (
|
760
|
+
line = session.getLine(row);
|
761
|
+
var indent = line.search(/\S/);
|
762
|
+
if (indent === -1)
|
466
763
|
continue;
|
467
|
-
|
468
|
-
if (level <= startLevel)
|
764
|
+
if (startIndent > indent)
|
469
765
|
break;
|
470
|
-
|
766
|
+
var subRange = this.getFoldWidgetRange(session, "all", row);
|
767
|
+
|
768
|
+
if (subRange) {
|
769
|
+
if (subRange.start.row <= startRow) {
|
770
|
+
break;
|
771
|
+
} else if (subRange.isMultiLine()) {
|
772
|
+
row = subRange.end.row;
|
773
|
+
} else if (startIndent == indent) {
|
774
|
+
break;
|
775
|
+
}
|
776
|
+
}
|
471
777
|
endRow = row;
|
472
778
|
}
|
473
|
-
|
474
|
-
|
475
|
-
var endColumn = session.getLine(endRow).length;
|
476
|
-
return new Range(startRow, startColumn, endRow, endColumn);
|
477
|
-
}
|
478
|
-
};
|
479
|
-
|
480
|
-
this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
|
481
|
-
var start = {row: row, column: column + 1};
|
482
|
-
var end = session.$findClosingBracket(bracket, start, typeRe);
|
483
|
-
if (!end)
|
484
|
-
return;
|
485
|
-
|
486
|
-
var fw = session.foldWidgets[end.row];
|
487
|
-
if (fw == null)
|
488
|
-
fw = this.getFoldWidget(session, end.row);
|
489
|
-
|
490
|
-
if (fw == "start" && end.row > start.row) {
|
491
|
-
end.row --;
|
492
|
-
end.column = session.getLine(end.row).length;
|
493
|
-
}
|
494
|
-
return Range.fromPoints(start, end);
|
779
|
+
|
780
|
+
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
495
781
|
};
|
496
782
|
|
497
783
|
}).call(FoldMode.prototype);
|