ace-rails-ap 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/lib/ace/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/ace/ace.js +14194 -13349
  5. data/vendor/assets/javascripts/ace/ext-beautify.js +335 -0
  6. data/vendor/assets/javascripts/ace/ext-chromevox.js +6 -1
  7. data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +8 -33
  8. data/vendor/assets/javascripts/ace/ext-emmet.js +487 -424
  9. data/vendor/assets/javascripts/ace/ext-error_marker.js +6 -0
  10. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +45 -72
  11. data/vendor/assets/javascripts/ace/ext-language_tools.js +734 -578
  12. data/vendor/assets/javascripts/ace/ext-linking.js +53 -0
  13. data/vendor/assets/javascripts/ace/ext-modelist.js +25 -10
  14. data/vendor/assets/javascripts/ace/ext-old_ie.js +93 -120
  15. data/vendor/assets/javascripts/ace/ext-searchbox.js +8 -41
  16. data/vendor/assets/javascripts/ace/ext-settings_menu.js +229 -234
  17. data/vendor/assets/javascripts/ace/ext-spellcheck.js +7 -3
  18. data/vendor/assets/javascripts/ace/ext-split.js +13 -37
  19. data/vendor/assets/javascripts/ace/ext-static_highlight.js +16 -39
  20. data/vendor/assets/javascripts/ace/ext-statusbar.js +8 -2
  21. data/vendor/assets/javascripts/ace/ext-textarea.js +254 -99
  22. data/vendor/assets/javascripts/ace/ext-themelist.js +13 -40
  23. data/vendor/assets/javascripts/ace/ext-whitespace.js +17 -41
  24. data/vendor/assets/javascripts/ace/keybinding-emacs.js +803 -788
  25. data/vendor/assets/javascripts/ace/keybinding-vim.js +1559 -1560
  26. data/vendor/assets/javascripts/ace/mode-abap.js +52 -83
  27. data/vendor/assets/javascripts/ace/mode-actionscript.js +27 -63
  28. data/vendor/assets/javascripts/ace/mode-ada.js +27 -58
  29. data/vendor/assets/javascripts/ace/mode-apache_conf.js +310 -0
  30. data/vendor/assets/javascripts/ace/mode-applescript.js +226 -0
  31. data/vendor/assets/javascripts/ace/mode-asciidoc.js +39 -70
  32. data/vendor/assets/javascripts/ace/mode-assembly_x86.js +26 -58
  33. data/vendor/assets/javascripts/ace/mode-autohotkey.js +27 -63
  34. data/vendor/assets/javascripts/ace/mode-batchfile.js +27 -63
  35. data/vendor/assets/javascripts/ace/mode-c9search.js +92 -112
  36. data/vendor/assets/javascripts/ace/mode-c_cpp.js +224 -223
  37. data/vendor/assets/javascripts/ace/mode-cirru.js +202 -0
  38. data/vendor/assets/javascripts/ace/mode-clojure.js +98 -92
  39. data/vendor/assets/javascripts/ace/mode-cobol.js +27 -58
  40. data/vendor/assets/javascripts/ace/mode-coffee.js +90 -122
  41. data/vendor/assets/javascripts/ace/mode-coldfusion.js +1908 -1464
  42. data/vendor/assets/javascripts/ace/mode-csharp.js +291 -264
  43. data/vendor/assets/javascripts/ace/mode-css.js +266 -267
  44. data/vendor/assets/javascripts/ace/mode-curly.js +796 -815
  45. data/vendor/assets/javascripts/ace/mode-d.js +64 -95
  46. data/vendor/assets/javascripts/ace/mode-dart.js +254 -256
  47. data/vendor/assets/javascripts/ace/mode-diff.js +27 -58
  48. data/vendor/assets/javascripts/ace/mode-django.js +856 -866
  49. data/vendor/assets/javascripts/ace/mode-dockerfile.js +759 -0
  50. data/vendor/assets/javascripts/ace/mode-dot.js +106 -106
  51. data/vendor/assets/javascripts/ace/mode-eiffel.js +135 -0
  52. data/vendor/assets/javascripts/ace/mode-ejs.js +931 -938
  53. data/vendor/assets/javascripts/ace/mode-erlang.js +27 -58
  54. data/vendor/assets/javascripts/ace/mode-forth.js +27 -63
  55. data/vendor/assets/javascripts/ace/mode-ftl.js +457 -508
  56. data/vendor/assets/javascripts/ace/mode-gcode.js +85 -0
  57. data/vendor/assets/javascripts/ace/mode-gherkin.js +129 -0
  58. data/vendor/assets/javascripts/ace/mode-gitignore.js +50 -0
  59. data/vendor/assets/javascripts/ace/mode-glsl.js +252 -248
  60. data/vendor/assets/javascripts/ace/mode-golang.js +206 -179
  61. data/vendor/assets/javascripts/ace/mode-groovy.js +310 -242
  62. data/vendor/assets/javascripts/ace/mode-haml.js +156 -190
  63. data/vendor/assets/javascripts/ace/mode-handlebars.js +815 -784
  64. data/vendor/assets/javascripts/ace/mode-haskell.js +27 -63
  65. data/vendor/assets/javascripts/ace/mode-haxe.js +206 -176
  66. data/vendor/assets/javascripts/ace/mode-html.js +779 -792
  67. data/vendor/assets/javascripts/ace/mode-html_ruby.js +916 -923
  68. data/vendor/assets/javascripts/ace/mode-ini.js +27 -58
  69. data/vendor/assets/javascripts/ace/mode-io.js +201 -0
  70. data/vendor/assets/javascripts/ace/mode-jack.js +169 -170
  71. data/vendor/assets/javascripts/ace/mode-jade.js +722 -774
  72. data/vendor/assets/javascripts/ace/mode-java.js +310 -245
  73. data/vendor/assets/javascripts/ace/mode-javascript.js +285 -247
  74. data/vendor/assets/javascripts/ace/mode-json.js +183 -184
  75. data/vendor/assets/javascripts/ace/mode-jsoniq.js +3211 -1274
  76. data/vendor/assets/javascripts/ace/mode-jsp.js +481 -504
  77. data/vendor/assets/javascripts/ace/mode-jsx.js +206 -176
  78. data/vendor/assets/javascripts/ace/mode-julia.js +33 -69
  79. data/vendor/assets/javascripts/ace/mode-latex.js +74 -41
  80. data/vendor/assets/javascripts/ace/mode-less.js +250 -251
  81. data/vendor/assets/javascripts/ace/mode-liquid.js +424 -475
  82. data/vendor/assets/javascripts/ace/mode-lisp.js +24 -57
  83. data/vendor/assets/javascripts/ace/mode-livescript.js +42 -41
  84. data/vendor/assets/javascripts/ace/mode-logiql.js +229 -230
  85. data/vendor/assets/javascripts/ace/mode-lsl.js +200 -441
  86. data/vendor/assets/javascripts/ace/mode-lua.js +136 -167
  87. data/vendor/assets/javascripts/ace/mode-luapage.js +904 -884
  88. data/vendor/assets/javascripts/ace/mode-lucene.js +22 -17
  89. data/vendor/assets/javascripts/ace/mode-makefile.js +162 -137
  90. data/vendor/assets/javascripts/ace/mode-markdown.js +846 -854
  91. data/vendor/assets/javascripts/ace/mode-matlab.js +98 -72
  92. data/vendor/assets/javascripts/ace/mode-mel.js +569 -0
  93. data/vendor/assets/javascripts/ace/mode-mushcode.js +84 -115
  94. data/vendor/assets/javascripts/ace/mode-mysql.js +49 -80
  95. data/vendor/assets/javascripts/ace/mode-nix.js +252 -256
  96. data/vendor/assets/javascripts/ace/mode-objectivec.js +242 -274
  97. data/vendor/assets/javascripts/ace/mode-ocaml.js +71 -102
  98. data/vendor/assets/javascripts/ace/mode-pascal.js +32 -68
  99. data/vendor/assets/javascripts/ace/mode-perl.js +67 -98
  100. data/vendor/assets/javascripts/ace/mode-pgsql.js +990 -982
  101. data/vendor/assets/javascripts/ace/mode-php.js +1878 -1900
  102. data/vendor/assets/javascripts/ace/mode-plain_text.js +3 -34
  103. data/vendor/assets/javascripts/ace/mode-powershell.js +181 -151
  104. data/vendor/assets/javascripts/ace/mode-praat.js +418 -0
  105. data/vendor/assets/javascripts/ace/mode-prolog.js +27 -63
  106. data/vendor/assets/javascripts/ace/mode-properties.js +20 -48
  107. data/vendor/assets/javascripts/ace/mode-protobuf.js +252 -259
  108. data/vendor/assets/javascripts/ace/mode-python.js +84 -115
  109. data/vendor/assets/javascripts/ace/mode-r.js +105 -140
  110. data/vendor/assets/javascripts/ace/mode-rdoc.js +84 -89
  111. data/vendor/assets/javascripts/ace/mode-rhtml.js +892 -908
  112. data/vendor/assets/javascripts/ace/mode-ruby.js +434 -98
  113. data/vendor/assets/javascripts/ace/mode-rust.js +27 -63
  114. data/vendor/assets/javascripts/ace/mode-sass.js +75 -106
  115. data/vendor/assets/javascripts/ace/mode-scad.js +219 -220
  116. data/vendor/assets/javascripts/ace/mode-scala.js +311 -243
  117. data/vendor/assets/javascripts/ace/mode-scheme.js +24 -60
  118. data/vendor/assets/javascripts/ace/mode-scss.js +250 -251
  119. data/vendor/assets/javascripts/ace/mode-sh.js +506 -118
  120. data/vendor/assets/javascripts/ace/mode-sjs.js +314 -280
  121. data/vendor/assets/javascripts/ace/mode-smarty.js +2474 -0
  122. data/vendor/assets/javascripts/ace/mode-snippets.js +89 -89
  123. data/vendor/assets/javascripts/ace/mode-soy_template.js +792 -811
  124. data/vendor/assets/javascripts/ace/mode-space.js +22 -23
  125. data/vendor/assets/javascripts/ace/mode-sql.js +31 -58
  126. data/vendor/assets/javascripts/ace/mode-stylus.js +161 -197
  127. data/vendor/assets/javascripts/ace/mode-svg.js +906 -836
  128. data/vendor/assets/javascripts/ace/mode-tcl.js +61 -92
  129. data/vendor/assets/javascripts/ace/mode-tex.js +36 -73
  130. data/vendor/assets/javascripts/ace/mode-text.js +1 -0
  131. data/vendor/assets/javascripts/ace/mode-textile.js +41 -72
  132. data/vendor/assets/javascripts/ace/mode-toml.js +26 -62
  133. data/vendor/assets/javascripts/ace/mode-twig.js +1196 -892
  134. data/vendor/assets/javascripts/ace/mode-typescript.js +313 -277
  135. data/vendor/assets/javascripts/ace/mode-vala.js +982 -0
  136. data/vendor/assets/javascripts/ace/mode-vbscript.js +25 -62
  137. data/vendor/assets/javascripts/ace/mode-velocity.js +2251 -1242
  138. data/vendor/assets/javascripts/ace/mode-verilog.js +27 -59
  139. data/vendor/assets/javascripts/ace/mode-vhdl.js +26 -55
  140. data/vendor/assets/javascripts/ace/mode-xml.js +319 -644
  141. data/vendor/assets/javascripts/ace/mode-xquery.js +2503 -588
  142. data/vendor/assets/javascripts/ace/mode-yaml.js +56 -90
  143. data/vendor/assets/javascripts/ace/snippets/abap.js +7 -0
  144. data/vendor/assets/javascripts/ace/snippets/actionscript.js +159 -0
  145. data/vendor/assets/javascripts/ace/snippets/ada.js +7 -0
  146. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +7 -0
  147. data/vendor/assets/javascripts/ace/snippets/applescript.js +7 -0
  148. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +7 -0
  149. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +7 -0
  150. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +7 -0
  151. data/vendor/assets/javascripts/ace/snippets/batchfile.js +7 -0
  152. data/vendor/assets/javascripts/ace/snippets/c9search.js +7 -0
  153. data/vendor/assets/javascripts/ace/snippets/c_cpp.js +138 -0
  154. data/vendor/assets/javascripts/ace/snippets/cirru.js +7 -0
  155. data/vendor/assets/javascripts/ace/snippets/clojure.js +97 -0
  156. data/vendor/assets/javascripts/ace/snippets/cobol.js +7 -0
  157. data/vendor/assets/javascripts/ace/snippets/coffee.js +102 -0
  158. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +7 -0
  159. data/vendor/assets/javascripts/ace/snippets/csharp.js +7 -0
  160. data/vendor/assets/javascripts/ace/snippets/css.js +974 -0
  161. data/vendor/assets/javascripts/ace/snippets/curly.js +7 -0
  162. data/vendor/assets/javascripts/ace/snippets/d.js +7 -0
  163. data/vendor/assets/javascripts/ace/snippets/dart.js +90 -0
  164. data/vendor/assets/javascripts/ace/snippets/diff.js +18 -0
  165. data/vendor/assets/javascripts/ace/snippets/django.js +115 -0
  166. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +7 -0
  167. data/vendor/assets/javascripts/ace/snippets/dot.js +7 -0
  168. data/vendor/assets/javascripts/ace/snippets/eiffel.js +7 -0
  169. data/vendor/assets/javascripts/ace/snippets/ejs.js +7 -0
  170. data/vendor/assets/javascripts/ace/snippets/erlang.js +167 -0
  171. data/vendor/assets/javascripts/ace/snippets/forth.js +7 -0
  172. data/vendor/assets/javascripts/ace/snippets/ftl.js +7 -0
  173. data/vendor/assets/javascripts/ace/snippets/gcode.js +7 -0
  174. data/vendor/assets/javascripts/ace/snippets/gherkin.js +7 -0
  175. data/vendor/assets/javascripts/ace/snippets/gitignore.js +7 -0
  176. data/vendor/assets/javascripts/ace/snippets/glsl.js +7 -0
  177. data/vendor/assets/javascripts/ace/snippets/golang.js +7 -0
  178. data/vendor/assets/javascripts/ace/snippets/groovy.js +7 -0
  179. data/vendor/assets/javascripts/ace/snippets/haml.js +27 -0
  180. data/vendor/assets/javascripts/ace/snippets/handlebars.js +7 -0
  181. data/vendor/assets/javascripts/ace/snippets/haskell.js +89 -0
  182. data/vendor/assets/javascripts/ace/snippets/haxe.js +7 -0
  183. data/vendor/assets/javascripts/ace/snippets/html.js +835 -0
  184. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +7 -0
  185. data/vendor/assets/javascripts/ace/snippets/ini.js +7 -0
  186. data/vendor/assets/javascripts/ace/snippets/io.js +69 -0
  187. data/vendor/assets/javascripts/ace/snippets/jack.js +7 -0
  188. data/vendor/assets/javascripts/ace/snippets/jade.js +7 -0
  189. data/vendor/assets/javascripts/ace/snippets/java.js +241 -0
  190. data/vendor/assets/javascripts/ace/snippets/javascript.js +189 -0
  191. data/vendor/assets/javascripts/ace/snippets/json.js +7 -0
  192. data/vendor/assets/javascripts/ace/snippets/jsoniq.js +68 -0
  193. data/vendor/assets/javascripts/ace/snippets/jsp.js +106 -0
  194. data/vendor/assets/javascripts/ace/snippets/jsx.js +7 -0
  195. data/vendor/assets/javascripts/ace/snippets/julia.js +7 -0
  196. data/vendor/assets/javascripts/ace/snippets/latex.js +7 -0
  197. data/vendor/assets/javascripts/ace/snippets/less.js +7 -0
  198. data/vendor/assets/javascripts/ace/snippets/liquid.js +7 -0
  199. data/vendor/assets/javascripts/ace/snippets/lisp.js +7 -0
  200. data/vendor/assets/javascripts/ace/snippets/livescript.js +7 -0
  201. data/vendor/assets/javascripts/ace/snippets/logiql.js +7 -0
  202. data/vendor/assets/javascripts/ace/snippets/lsl.js +1073 -0
  203. data/vendor/assets/javascripts/ace/snippets/lua.js +28 -0
  204. data/vendor/assets/javascripts/ace/snippets/luapage.js +7 -0
  205. data/vendor/assets/javascripts/ace/snippets/lucene.js +7 -0
  206. data/vendor/assets/javascripts/ace/snippets/makefile.js +11 -0
  207. data/vendor/assets/javascripts/ace/snippets/markdown.js +95 -0
  208. data/vendor/assets/javascripts/ace/snippets/matlab.js +7 -0
  209. data/vendor/assets/javascripts/ace/snippets/mel.js +7 -0
  210. data/vendor/assets/javascripts/ace/snippets/mushcode.js +7 -0
  211. data/vendor/assets/javascripts/ace/snippets/mysql.js +7 -0
  212. data/vendor/assets/javascripts/ace/snippets/nix.js +7 -0
  213. data/vendor/assets/javascripts/ace/snippets/objectivec.js +7 -0
  214. data/vendor/assets/javascripts/ace/snippets/ocaml.js +7 -0
  215. data/vendor/assets/javascripts/ace/snippets/pascal.js +7 -0
  216. data/vendor/assets/javascripts/ace/snippets/perl.js +354 -0
  217. data/vendor/assets/javascripts/ace/snippets/pgsql.js +7 -0
  218. data/vendor/assets/javascripts/ace/snippets/php.js +283 -0
  219. data/vendor/assets/javascripts/ace/snippets/plain_text.js +7 -0
  220. data/vendor/assets/javascripts/ace/snippets/powershell.js +7 -0
  221. data/vendor/assets/javascripts/ace/snippets/praat.js +7 -0
  222. data/vendor/assets/javascripts/ace/snippets/prolog.js +7 -0
  223. data/vendor/assets/javascripts/ace/snippets/properties.js +7 -0
  224. data/vendor/assets/javascripts/ace/snippets/protobuf.js +7 -0
  225. data/vendor/assets/javascripts/ace/snippets/python.js +165 -0
  226. data/vendor/assets/javascripts/ace/snippets/r.js +128 -0
  227. data/vendor/assets/javascripts/ace/snippets/rdoc.js +7 -0
  228. data/vendor/assets/javascripts/ace/snippets/rhtml.js +7 -0
  229. data/vendor/assets/javascripts/ace/snippets/ruby.js +935 -0
  230. data/vendor/assets/javascripts/ace/snippets/rust.js +7 -0
  231. data/vendor/assets/javascripts/ace/snippets/sass.js +7 -0
  232. data/vendor/assets/javascripts/ace/snippets/scad.js +7 -0
  233. data/vendor/assets/javascripts/ace/snippets/scala.js +7 -0
  234. data/vendor/assets/javascripts/ace/snippets/scheme.js +7 -0
  235. data/vendor/assets/javascripts/ace/snippets/scss.js +7 -0
  236. data/vendor/assets/javascripts/ace/snippets/sh.js +90 -0
  237. data/vendor/assets/javascripts/ace/snippets/sjs.js +7 -0
  238. data/vendor/assets/javascripts/ace/snippets/smarty.js +7 -0
  239. data/vendor/assets/javascripts/ace/snippets/snippets.js +16 -0
  240. data/vendor/assets/javascripts/ace/snippets/soy_template.js +7 -0
  241. data/vendor/assets/javascripts/ace/snippets/space.js +7 -0
  242. data/vendor/assets/javascripts/ace/snippets/sql.js +33 -0
  243. data/vendor/assets/javascripts/ace/snippets/stylus.js +7 -0
  244. data/vendor/assets/javascripts/ace/snippets/svg.js +7 -0
  245. data/vendor/assets/javascripts/ace/snippets/tcl.js +99 -0
  246. data/vendor/assets/javascripts/ace/snippets/tex.js +197 -0
  247. data/vendor/assets/javascripts/ace/snippets/text.js +7 -0
  248. data/vendor/assets/javascripts/ace/snippets/textile.js +37 -0
  249. data/vendor/assets/javascripts/ace/snippets/toml.js +7 -0
  250. data/vendor/assets/javascripts/ace/snippets/twig.js +7 -0
  251. data/vendor/assets/javascripts/ace/snippets/typescript.js +7 -0
  252. data/vendor/assets/javascripts/ace/snippets/vala.js +193 -0
  253. data/vendor/assets/javascripts/ace/snippets/vbscript.js +7 -0
  254. data/vendor/assets/javascripts/ace/snippets/velocity.js +36 -0
  255. data/vendor/assets/javascripts/ace/snippets/verilog.js +7 -0
  256. data/vendor/assets/javascripts/ace/snippets/vhdl.js +7 -0
  257. data/vendor/assets/javascripts/ace/snippets/xml.js +7 -0
  258. data/vendor/assets/javascripts/ace/snippets/xquery.js +68 -0
  259. data/vendor/assets/javascripts/ace/snippets/yaml.js +7 -0
  260. data/vendor/assets/javascripts/ace/theme-ambiance.js +4 -24
  261. data/vendor/assets/javascripts/ace/theme-chaos.js +2 -25
  262. data/vendor/assets/javascripts/ace/theme-chrome.js +2 -31
  263. data/vendor/assets/javascripts/ace/theme-clouds.js +1 -31
  264. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -31
  265. data/vendor/assets/javascripts/ace/theme-cobalt.js +1 -31
  266. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +1 -31
  267. data/vendor/assets/javascripts/ace/theme-dawn.js +1 -31
  268. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +5 -31
  269. data/vendor/assets/javascripts/ace/theme-eclipse.js +7 -33
  270. data/vendor/assets/javascripts/ace/theme-github.js +2 -35
  271. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +1 -31
  272. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +119 -0
  273. data/vendor/assets/javascripts/ace/theme-kr.js +1 -31
  274. data/vendor/assets/javascripts/ace/theme-kr_theme.js +57 -141
  275. data/vendor/assets/javascripts/ace/theme-kuroir.js +59 -0
  276. data/vendor/assets/javascripts/ace/theme-merbivore.js +1 -31
  277. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +1 -31
  278. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +1 -31
  279. data/vendor/assets/javascripts/ace/theme-monokai.js +1 -31
  280. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +1 -31
  281. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +1 -31
  282. data/vendor/assets/javascripts/ace/theme-solarized_light.js +1 -31
  283. data/vendor/assets/javascripts/ace/theme-terminal.js +1 -31
  284. data/vendor/assets/javascripts/ace/theme-textmate.js +3 -32
  285. data/vendor/assets/javascripts/ace/theme-tomorrow.js +1 -31
  286. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +1 -31
  287. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +1 -31
  288. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +1 -31
  289. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +1 -31
  290. data/vendor/assets/javascripts/ace/theme-twilight.js +1 -31
  291. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +1 -31
  292. data/vendor/assets/javascripts/ace/theme-xcode.js +2 -33
  293. data/vendor/assets/javascripts/ace/worker-coffee.js +5026 -5008
  294. data/vendor/assets/javascripts/ace/worker-css.js +5489 -5134
  295. data/vendor/assets/javascripts/ace/worker-html.js +11517 -0
  296. data/vendor/assets/javascripts/ace/worker-javascript.js +9810 -9501
  297. data/vendor/assets/javascripts/ace/worker-json.js +1583 -1564
  298. data/vendor/assets/javascripts/ace/worker-lua.js +2631 -2612
  299. data/vendor/assets/javascripts/ace/worker-php.js +2385 -2341
  300. data/vendor/assets/javascripts/ace/worker-xquery.js +31643 -3993
  301. metadata +147 -11
@@ -1,116 +1,5 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
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.
28
- *
29
- * ***** END LICENSE BLOCK ***** */
30
-
31
- define('ace/mode/mushcode', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/mushcode_high_rules', 'ace/mode/folding/pythonic', 'ace/range'], function(require, exports, module) {
32
-
33
-
34
- var oop = require("../lib/oop");
35
- var TextMode = require("./text").Mode;
36
- var Tokenizer = require("../tokenizer").Tokenizer;
37
- var MushCodeRules = require("./mushcode_high_rules").MushCodeRules;
38
- var PythonFoldMode = require("./folding/pythonic").FoldMode;
39
- var Range = require("../range").Range;
40
-
41
- var Mode = function() {
42
- this.HighlightRules = MushCodeRules;
43
- this.foldingRules = new PythonFoldMode("\\:");
44
- };
45
- oop.inherits(Mode, TextMode);
46
-
47
- (function() {
48
-
49
- this.lineCommentStart = "#";
50
-
51
- this.getNextLineIndent = function(state, line, tab) {
52
- var indent = this.$getIndent(line);
53
-
54
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
55
- var tokens = tokenizedLine.tokens;
56
-
57
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
58
- return indent;
59
- }
60
-
61
- if (state == "start") {
62
- var match = line.match(/^.*[\{\(\[\:]\s*$/);
63
- if (match) {
64
- indent += tab;
65
- }
66
- }
67
-
68
- return indent;
69
- };
70
-
71
- var outdents = {
72
- "pass": 1,
73
- "return": 1,
74
- "raise": 1,
75
- "break": 1,
76
- "continue": 1
77
- };
78
-
79
- this.checkOutdent = function(state, line, input) {
80
- if (input !== "\r\n" && input !== "\r" && input !== "\n")
81
- return false;
82
-
83
- var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
84
-
85
- if (!tokens)
86
- return false;
87
- do {
88
- var last = tokens.pop();
89
- } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
90
-
91
- if (!last)
92
- return false;
93
-
94
- return (last.type == "keyword" && outdents[last.value]);
95
- };
96
-
97
- this.autoOutdent = function(state, doc, row) {
98
-
99
- row += 1;
100
- var indent = this.$getIndent(doc.getLine(row));
101
- var tab = doc.getTabString();
102
- if (indent.slice(-tab.length) == tab)
103
- doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
104
- };
105
-
106
- this.$id = "ace/mode/mushcode";
107
- }).call(Mode.prototype);
108
-
109
- exports.Mode = Mode;
110
- });
111
-
112
- define('ace/mode/mushcode_high_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
113
-
1
+ define("ace/mode/mushcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
114
3
 
115
4
  var oop = require("../lib/oop");
116
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
@@ -675,8 +564,8 @@ oop.inherits(MushCodeRules, TextHighlightRules);
675
564
  exports.MushCodeRules = MushCodeRules;
676
565
  });
677
566
 
678
- define('ace/mode/folding/pythonic', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
679
-
567
+ define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
568
+ "use strict";
680
569
 
681
570
  var oop = require("../../lib/oop");
682
571
  var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -703,3 +592,83 @@ oop.inherits(FoldMode, BaseFoldMode);
703
592
  }).call(FoldMode.prototype);
704
593
 
705
594
  });
595
+
596
+ define("ace/mode/mushcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mushcode_highlight_rules","ace/mode/folding/pythonic","ace/range"], function(require, exports, module) {
597
+ "use strict";
598
+
599
+ var oop = require("../lib/oop");
600
+ var TextMode = require("./text").Mode;
601
+ var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules;
602
+ var PythonFoldMode = require("./folding/pythonic").FoldMode;
603
+ var Range = require("../range").Range;
604
+
605
+ var Mode = function() {
606
+ this.HighlightRules = MushCodeRules;
607
+ this.foldingRules = new PythonFoldMode("\\:");
608
+ };
609
+ oop.inherits(Mode, TextMode);
610
+
611
+ (function() {
612
+
613
+ this.lineCommentStart = "#";
614
+
615
+ this.getNextLineIndent = function(state, line, tab) {
616
+ var indent = this.$getIndent(line);
617
+
618
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
619
+ var tokens = tokenizedLine.tokens;
620
+
621
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
622
+ return indent;
623
+ }
624
+
625
+ if (state == "start") {
626
+ var match = line.match(/^.*[\{\(\[\:]\s*$/);
627
+ if (match) {
628
+ indent += tab;
629
+ }
630
+ }
631
+
632
+ return indent;
633
+ };
634
+
635
+ var outdents = {
636
+ "pass": 1,
637
+ "return": 1,
638
+ "raise": 1,
639
+ "break": 1,
640
+ "continue": 1
641
+ };
642
+
643
+ this.checkOutdent = function(state, line, input) {
644
+ if (input !== "\r\n" && input !== "\r" && input !== "\n")
645
+ return false;
646
+
647
+ var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
648
+
649
+ if (!tokens)
650
+ return false;
651
+ do {
652
+ var last = tokens.pop();
653
+ } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
654
+
655
+ if (!last)
656
+ return false;
657
+
658
+ return (last.type == "keyword" && outdents[last.value]);
659
+ };
660
+
661
+ this.autoOutdent = function(state, doc, row) {
662
+
663
+ row += 1;
664
+ var indent = this.$getIndent(doc.getLine(row));
665
+ var tab = doc.getTabString();
666
+ if (indent.slice(-tab.length) == tab)
667
+ doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
668
+ };
669
+
670
+ this.$id = "ace/mode/mushcode";
671
+ }).call(Mode.prototype);
672
+
673
+ exports.Mode = Mode;
674
+ });
@@ -1,57 +1,48 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
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.
28
- *
29
- * ***** END LICENSE BLOCK ***** */
30
-
31
- define('ace/mode/mysql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/mysql_highlight_rules', 'ace/range'], function(require, exports, module) {
1
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
32
3
 
33
4
  var oop = require("../lib/oop");
34
- var TextMode = require("../mode/text").Mode;
35
- var Tokenizer = require("../tokenizer").Tokenizer;
36
- var MysqlHighlightRules = require("./mysql_highlight_rules").MysqlHighlightRules;
37
- var Range = require("../range").Range;
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
38
6
 
39
- var Mode = function() {
40
- this.HighlightRules = MysqlHighlightRules;
7
+ var DocCommentHighlightRules = function() {
8
+
9
+ this.$rules = {
10
+ "start" : [ {
11
+ token : "comment.doc.tag",
12
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
13
+ }, {
14
+ token : "comment.doc.tag",
15
+ regex : "\\bTODO\\b"
16
+ }, {
17
+ defaultToken : "comment.doc"
18
+ }]
19
+ };
41
20
  };
42
- oop.inherits(Mode, TextMode);
43
21
 
44
- (function() {
45
- this.lineCommentStart = ["--", "#"]; // todo space
46
- this.blockComment = {start: "/*", end: "*/"};
22
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
47
23
 
48
- this.$id = "ace/mode/mysql";
49
- }).call(Mode.prototype);
24
+ DocCommentHighlightRules.getStartRule = function(start) {
25
+ return {
26
+ token : "comment.doc", // doc comment
27
+ regex : "\\/\\*(?=\\*)",
28
+ next : start
29
+ };
30
+ };
31
+
32
+ DocCommentHighlightRules.getEndRule = function (start) {
33
+ return {
34
+ token : "comment.doc", // closing comment
35
+ regex : "\\*\\/",
36
+ next : start
37
+ };
38
+ };
39
+
40
+
41
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
50
42
 
51
- exports.Mode = Mode;
52
43
  });
53
44
 
54
- define('ace/mode/mysql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
45
+ define("ace/mode/mysql_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
55
46
 
56
47
  var oop = require("../lib/oop");
57
48
  var lang = require("../lib/lang");
@@ -140,46 +131,24 @@ oop.inherits(MysqlHighlightRules, TextHighlightRules);
140
131
  exports.MysqlHighlightRules = MysqlHighlightRules;
141
132
  });
142
133
 
143
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
144
-
134
+ define("ace/mode/mysql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mysql_highlight_rules","ace/range"], function(require, exports, module) {
145
135
 
146
136
  var oop = require("../lib/oop");
147
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
148
-
149
- var DocCommentHighlightRules = function() {
150
-
151
- this.$rules = {
152
- "start" : [ {
153
- token : "comment.doc.tag",
154
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
155
- }, {
156
- token : "comment.doc.tag",
157
- regex : "\\bTODO\\b"
158
- }, {
159
- defaultToken : "comment.doc"
160
- }]
161
- };
162
- };
163
-
164
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
165
-
166
- DocCommentHighlightRules.getStartRule = function(start) {
167
- return {
168
- token : "comment.doc", // doc comment
169
- regex : "\\/\\*(?=\\*)",
170
- next : start
171
- };
172
- };
137
+ var TextMode = require("../mode/text").Mode;
138
+ var MysqlHighlightRules = require("./mysql_highlight_rules").MysqlHighlightRules;
139
+ var Range = require("../range").Range;
173
140
 
174
- DocCommentHighlightRules.getEndRule = function (start) {
175
- return {
176
- token : "comment.doc", // closing comment
177
- regex : "\\*\\/",
178
- next : start
179
- };
141
+ var Mode = function() {
142
+ this.HighlightRules = MysqlHighlightRules;
180
143
  };
144
+ oop.inherits(Mode, TextMode);
181
145
 
146
+ (function() {
147
+ this.lineCommentStart = ["--", "#"]; // todo space
148
+ this.blockComment = {start: "/*", end: "*/"};
182
149
 
183
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
150
+ this.$id = "ace/mode/mysql";
151
+ }).call(Mode.prototype);
184
152
 
153
+ exports.Mode = Mode;
185
154
  });
@@ -1,142 +1,54 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
4
- * Copyright (c) 2012, 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.
28
- *
29
- *
30
- * Contributor(s):
31
- *
32
- * Zef Hemel
33
- *
34
- * ***** END LICENSE BLOCK ***** */
35
-
36
- define('ace/mode/nix', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp', 'ace/tokenizer', 'ace/mode/nix_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) {
37
-
1
+ define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
38
3
 
39
4
  var oop = require("../lib/oop");
40
- var CMode = require("./c_cpp").Mode;
41
- var Tokenizer = require("../tokenizer").Tokenizer;
42
- var NixHighlightRules = require("./nix_highlight_rules").NixHighlightRules;
43
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
44
-
45
- var Mode = function() {
46
- CMode.call(this);
47
- this.HighlightRules = NixHighlightRules;
48
- this.foldingRules = new CStyleFoldMode();
49
- };
50
- oop.inherits(Mode, CMode);
51
-
52
- (function() {
53
- this.lineCommentStart = "#";
54
- this.blockComment = {start: "/*", end: "*/"};
55
- this.$id = "ace/mode/nix";
56
- }).call(Mode.prototype);
57
-
58
- exports.Mode = Mode;
59
- });
60
-
61
- define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
62
-
63
-
64
- var oop = require("../lib/oop");
65
- var TextMode = require("./text").Mode;
66
- var Tokenizer = require("../tokenizer").Tokenizer;
67
- var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
68
- var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
69
- var Range = require("../range").Range;
70
- var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
71
- var CStyleFoldMode = require("./folding/cstyle").FoldMode;
72
-
73
- var Mode = function() {
74
- this.HighlightRules = c_cppHighlightRules;
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
75
6
 
76
- this.$outdent = new MatchingBraceOutdent();
77
- this.$behaviour = new CstyleBehaviour();
7
+ var DocCommentHighlightRules = function() {
78
8
 
79
- this.foldingRules = new CStyleFoldMode();
9
+ this.$rules = {
10
+ "start" : [ {
11
+ token : "comment.doc.tag",
12
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
13
+ }, {
14
+ token : "comment.doc.tag",
15
+ regex : "\\bTODO\\b"
16
+ }, {
17
+ defaultToken : "comment.doc"
18
+ }]
19
+ };
80
20
  };
81
- oop.inherits(Mode, TextMode);
82
-
83
- (function() {
84
21
 
85
- this.lineCommentStart = "//";
86
- this.blockComment = {start: "/*", end: "*/"};
87
-
88
- this.getNextLineIndent = function(state, line, tab) {
89
- var indent = this.$getIndent(line);
90
-
91
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
92
- var tokens = tokenizedLine.tokens;
93
- var endState = tokenizedLine.state;
94
-
95
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
96
- return indent;
97
- }
98
-
99
- if (state == "start") {
100
- var match = line.match(/^.*[\{\(\[]\s*$/);
101
- if (match) {
102
- indent += tab;
103
- }
104
- } else if (state == "doc-start") {
105
- if (endState == "start") {
106
- return "";
107
- }
108
- var match = line.match(/^\s*(\/?)\*/);
109
- if (match) {
110
- if (match[1]) {
111
- indent += " ";
112
- }
113
- indent += "* ";
114
- }
115
- }
22
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
116
23
 
117
- return indent;
24
+ DocCommentHighlightRules.getStartRule = function(start) {
25
+ return {
26
+ token : "comment.doc", // doc comment
27
+ regex : "\\/\\*(?=\\*)",
28
+ next : start
118
29
  };
30
+ };
119
31
 
120
- this.checkOutdent = function(state, line, input) {
121
- return this.$outdent.checkOutdent(line, input);
32
+ DocCommentHighlightRules.getEndRule = function (start) {
33
+ return {
34
+ token : "comment.doc", // closing comment
35
+ regex : "\\*\\/",
36
+ next : start
122
37
  };
38
+ };
123
39
 
124
- this.autoOutdent = function(state, doc, row) {
125
- this.$outdent.autoOutdent(doc, row);
126
- };
127
40
 
128
- this.$id = "ace/mode/c_cpp";
129
- }).call(Mode.prototype);
41
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
130
42
 
131
- exports.Mode = Mode;
132
43
  });
133
- define('ace/mode/c_cpp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
134
44
 
45
+ define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
46
+ "use strict";
135
47
 
136
48
  var oop = require("../lib/oop");
137
49
  var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
138
50
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
139
- var cFunctions = exports.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b"
51
+ var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b"
140
52
 
141
53
  var c_cppHighlightRules = function() {
142
54
 
@@ -152,8 +64,9 @@ var c_cppHighlightRules = function() {
152
64
  );
153
65
 
154
66
  var storageModifiers = (
155
- "const|extern|register|restrict|static|volatile|inline|private:|" +
156
- "protected:|public:|friend|explicit|virtual|export|mutable|typename"
67
+ "const|extern|register|restrict|static|volatile|inline|private|" +
68
+ "protected|public|friend|explicit|virtual|export|mutable|typename|" +
69
+ "constexpr|new|delete"
157
70
  );
158
71
 
159
72
  var keywordOperators = (
@@ -308,52 +221,8 @@ oop.inherits(c_cppHighlightRules, TextHighlightRules);
308
221
  exports.c_cppHighlightRules = c_cppHighlightRules;
309
222
  });
310
223
 
311
- define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
312
-
313
-
314
- var oop = require("../lib/oop");
315
- var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
316
-
317
- var DocCommentHighlightRules = function() {
318
-
319
- this.$rules = {
320
- "start" : [ {
321
- token : "comment.doc.tag",
322
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
323
- }, {
324
- token : "comment.doc.tag",
325
- regex : "\\bTODO\\b"
326
- }, {
327
- defaultToken : "comment.doc"
328
- }]
329
- };
330
- };
331
-
332
- oop.inherits(DocCommentHighlightRules, TextHighlightRules);
333
-
334
- DocCommentHighlightRules.getStartRule = function(start) {
335
- return {
336
- token : "comment.doc", // doc comment
337
- regex : "\\/\\*(?=\\*)",
338
- next : start
339
- };
340
- };
341
-
342
- DocCommentHighlightRules.getEndRule = function (start) {
343
- return {
344
- token : "comment.doc", // closing comment
345
- regex : "\\*\\/",
346
- next : start
347
- };
348
- };
349
-
350
-
351
- exports.DocCommentHighlightRules = DocCommentHighlightRules;
352
-
353
- });
354
-
355
- define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
356
-
224
+ define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
225
+ "use strict";
357
226
 
358
227
  var Range = require("../range").Range;
359
228
 
@@ -392,8 +261,8 @@ var MatchingBraceOutdent = function() {};
392
261
  exports.MatchingBraceOutdent = MatchingBraceOutdent;
393
262
  });
394
263
 
395
- define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
396
-
264
+ define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
265
+ "use strict";
397
266
 
398
267
  var oop = require("../../lib/oop");
399
268
  var Behaviour = require("../behaviour").Behaviour;
@@ -405,83 +274,34 @@ var SAFE_INSERT_IN_TOKENS =
405
274
  var SAFE_INSERT_BEFORE_TOKENS =
406
275
  ["text", "paren.rparen", "punctuation.operator", "comment"];
407
276
 
408
-
409
- var autoInsertedBrackets = 0;
410
- var autoInsertedRow = -1;
411
- var autoInsertedLineEnd = "";
412
- var maybeInsertedBrackets = 0;
413
- var maybeInsertedRow = -1;
414
- var maybeInsertedLineStart = "";
415
- var maybeInsertedLineEnd = "";
416
-
417
- var CstyleBehaviour = function () {
418
-
419
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
420
- var cursor = editor.getCursorPosition();
421
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
422
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
423
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
424
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
425
- return false;
426
- }
427
- iterator.stepForward();
428
- return iterator.getCurrentTokenRow() !== cursor.row ||
429
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
430
- };
431
-
432
- CstyleBehaviour.$matchTokenType = function(token, types) {
433
- return types.indexOf(token.type || token) > -1;
434
- };
435
-
436
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
437
- var cursor = editor.getCursorPosition();
438
- var line = session.doc.getLine(cursor.row);
439
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
440
- autoInsertedBrackets = 0;
441
- autoInsertedRow = cursor.row;
442
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
443
- autoInsertedBrackets++;
444
- };
445
-
446
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
447
- var cursor = editor.getCursorPosition();
448
- var line = session.doc.getLine(cursor.row);
449
- if (!this.isMaybeInsertedClosing(cursor, line))
450
- maybeInsertedBrackets = 0;
451
- maybeInsertedRow = cursor.row;
452
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
453
- maybeInsertedLineEnd = line.substr(cursor.column);
454
- maybeInsertedBrackets++;
455
- };
456
-
457
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
458
- return autoInsertedBrackets > 0 &&
459
- cursor.row === autoInsertedRow &&
460
- bracket === autoInsertedLineEnd[0] &&
461
- line.substr(cursor.column) === autoInsertedLineEnd;
462
- };
463
-
464
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
465
- return maybeInsertedBrackets > 0 &&
466
- cursor.row === maybeInsertedRow &&
467
- line.substr(cursor.column) === maybeInsertedLineEnd &&
468
- line.substr(0, cursor.column) == maybeInsertedLineStart;
469
- };
470
-
471
- CstyleBehaviour.popAutoInsertedClosing = function() {
472
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
473
- autoInsertedBrackets--;
474
- };
475
-
476
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
477
- maybeInsertedBrackets = 0;
478
- maybeInsertedRow = -1;
277
+ var context;
278
+ var contextCache = {}
279
+ var initContext = function(editor) {
280
+ var id = -1;
281
+ if (editor.multiSelect) {
282
+ id = editor.selection.id;
283
+ if (contextCache.rangeCount != editor.multiSelect.rangeCount)
284
+ contextCache = {rangeCount: editor.multiSelect.rangeCount};
285
+ }
286
+ if (contextCache[id])
287
+ return context = contextCache[id];
288
+ context = contextCache[id] = {
289
+ autoInsertedBrackets: 0,
290
+ autoInsertedRow: -1,
291
+ autoInsertedLineEnd: "",
292
+ maybeInsertedBrackets: 0,
293
+ maybeInsertedRow: -1,
294
+ maybeInsertedLineStart: "",
295
+ maybeInsertedLineEnd: ""
479
296
  };
297
+ };
480
298
 
481
- this.add("braces", "insertion", function (state, action, editor, session, text) {
299
+ var CstyleBehaviour = function() {
300
+ this.add("braces", "insertion", function(state, action, editor, session, text) {
482
301
  var cursor = editor.getCursorPosition();
483
302
  var line = session.doc.getLine(cursor.row);
484
303
  if (text == '{') {
304
+ initContext(editor);
485
305
  var selection = editor.getSelectionRange();
486
306
  var selected = session.doc.getTextRange(selection);
487
307
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
@@ -505,6 +325,7 @@ var CstyleBehaviour = function () {
505
325
  }
506
326
  }
507
327
  } else if (text == '}') {
328
+ initContext(editor);
508
329
  var rightChar = line.substring(cursor.column, cursor.column + 1);
509
330
  if (rightChar == '}') {
510
331
  var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
@@ -517,9 +338,10 @@ var CstyleBehaviour = function () {
517
338
  }
518
339
  }
519
340
  } else if (text == "\n" || text == "\r\n") {
341
+ initContext(editor);
520
342
  var closing = "";
521
343
  if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
522
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
344
+ closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
523
345
  CstyleBehaviour.clearMaybeInsertedClosing();
524
346
  }
525
347
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -531,6 +353,7 @@ var CstyleBehaviour = function () {
531
353
  } else if (closing) {
532
354
  var next_indent = this.$getIndent(line);
533
355
  } else {
356
+ CstyleBehaviour.clearMaybeInsertedClosing();
534
357
  return;
535
358
  }
536
359
  var indent = next_indent + session.getTabString();
@@ -544,22 +367,24 @@ var CstyleBehaviour = function () {
544
367
  }
545
368
  });
546
369
 
547
- this.add("braces", "deletion", function (state, action, editor, session, range) {
370
+ this.add("braces", "deletion", function(state, action, editor, session, range) {
548
371
  var selected = session.doc.getTextRange(range);
549
372
  if (!range.isMultiLine() && selected == '{') {
373
+ initContext(editor);
550
374
  var line = session.doc.getLine(range.start.row);
551
375
  var rightChar = line.substring(range.end.column, range.end.column + 1);
552
376
  if (rightChar == '}') {
553
377
  range.end.column++;
554
378
  return range;
555
379
  } else {
556
- maybeInsertedBrackets--;
380
+ context.maybeInsertedBrackets--;
557
381
  }
558
382
  }
559
383
  });
560
384
 
561
- this.add("parens", "insertion", function (state, action, editor, session, text) {
385
+ this.add("parens", "insertion", function(state, action, editor, session, text) {
562
386
  if (text == '(') {
387
+ initContext(editor);
563
388
  var selection = editor.getSelectionRange();
564
389
  var selected = session.doc.getTextRange(selection);
565
390
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -575,6 +400,7 @@ var CstyleBehaviour = function () {
575
400
  };
576
401
  }
577
402
  } else if (text == ')') {
403
+ initContext(editor);
578
404
  var cursor = editor.getCursorPosition();
579
405
  var line = session.doc.getLine(cursor.row);
580
406
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -591,9 +417,10 @@ var CstyleBehaviour = function () {
591
417
  }
592
418
  });
593
419
 
594
- this.add("parens", "deletion", function (state, action, editor, session, range) {
420
+ this.add("parens", "deletion", function(state, action, editor, session, range) {
595
421
  var selected = session.doc.getTextRange(range);
596
422
  if (!range.isMultiLine() && selected == '(') {
423
+ initContext(editor);
597
424
  var line = session.doc.getLine(range.start.row);
598
425
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
599
426
  if (rightChar == ')') {
@@ -603,8 +430,9 @@ var CstyleBehaviour = function () {
603
430
  }
604
431
  });
605
432
 
606
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
433
+ this.add("brackets", "insertion", function(state, action, editor, session, text) {
607
434
  if (text == '[') {
435
+ initContext(editor);
608
436
  var selection = editor.getSelectionRange();
609
437
  var selected = session.doc.getTextRange(selection);
610
438
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@@ -620,6 +448,7 @@ var CstyleBehaviour = function () {
620
448
  };
621
449
  }
622
450
  } else if (text == ']') {
451
+ initContext(editor);
623
452
  var cursor = editor.getCursorPosition();
624
453
  var line = session.doc.getLine(cursor.row);
625
454
  var rightChar = line.substring(cursor.column, cursor.column + 1);
@@ -636,9 +465,10 @@ var CstyleBehaviour = function () {
636
465
  }
637
466
  });
638
467
 
639
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
468
+ this.add("brackets", "deletion", function(state, action, editor, session, range) {
640
469
  var selected = session.doc.getTextRange(range);
641
470
  if (!range.isMultiLine() && selected == '[') {
471
+ initContext(editor);
642
472
  var line = session.doc.getLine(range.start.row);
643
473
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
644
474
  if (rightChar == ']') {
@@ -648,8 +478,9 @@ var CstyleBehaviour = function () {
648
478
  }
649
479
  });
650
480
 
651
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
481
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
652
482
  if (text == '"' || text == "'") {
483
+ initContext(editor);
653
484
  var quote = text;
654
485
  var selection = editor.getSelectionRange();
655
486
  var selected = session.doc.getTextRange(selection);
@@ -701,9 +532,10 @@ var CstyleBehaviour = function () {
701
532
  }
702
533
  });
703
534
 
704
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
535
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
705
536
  var selected = session.doc.getTextRange(range);
706
537
  if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
538
+ initContext(editor);
707
539
  var line = session.doc.getLine(range.start.row);
708
540
  var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
709
541
  if (rightChar == selected) {
@@ -715,13 +547,80 @@ var CstyleBehaviour = function () {
715
547
 
716
548
  };
717
549
 
550
+
551
+ CstyleBehaviour.isSaneInsertion = function(editor, session) {
552
+ var cursor = editor.getCursorPosition();
553
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
554
+ if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
555
+ var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
556
+ if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
557
+ return false;
558
+ }
559
+ iterator.stepForward();
560
+ return iterator.getCurrentTokenRow() !== cursor.row ||
561
+ this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
562
+ };
563
+
564
+ CstyleBehaviour.$matchTokenType = function(token, types) {
565
+ return types.indexOf(token.type || token) > -1;
566
+ };
567
+
568
+ CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
569
+ var cursor = editor.getCursorPosition();
570
+ var line = session.doc.getLine(cursor.row);
571
+ if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
572
+ context.autoInsertedBrackets = 0;
573
+ context.autoInsertedRow = cursor.row;
574
+ context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
575
+ context.autoInsertedBrackets++;
576
+ };
577
+
578
+ CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
579
+ var cursor = editor.getCursorPosition();
580
+ var line = session.doc.getLine(cursor.row);
581
+ if (!this.isMaybeInsertedClosing(cursor, line))
582
+ context.maybeInsertedBrackets = 0;
583
+ context.maybeInsertedRow = cursor.row;
584
+ context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
585
+ context.maybeInsertedLineEnd = line.substr(cursor.column);
586
+ context.maybeInsertedBrackets++;
587
+ };
588
+
589
+ CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
590
+ return context.autoInsertedBrackets > 0 &&
591
+ cursor.row === context.autoInsertedRow &&
592
+ bracket === context.autoInsertedLineEnd[0] &&
593
+ line.substr(cursor.column) === context.autoInsertedLineEnd;
594
+ };
595
+
596
+ CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
597
+ return context.maybeInsertedBrackets > 0 &&
598
+ cursor.row === context.maybeInsertedRow &&
599
+ line.substr(cursor.column) === context.maybeInsertedLineEnd &&
600
+ line.substr(0, cursor.column) == context.maybeInsertedLineStart;
601
+ };
602
+
603
+ CstyleBehaviour.popAutoInsertedClosing = function() {
604
+ context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
605
+ context.autoInsertedBrackets--;
606
+ };
607
+
608
+ CstyleBehaviour.clearMaybeInsertedClosing = function() {
609
+ if (context) {
610
+ context.maybeInsertedBrackets = 0;
611
+ context.maybeInsertedRow = -1;
612
+ }
613
+ };
614
+
615
+
616
+
718
617
  oop.inherits(CstyleBehaviour, Behaviour);
719
618
 
720
619
  exports.CstyleBehaviour = CstyleBehaviour;
721
620
  });
722
621
 
723
- define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
724
-
622
+ define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
623
+ "use strict";
725
624
 
726
625
  var oop = require("../../lib/oop");
727
626
  var Range = require("../../range").Range;
@@ -814,8 +713,81 @@ oop.inherits(FoldMode, BaseFoldMode);
814
713
  }).call(FoldMode.prototype);
815
714
 
816
715
  });
817
- define('ace/mode/nix_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
818
-
716
+
717
+ define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
718
+ "use strict";
719
+
720
+ var oop = require("../lib/oop");
721
+ var TextMode = require("./text").Mode;
722
+ var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
723
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
724
+ var Range = require("../range").Range;
725
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
726
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
727
+
728
+ var Mode = function() {
729
+ this.HighlightRules = c_cppHighlightRules;
730
+
731
+ this.$outdent = new MatchingBraceOutdent();
732
+ this.$behaviour = new CstyleBehaviour();
733
+
734
+ this.foldingRules = new CStyleFoldMode();
735
+ };
736
+ oop.inherits(Mode, TextMode);
737
+
738
+ (function() {
739
+
740
+ this.lineCommentStart = "//";
741
+ this.blockComment = {start: "/*", end: "*/"};
742
+
743
+ this.getNextLineIndent = function(state, line, tab) {
744
+ var indent = this.$getIndent(line);
745
+
746
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
747
+ var tokens = tokenizedLine.tokens;
748
+ var endState = tokenizedLine.state;
749
+
750
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
751
+ return indent;
752
+ }
753
+
754
+ if (state == "start") {
755
+ var match = line.match(/^.*[\{\(\[]\s*$/);
756
+ if (match) {
757
+ indent += tab;
758
+ }
759
+ } else if (state == "doc-start") {
760
+ if (endState == "start") {
761
+ return "";
762
+ }
763
+ var match = line.match(/^\s*(\/?)\*/);
764
+ if (match) {
765
+ if (match[1]) {
766
+ indent += " ";
767
+ }
768
+ indent += "* ";
769
+ }
770
+ }
771
+
772
+ return indent;
773
+ };
774
+
775
+ this.checkOutdent = function(state, line, input) {
776
+ return this.$outdent.checkOutdent(line, input);
777
+ };
778
+
779
+ this.autoOutdent = function(state, doc, row) {
780
+ this.$outdent.autoOutdent(doc, row);
781
+ };
782
+
783
+ this.$id = "ace/mode/c_cpp";
784
+ }).call(Mode.prototype);
785
+
786
+ exports.Mode = Mode;
787
+ });
788
+
789
+ define("ace/mode/nix_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
790
+ "use strict";
819
791
 
820
792
  var oop = require("../lib/oop");
821
793
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
@@ -932,4 +904,28 @@ define('ace/mode/nix_highlight_rules', ['require', 'exports', 'module' , 'ace/li
932
904
  oop.inherits(NixHighlightRules, TextHighlightRules);
933
905
 
934
906
  exports.NixHighlightRules = NixHighlightRules;
935
- });
907
+ });
908
+
909
+ define("ace/mode/nix",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/nix_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
910
+ "use strict";
911
+
912
+ var oop = require("../lib/oop");
913
+ var CMode = require("./c_cpp").Mode;
914
+ var NixHighlightRules = require("./nix_highlight_rules").NixHighlightRules;
915
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
916
+
917
+ var Mode = function() {
918
+ CMode.call(this);
919
+ this.HighlightRules = NixHighlightRules;
920
+ this.foldingRules = new CStyleFoldMode();
921
+ };
922
+ oop.inherits(Mode, CMode);
923
+
924
+ (function() {
925
+ this.lineCommentStart = "#";
926
+ this.blockComment = {start: "/*", end: "*/"};
927
+ this.$id = "ace/mode/nix";
928
+ }).call(Mode.prototype);
929
+
930
+ exports.Mode = Mode;
931
+ });