ace-rails-ap 4.1.2 → 4.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (363) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ace/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/ace/ace.js +752 -261
  4. data/vendor/assets/javascripts/ace/ext-beautify.js +0 -0
  5. data/vendor/assets/javascripts/ace/ext-chromevox.js +0 -0
  6. data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +0 -0
  7. data/vendor/assets/javascripts/ace/ext-emmet.js +0 -0
  8. data/vendor/assets/javascripts/ace/ext-error_marker.js +0 -0
  9. data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +0 -0
  10. data/vendor/assets/javascripts/ace/ext-language_tools.js +19 -9
  11. data/vendor/assets/javascripts/ace/ext-linking.js +9 -0
  12. data/vendor/assets/javascripts/ace/ext-modelist.js +2 -0
  13. data/vendor/assets/javascripts/ace/ext-old_ie.js +0 -0
  14. data/vendor/assets/javascripts/ace/ext-searchbox.js +158 -66
  15. data/vendor/assets/javascripts/ace/ext-settings_menu.js +3 -0
  16. data/vendor/assets/javascripts/ace/ext-spellcheck.js +0 -0
  17. data/vendor/assets/javascripts/ace/ext-split.js +0 -0
  18. data/vendor/assets/javascripts/ace/ext-static_highlight.js +1 -1
  19. data/vendor/assets/javascripts/ace/ext-statusbar.js +0 -0
  20. data/vendor/assets/javascripts/ace/ext-textarea.js +1 -0
  21. data/vendor/assets/javascripts/ace/ext-themelist.js +1 -0
  22. data/vendor/assets/javascripts/ace/ext-whitespace.js +24 -3
  23. data/vendor/assets/javascripts/ace/keybinding-emacs.js +0 -0
  24. data/vendor/assets/javascripts/ace/keybinding-vim.js +12 -4
  25. data/vendor/assets/javascripts/ace/mode-abap.js +0 -0
  26. data/vendor/assets/javascripts/ace/mode-abc.js +0 -0
  27. data/vendor/assets/javascripts/ace/mode-actionscript.js +0 -0
  28. data/vendor/assets/javascripts/ace/mode-ada.js +0 -0
  29. data/vendor/assets/javascripts/ace/mode-apache_conf.js +0 -0
  30. data/vendor/assets/javascripts/ace/mode-applescript.js +0 -0
  31. data/vendor/assets/javascripts/ace/mode-asciidoc.js +0 -0
  32. data/vendor/assets/javascripts/ace/mode-assembly_x86.js +0 -0
  33. data/vendor/assets/javascripts/ace/mode-autohotkey.js +0 -0
  34. data/vendor/assets/javascripts/ace/mode-bash.js +247 -0
  35. data/vendor/assets/javascripts/ace/mode-batchfile.js +0 -0
  36. data/vendor/assets/javascripts/ace/mode-bro.js +0 -0
  37. data/vendor/assets/javascripts/ace/mode-c9search.js +0 -5
  38. data/vendor/assets/javascripts/ace/mode-c_cpp.js +2 -3
  39. data/vendor/assets/javascripts/ace/mode-cirru.js +0 -0
  40. data/vendor/assets/javascripts/ace/mode-clojure.js +0 -0
  41. data/vendor/assets/javascripts/ace/mode-cobol.js +0 -0
  42. data/vendor/assets/javascripts/ace/mode-coffee.js +0 -0
  43. data/vendor/assets/javascripts/ace/mode-coldfusion.js +132 -78
  44. data/vendor/assets/javascripts/ace/mode-csharp.js +3 -4
  45. data/vendor/assets/javascripts/ace/mode-css.js +95 -47
  46. data/vendor/assets/javascripts/ace/mode-curly.js +132 -78
  47. data/vendor/assets/javascripts/ace/mode-d.js +0 -0
  48. data/vendor/assets/javascripts/ace/mode-dart.js +5 -8
  49. data/vendor/assets/javascripts/ace/mode-diff.js +0 -0
  50. data/vendor/assets/javascripts/ace/mode-django.js +132 -83
  51. data/vendor/assets/javascripts/ace/mode-dockerfile.js +0 -0
  52. data/vendor/assets/javascripts/ace/mode-dot.js +2 -5
  53. data/vendor/assets/javascripts/ace/mode-drools.js +4 -6
  54. data/vendor/assets/javascripts/ace/mode-eiffel.js +0 -0
  55. data/vendor/assets/javascripts/ace/mode-ejs.js +137 -78
  56. data/vendor/assets/javascripts/ace/mode-elixir.js +0 -0
  57. data/vendor/assets/javascripts/ace/mode-elm.js +0 -0
  58. data/vendor/assets/javascripts/ace/mode-erlang.js +0 -0
  59. data/vendor/assets/javascripts/ace/mode-forth.js +0 -0
  60. data/vendor/assets/javascripts/ace/mode-fortran.js +0 -0
  61. data/vendor/assets/javascripts/ace/mode-ftl.js +122 -78
  62. data/vendor/assets/javascripts/ace/mode-gcode.js +0 -0
  63. data/vendor/assets/javascripts/ace/mode-gherkin.js +0 -0
  64. data/vendor/assets/javascripts/ace/mode-gitignore.js +0 -0
  65. data/vendor/assets/javascripts/ace/mode-glsl.js +2 -3
  66. data/vendor/assets/javascripts/ace/mode-gobstones.js +23 -17
  67. data/vendor/assets/javascripts/ace/mode-golang.js +0 -0
  68. data/vendor/assets/javascripts/ace/mode-graphqlschema.js +206 -0
  69. data/vendor/assets/javascripts/ace/mode-groovy.js +23 -17
  70. data/vendor/assets/javascripts/ace/mode-haml.js +247 -183
  71. data/vendor/assets/javascripts/ace/mode-handlebars.js +132 -78
  72. data/vendor/assets/javascripts/ace/mode-haskell.js +0 -0
  73. data/vendor/assets/javascripts/ace/mode-haskell_cabal.js +0 -0
  74. data/vendor/assets/javascripts/ace/mode-haxe.js +2 -3
  75. data/vendor/assets/javascripts/ace/mode-hjson.js +0 -0
  76. data/vendor/assets/javascripts/ace/mode-html.js +132 -78
  77. data/vendor/assets/javascripts/ace/mode-html_elixir.js +132 -78
  78. data/vendor/assets/javascripts/ace/mode-html_ruby.js +137 -78
  79. data/vendor/assets/javascripts/ace/mode-ini.js +0 -0
  80. data/vendor/assets/javascripts/ace/mode-io.js +0 -0
  81. data/vendor/assets/javascripts/ace/mode-jack.js +0 -0
  82. data/vendor/assets/javascripts/ace/mode-jade.js +150 -86
  83. data/vendor/assets/javascripts/ace/mode-java.js +23 -17
  84. data/vendor/assets/javascripts/ace/mode-javascript.js +21 -14
  85. data/vendor/assets/javascripts/ace/mode-json.js +16 -8
  86. data/vendor/assets/javascripts/ace/mode-jsoniq.js +27 -11
  87. data/vendor/assets/javascripts/ace/mode-jsp.js +122 -78
  88. data/vendor/assets/javascripts/ace/mode-jsx.js +2 -3
  89. data/vendor/assets/javascripts/ace/mode-julia.js +0 -0
  90. data/vendor/assets/javascripts/ace/mode-kotlin.js +0 -0
  91. data/vendor/assets/javascripts/ace/mode-latex.js +3 -2
  92. data/vendor/assets/javascripts/ace/mode-lean.js +0 -0
  93. data/vendor/assets/javascripts/ace/mode-less.js +97 -50
  94. data/vendor/assets/javascripts/ace/mode-liquid.js +120 -75
  95. data/vendor/assets/javascripts/ace/mode-lisp.js +0 -0
  96. data/vendor/assets/javascripts/ace/mode-live_script.js +0 -0
  97. data/vendor/assets/javascripts/ace/mode-livescript.js +0 -0
  98. data/vendor/assets/javascripts/ace/mode-logiql.js +0 -0
  99. data/vendor/assets/javascripts/ace/mode-lsl.js +0 -0
  100. data/vendor/assets/javascripts/ace/mode-lua.js +4 -4
  101. data/vendor/assets/javascripts/ace/mode-luapage.js +136 -82
  102. data/vendor/assets/javascripts/ace/mode-lucene.js +0 -0
  103. data/vendor/assets/javascripts/ace/mode-makefile.js +0 -0
  104. data/vendor/assets/javascripts/ace/mode-markdown.js +133 -80
  105. data/vendor/assets/javascripts/ace/mode-mask.js +121 -77
  106. data/vendor/assets/javascripts/ace/mode-matlab.js +0 -0
  107. data/vendor/assets/javascripts/ace/mode-maze.js +0 -0
  108. data/vendor/assets/javascripts/ace/mode-mel.js +0 -0
  109. data/vendor/assets/javascripts/ace/mode-mips_assembler.js +0 -0
  110. data/vendor/assets/javascripts/ace/mode-mipsassembler.js +0 -0
  111. data/vendor/assets/javascripts/ace/mode-mushcode.js +0 -0
  112. data/vendor/assets/javascripts/ace/mode-mysql.js +0 -0
  113. data/vendor/assets/javascripts/ace/mode-nix.js +4 -6
  114. data/vendor/assets/javascripts/ace/mode-nsis.js +0 -0
  115. data/vendor/assets/javascripts/ace/mode-objectivec.js +3 -5
  116. data/vendor/assets/javascripts/ace/mode-ocaml.js +2 -3
  117. data/vendor/assets/javascripts/ace/mode-pascal.js +0 -0
  118. data/vendor/assets/javascripts/ace/mode-perl.js +0 -0
  119. data/vendor/assets/javascripts/ace/mode-pgsql.js +42 -31
  120. data/vendor/assets/javascripts/ace/mode-php.js +132 -78
  121. data/vendor/assets/javascripts/ace/mode-pig.js +303 -0
  122. data/vendor/assets/javascripts/ace/mode-plain_text.js +0 -0
  123. data/vendor/assets/javascripts/ace/mode-powershell.js +0 -0
  124. data/vendor/assets/javascripts/ace/mode-praat.js +0 -0
  125. data/vendor/assets/javascripts/ace/mode-prolog.js +0 -0
  126. data/vendor/assets/javascripts/ace/mode-properties.js +0 -0
  127. data/vendor/assets/javascripts/ace/mode-protobuf.js +6 -8
  128. data/vendor/assets/javascripts/ace/mode-python.js +0 -0
  129. data/vendor/assets/javascripts/ace/mode-r.js +0 -0
  130. data/vendor/assets/javascripts/ace/mode-razor.js +135 -82
  131. data/vendor/assets/javascripts/ace/mode-rdoc.js +0 -0
  132. data/vendor/assets/javascripts/ace/mode-rhtml.js +132 -78
  133. data/vendor/assets/javascripts/ace/mode-rst.js +0 -0
  134. data/vendor/assets/javascripts/ace/mode-ruby.js +5 -0
  135. data/vendor/assets/javascripts/ace/mode-rust.js +1 -0
  136. data/vendor/assets/javascripts/ace/mode-sass.js +27 -6
  137. data/vendor/assets/javascripts/ace/mode-scad.js +2 -3
  138. data/vendor/assets/javascripts/ace/mode-scala.js +23 -17
  139. data/vendor/assets/javascripts/ace/mode-scheme.js +0 -0
  140. data/vendor/assets/javascripts/ace/mode-scss.js +27 -6
  141. data/vendor/assets/javascripts/ace/mode-sh.js +0 -0
  142. data/vendor/assets/javascripts/ace/mode-sjs.js +21 -14
  143. data/vendor/assets/javascripts/ace/mode-smarty.js +132 -78
  144. data/vendor/assets/javascripts/ace/mode-snippets.js +0 -0
  145. data/vendor/assets/javascripts/ace/mode-soy_template.js +132 -78
  146. data/vendor/assets/javascripts/ace/mode-space.js +0 -0
  147. data/vendor/assets/javascripts/ace/mode-sparql.js +313 -0
  148. data/vendor/assets/javascripts/ace/mode-sql.js +3 -0
  149. data/vendor/assets/javascripts/ace/mode-sqlserver.js +0 -0
  150. data/vendor/assets/javascripts/ace/mode-stylus.js +97 -50
  151. data/vendor/assets/javascripts/ace/mode-svg.js +37 -31
  152. data/vendor/assets/javascripts/ace/mode-swift.js +0 -0
  153. data/vendor/assets/javascripts/ace/mode-swig.js +0 -0
  154. data/vendor/assets/javascripts/ace/mode-tcl.js +0 -0
  155. data/vendor/assets/javascripts/ace/mode-tex.js +0 -0
  156. data/vendor/assets/javascripts/ace/mode-text.js +0 -0
  157. data/vendor/assets/javascripts/ace/mode-textile.js +0 -0
  158. data/vendor/assets/javascripts/ace/mode-toml.js +0 -0
  159. data/vendor/assets/javascripts/ace/mode-tsx.js +21 -14
  160. data/vendor/assets/javascripts/ace/mode-turtle.js +289 -0
  161. data/vendor/assets/javascripts/ace/mode-twig.js +132 -78
  162. data/vendor/assets/javascripts/ace/mode-typescript.js +21 -14
  163. data/vendor/assets/javascripts/ace/mode-vala.js +0 -0
  164. data/vendor/assets/javascripts/ace/mode-vbscript.js +0 -0
  165. data/vendor/assets/javascripts/ace/mode-velocity.js +132 -78
  166. data/vendor/assets/javascripts/ace/mode-verilog.js +0 -0
  167. data/vendor/assets/javascripts/ace/mode-vhdl.js +0 -0
  168. data/vendor/assets/javascripts/ace/mode-wollok.js +21 -14
  169. data/vendor/assets/javascripts/ace/mode-xml.js +16 -17
  170. data/vendor/assets/javascripts/ace/mode-xquery.js +0 -0
  171. data/vendor/assets/javascripts/ace/mode-yaml.js +40 -8
  172. data/vendor/assets/javascripts/ace/snippets/abap.js +0 -0
  173. data/vendor/assets/javascripts/ace/snippets/abc.js +0 -0
  174. data/vendor/assets/javascripts/ace/snippets/actionscript.js +0 -0
  175. data/vendor/assets/javascripts/ace/snippets/ada.js +0 -0
  176. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +0 -0
  177. data/vendor/assets/javascripts/ace/snippets/applescript.js +0 -0
  178. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +0 -0
  179. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +0 -0
  180. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +0 -0
  181. data/vendor/assets/javascripts/ace/snippets/batchfile.js +0 -0
  182. data/vendor/assets/javascripts/ace/snippets/bro.js +0 -0
  183. data/vendor/assets/javascripts/ace/snippets/c9search.js +0 -0
  184. data/vendor/assets/javascripts/ace/snippets/c_cpp.js +0 -0
  185. data/vendor/assets/javascripts/ace/snippets/cirru.js +0 -0
  186. data/vendor/assets/javascripts/ace/snippets/clojure.js +0 -0
  187. data/vendor/assets/javascripts/ace/snippets/cobol.js +0 -0
  188. data/vendor/assets/javascripts/ace/snippets/coffee.js +0 -0
  189. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +0 -0
  190. data/vendor/assets/javascripts/ace/snippets/csharp.js +0 -0
  191. data/vendor/assets/javascripts/ace/snippets/css.js +0 -0
  192. data/vendor/assets/javascripts/ace/snippets/curly.js +0 -0
  193. data/vendor/assets/javascripts/ace/snippets/d.js +0 -0
  194. data/vendor/assets/javascripts/ace/snippets/dart.js +0 -0
  195. data/vendor/assets/javascripts/ace/snippets/diff.js +0 -0
  196. data/vendor/assets/javascripts/ace/snippets/django.js +0 -0
  197. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +0 -0
  198. data/vendor/assets/javascripts/ace/snippets/dot.js +0 -0
  199. data/vendor/assets/javascripts/ace/snippets/drools.js +0 -0
  200. data/vendor/assets/javascripts/ace/snippets/eiffel.js +0 -0
  201. data/vendor/assets/javascripts/ace/snippets/ejs.js +0 -0
  202. data/vendor/assets/javascripts/ace/snippets/elixir.js +0 -0
  203. data/vendor/assets/javascripts/ace/snippets/elm.js +0 -0
  204. data/vendor/assets/javascripts/ace/snippets/erlang.js +0 -0
  205. data/vendor/assets/javascripts/ace/snippets/forth.js +0 -0
  206. data/vendor/assets/javascripts/ace/snippets/fortran.js +0 -0
  207. data/vendor/assets/javascripts/ace/snippets/ftl.js +0 -0
  208. data/vendor/assets/javascripts/ace/snippets/gcode.js +0 -0
  209. data/vendor/assets/javascripts/ace/snippets/gherkin.js +0 -0
  210. data/vendor/assets/javascripts/ace/snippets/gitignore.js +0 -0
  211. data/vendor/assets/javascripts/ace/snippets/glsl.js +0 -0
  212. data/vendor/assets/javascripts/ace/snippets/gobstones.js +0 -0
  213. data/vendor/assets/javascripts/ace/snippets/golang.js +0 -0
  214. data/vendor/assets/javascripts/ace/snippets/graphqlschema.js +39 -0
  215. data/vendor/assets/javascripts/ace/snippets/groovy.js +0 -0
  216. data/vendor/assets/javascripts/ace/snippets/haml.js +0 -0
  217. data/vendor/assets/javascripts/ace/snippets/handlebars.js +0 -0
  218. data/vendor/assets/javascripts/ace/snippets/haskell.js +0 -0
  219. data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +0 -0
  220. data/vendor/assets/javascripts/ace/snippets/haxe.js +0 -0
  221. data/vendor/assets/javascripts/ace/snippets/hjson.js +0 -0
  222. data/vendor/assets/javascripts/ace/snippets/html.js +0 -0
  223. data/vendor/assets/javascripts/ace/snippets/html_elixir.js +0 -0
  224. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +0 -0
  225. data/vendor/assets/javascripts/ace/snippets/ini.js +0 -0
  226. data/vendor/assets/javascripts/ace/snippets/io.js +0 -0
  227. data/vendor/assets/javascripts/ace/snippets/jack.js +0 -0
  228. data/vendor/assets/javascripts/ace/snippets/jade.js +0 -0
  229. data/vendor/assets/javascripts/ace/snippets/java.js +0 -0
  230. data/vendor/assets/javascripts/ace/snippets/javascript.js +0 -0
  231. data/vendor/assets/javascripts/ace/snippets/json.js +0 -0
  232. data/vendor/assets/javascripts/ace/snippets/jsoniq.js +0 -0
  233. data/vendor/assets/javascripts/ace/snippets/jsp.js +0 -0
  234. data/vendor/assets/javascripts/ace/snippets/jsx.js +0 -0
  235. data/vendor/assets/javascripts/ace/snippets/julia.js +0 -0
  236. data/vendor/assets/javascripts/ace/snippets/kotlin.js +0 -0
  237. data/vendor/assets/javascripts/ace/snippets/latex.js +0 -0
  238. data/vendor/assets/javascripts/ace/snippets/lean.js +0 -0
  239. data/vendor/assets/javascripts/ace/snippets/less.js +0 -0
  240. data/vendor/assets/javascripts/ace/snippets/liquid.js +0 -0
  241. data/vendor/assets/javascripts/ace/snippets/lisp.js +0 -0
  242. data/vendor/assets/javascripts/ace/snippets/live_script.js +0 -0
  243. data/vendor/assets/javascripts/ace/snippets/livescript.js +0 -0
  244. data/vendor/assets/javascripts/ace/snippets/logiql.js +0 -0
  245. data/vendor/assets/javascripts/ace/snippets/lsl.js +0 -0
  246. data/vendor/assets/javascripts/ace/snippets/lua.js +0 -0
  247. data/vendor/assets/javascripts/ace/snippets/luapage.js +0 -0
  248. data/vendor/assets/javascripts/ace/snippets/lucene.js +0 -0
  249. data/vendor/assets/javascripts/ace/snippets/makefile.js +0 -0
  250. data/vendor/assets/javascripts/ace/snippets/markdown.js +0 -0
  251. data/vendor/assets/javascripts/ace/snippets/mask.js +0 -0
  252. data/vendor/assets/javascripts/ace/snippets/matlab.js +0 -0
  253. data/vendor/assets/javascripts/ace/snippets/maze.js +0 -0
  254. data/vendor/assets/javascripts/ace/snippets/mel.js +0 -0
  255. data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +0 -0
  256. data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +0 -0
  257. data/vendor/assets/javascripts/ace/snippets/mushcode.js +0 -0
  258. data/vendor/assets/javascripts/ace/snippets/mysql.js +0 -0
  259. data/vendor/assets/javascripts/ace/snippets/nix.js +0 -0
  260. data/vendor/assets/javascripts/ace/snippets/nsis.js +0 -0
  261. data/vendor/assets/javascripts/ace/snippets/objectivec.js +0 -0
  262. data/vendor/assets/javascripts/ace/snippets/ocaml.js +0 -0
  263. data/vendor/assets/javascripts/ace/snippets/pascal.js +0 -0
  264. data/vendor/assets/javascripts/ace/snippets/perl.js +0 -0
  265. data/vendor/assets/javascripts/ace/snippets/pgsql.js +0 -0
  266. data/vendor/assets/javascripts/ace/snippets/php.js +0 -0
  267. data/vendor/assets/javascripts/ace/snippets/pig.js +7 -0
  268. data/vendor/assets/javascripts/ace/snippets/plain_text.js +0 -0
  269. data/vendor/assets/javascripts/ace/snippets/powershell.js +0 -0
  270. data/vendor/assets/javascripts/ace/snippets/praat.js +0 -0
  271. data/vendor/assets/javascripts/ace/snippets/prolog.js +0 -0
  272. data/vendor/assets/javascripts/ace/snippets/properties.js +0 -0
  273. data/vendor/assets/javascripts/ace/snippets/protobuf.js +0 -0
  274. data/vendor/assets/javascripts/ace/snippets/python.js +0 -0
  275. data/vendor/assets/javascripts/ace/snippets/r.js +0 -0
  276. data/vendor/assets/javascripts/ace/snippets/razor.js +0 -0
  277. data/vendor/assets/javascripts/ace/snippets/rdoc.js +0 -0
  278. data/vendor/assets/javascripts/ace/snippets/rhtml.js +0 -0
  279. data/vendor/assets/javascripts/ace/snippets/rst.js +0 -0
  280. data/vendor/assets/javascripts/ace/snippets/ruby.js +0 -0
  281. data/vendor/assets/javascripts/ace/snippets/rust.js +0 -0
  282. data/vendor/assets/javascripts/ace/snippets/sass.js +0 -0
  283. data/vendor/assets/javascripts/ace/snippets/scad.js +0 -0
  284. data/vendor/assets/javascripts/ace/snippets/scala.js +0 -0
  285. data/vendor/assets/javascripts/ace/snippets/scheme.js +0 -0
  286. data/vendor/assets/javascripts/ace/snippets/scss.js +0 -0
  287. data/vendor/assets/javascripts/ace/snippets/sh.js +1 -1
  288. data/vendor/assets/javascripts/ace/snippets/sjs.js +0 -0
  289. data/vendor/assets/javascripts/ace/snippets/smarty.js +0 -0
  290. data/vendor/assets/javascripts/ace/snippets/snippets.js +0 -0
  291. data/vendor/assets/javascripts/ace/snippets/soy_template.js +0 -0
  292. data/vendor/assets/javascripts/ace/snippets/space.js +0 -0
  293. data/vendor/assets/javascripts/ace/snippets/sparql.js +7 -0
  294. data/vendor/assets/javascripts/ace/snippets/sql.js +0 -0
  295. data/vendor/assets/javascripts/ace/snippets/sqlserver.js +0 -0
  296. data/vendor/assets/javascripts/ace/snippets/stylus.js +0 -0
  297. data/vendor/assets/javascripts/ace/snippets/svg.js +0 -0
  298. data/vendor/assets/javascripts/ace/snippets/swift.js +0 -0
  299. data/vendor/assets/javascripts/ace/snippets/swig.js +0 -0
  300. data/vendor/assets/javascripts/ace/snippets/tcl.js +0 -0
  301. data/vendor/assets/javascripts/ace/snippets/tex.js +0 -0
  302. data/vendor/assets/javascripts/ace/snippets/text.js +0 -0
  303. data/vendor/assets/javascripts/ace/snippets/textile.js +0 -0
  304. data/vendor/assets/javascripts/ace/snippets/toml.js +0 -0
  305. data/vendor/assets/javascripts/ace/snippets/tsx.js +0 -0
  306. data/vendor/assets/javascripts/ace/snippets/turtle.js +7 -0
  307. data/vendor/assets/javascripts/ace/snippets/twig.js +0 -0
  308. data/vendor/assets/javascripts/ace/snippets/typescript.js +0 -0
  309. data/vendor/assets/javascripts/ace/snippets/vala.js +0 -0
  310. data/vendor/assets/javascripts/ace/snippets/vbscript.js +0 -0
  311. data/vendor/assets/javascripts/ace/snippets/velocity.js +0 -0
  312. data/vendor/assets/javascripts/ace/snippets/verilog.js +0 -0
  313. data/vendor/assets/javascripts/ace/snippets/vhdl.js +0 -0
  314. data/vendor/assets/javascripts/ace/snippets/wollok.js +0 -0
  315. data/vendor/assets/javascripts/ace/snippets/xml.js +0 -0
  316. data/vendor/assets/javascripts/ace/snippets/xquery.js +0 -0
  317. data/vendor/assets/javascripts/ace/snippets/yaml.js +0 -0
  318. data/vendor/assets/javascripts/ace/theme-ambiance.js +0 -0
  319. data/vendor/assets/javascripts/ace/theme-chaos.js +0 -0
  320. data/vendor/assets/javascripts/ace/theme-chrome.js +0 -0
  321. data/vendor/assets/javascripts/ace/theme-clouds.js +0 -0
  322. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +0 -0
  323. data/vendor/assets/javascripts/ace/theme-cobalt.js +0 -0
  324. data/vendor/assets/javascripts/ace/theme-crimson_editor.js +0 -0
  325. data/vendor/assets/javascripts/ace/theme-dawn.js +0 -0
  326. data/vendor/assets/javascripts/ace/theme-dreamweaver.js +0 -0
  327. data/vendor/assets/javascripts/ace/theme-eclipse.js +0 -0
  328. data/vendor/assets/javascripts/ace/theme-github.js +0 -0
  329. data/vendor/assets/javascripts/ace/theme-gob.js +112 -0
  330. data/vendor/assets/javascripts/ace/theme-gruvbox.js +82 -0
  331. data/vendor/assets/javascripts/ace/theme-idle_fingers.js +0 -0
  332. data/vendor/assets/javascripts/ace/theme-iplastic.js +0 -0
  333. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +0 -0
  334. data/vendor/assets/javascripts/ace/theme-kr_theme.js +0 -0
  335. data/vendor/assets/javascripts/ace/theme-kuroir.js +0 -0
  336. data/vendor/assets/javascripts/ace/theme-merbivore.js +0 -0
  337. data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +0 -0
  338. data/vendor/assets/javascripts/ace/theme-mono_industrial.js +0 -0
  339. data/vendor/assets/javascripts/ace/theme-monokai.js +0 -0
  340. data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +0 -0
  341. data/vendor/assets/javascripts/ace/theme-solarized_dark.js +0 -0
  342. data/vendor/assets/javascripts/ace/theme-solarized_light.js +0 -0
  343. data/vendor/assets/javascripts/ace/theme-sqlserver.js +0 -0
  344. data/vendor/assets/javascripts/ace/theme-terminal.js +0 -0
  345. data/vendor/assets/javascripts/ace/theme-textmate.js +0 -0
  346. data/vendor/assets/javascripts/ace/theme-tomorrow.js +0 -0
  347. data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +0 -0
  348. data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +0 -0
  349. data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +0 -0
  350. data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +0 -0
  351. data/vendor/assets/javascripts/ace/theme-twilight.js +0 -0
  352. data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +0 -0
  353. data/vendor/assets/javascripts/ace/theme-xcode.js +0 -0
  354. data/vendor/assets/javascripts/ace/worker-coffee.js +0 -0
  355. data/vendor/assets/javascripts/ace/worker-css.js +0 -0
  356. data/vendor/assets/javascripts/ace/worker-html.js +0 -0
  357. data/vendor/assets/javascripts/ace/worker-javascript.js +0 -0
  358. data/vendor/assets/javascripts/ace/worker-json.js +0 -0
  359. data/vendor/assets/javascripts/ace/worker-lua.js +2 -2
  360. data/vendor/assets/javascripts/ace/worker-php.js +0 -0
  361. data/vendor/assets/javascripts/ace/worker-xml.js +0 -0
  362. data/vendor/assets/javascripts/ace/worker-xquery.js +0 -0
  363. metadata +14 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baf951ceef5756b26d02cc8d02da6238989d3a6c
4
- data.tar.gz: 531dfbf44e7478b2b136202438f7a194d4edfb62
3
+ metadata.gz: 2c20402b09d2af169a08d1148194ecfc4016164c
4
+ data.tar.gz: 6d0c1c0bd1b5a4dbe931317ce1830713508581be
5
5
  SHA512:
6
- metadata.gz: 694873071977e12e2f2b91942d6bb2f398ef964da9ec0c3d1fc58076d40da17bf622c7e5387df7e3012375741207fbfb97c37bb8d918930dfaa195a408fecf5d
7
- data.tar.gz: 83025aeef24b6ab0cf8edf346ebd5e5c98a6ab39a5051239ceaaae50f99c2119a8fa567198cd0f829d28c1b150acbe358ec9bdcd75f78b50feeeaacf00706d3f
6
+ metadata.gz: 0cf05f9e5596bef2007449a427572355220ebc2d63f7fa71128319f01e5cef37fbab5c885b30d2512faf187612bdd336a0ee752bde885a91e1a42c7a655f9a22
7
+ data.tar.gz: fd620724cc46924be4daa8c1df53ed0baf3ae27589bba85c935b4c42ddb60837ad6be0e0a319e8e4e46a188be43f3003f50ffa046d1991cc82c3e9b8951bc6a0
@@ -1,5 +1,5 @@
1
1
  module Ace
2
2
  module Rails
3
- VERSION = "4.1.2"
3
+ VERSION = "4.1.3"
4
4
  end
5
5
  end
@@ -1370,10 +1370,12 @@ exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
1370
1370
 
1371
1371
  exports.isIPad = ua.indexOf("iPad") >= 0;
1372
1372
 
1373
- exports.isTouchPad = ua.indexOf("TouchPad") >= 0;
1374
-
1375
1373
  exports.isChromeOS = ua.indexOf(" CrOS ") >= 0;
1376
1374
 
1375
+ exports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream;
1376
+
1377
+ if (exports.isIOS) exports.isMac = true;
1378
+
1377
1379
  });
1378
1380
 
1379
1381
  define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module) {
@@ -1865,51 +1867,524 @@ exports.deferredCall = function(fcn) {
1865
1867
  return deferred;
1866
1868
  };
1867
1869
 
1868
- deferred.isPending = function() {
1869
- return timer;
1870
- };
1871
-
1872
- return deferred;
1873
- };
1870
+ deferred.isPending = function() {
1871
+ return timer;
1872
+ };
1873
+
1874
+ return deferred;
1875
+ };
1876
+
1877
+
1878
+ exports.delayedCall = function(fcn, defaultTimeout) {
1879
+ var timer = null;
1880
+ var callback = function() {
1881
+ timer = null;
1882
+ fcn();
1883
+ };
1884
+
1885
+ var _self = function(timeout) {
1886
+ if (timer == null)
1887
+ timer = setTimeout(callback, timeout || defaultTimeout);
1888
+ };
1889
+
1890
+ _self.delay = function(timeout) {
1891
+ timer && clearTimeout(timer);
1892
+ timer = setTimeout(callback, timeout || defaultTimeout);
1893
+ };
1894
+ _self.schedule = _self;
1895
+
1896
+ _self.call = function() {
1897
+ this.cancel();
1898
+ fcn();
1899
+ };
1900
+
1901
+ _self.cancel = function() {
1902
+ timer && clearTimeout(timer);
1903
+ timer = null;
1904
+ };
1905
+
1906
+ _self.isPending = function() {
1907
+ return timer;
1908
+ };
1909
+
1910
+ return _self;
1911
+ };
1912
+ });
1913
+
1914
+ define("ace/keyboard/textinput_ios",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/lib/keys"], function(require, exports, module) {
1915
+ "use strict";
1916
+
1917
+ var event = require("../lib/event");
1918
+ var useragent = require("../lib/useragent");
1919
+ var dom = require("../lib/dom");
1920
+ var lang = require("../lib/lang");
1921
+ var KEYS = require("../lib/keys");
1922
+ var MODS = KEYS.KEY_MODS;
1923
+ var BROKEN_SETDATA = useragent.isChrome < 18;
1924
+ var USE_IE_MIME_TYPE = useragent.isIE;
1925
+
1926
+ var TextInput = function(parentNode, host) {
1927
+ var self = this;
1928
+ var text = dom.createElement("textarea");
1929
+ text.className = useragent.isIOS ? "ace_text-input ace_text-input-ios" : "ace_text-input";
1930
+
1931
+ if (useragent.isTouchPad)
1932
+ text.setAttribute("x-palm-disable-auto-cap", true);
1933
+
1934
+ text.setAttribute("wrap", "off");
1935
+ text.setAttribute("autocorrect", "off");
1936
+ text.setAttribute("autocapitalize", "off");
1937
+ text.setAttribute("spellcheck", false);
1938
+
1939
+ text.style.opacity = "0";
1940
+ parentNode.insertBefore(text, parentNode.firstChild);
1941
+
1942
+ var PLACEHOLDER = "\n aaaa a\n";
1943
+
1944
+ var copied = false;
1945
+ var cut = false;
1946
+ var pasted = false;
1947
+ var inComposition = false;
1948
+ var tempStyle = '';
1949
+ var isSelectionEmpty = true;
1950
+ try { var isFocused = document.activeElement === text; } catch(e) {}
1951
+
1952
+ event.addListener(text, "blur", function(e) {
1953
+ host.onBlur(e);
1954
+ isFocused = false;
1955
+ });
1956
+ event.addListener(text, "focus", function(e) {
1957
+ isFocused = true;
1958
+ host.onFocus(e);
1959
+ resetSelection();
1960
+ });
1961
+ this.focus = function() {
1962
+ if (tempStyle) return text.focus();
1963
+ text.style.position = "fixed";
1964
+ text.focus();
1965
+ };
1966
+ this.blur = function() {
1967
+ text.blur();
1968
+ };
1969
+ this.isFocused = function() {
1970
+ return isFocused;
1971
+ };
1972
+ var syncSelection = lang.delayedCall(function() {
1973
+ isFocused && resetSelection(isSelectionEmpty);
1974
+ });
1975
+ var syncValue = lang.delayedCall(function() {
1976
+ if (!inComposition) {
1977
+ text.value = PLACEHOLDER;
1978
+ isFocused && resetSelection();
1979
+ }
1980
+ });
1981
+
1982
+ function resetSelection(isEmpty) {
1983
+ if (inComposition)
1984
+ return;
1985
+ inComposition = true;
1986
+
1987
+ if (inputHandler) {
1988
+ selectionStart = 0;
1989
+ selectionEnd = isEmpty ? 0 : text.value.length - 1;
1990
+ } else {
1991
+ var selectionStart = 4;
1992
+ var selectionEnd = 5;
1993
+ }
1994
+ try {
1995
+ text.setSelectionRange(selectionStart, selectionEnd);
1996
+ } catch(e) {}
1997
+
1998
+ inComposition = false;
1999
+ }
2000
+
2001
+ function resetValue() {
2002
+ if (inComposition)
2003
+ return;
2004
+ text.value = PLACEHOLDER;
2005
+ if (useragent.isWebKit)
2006
+ syncValue.schedule();
2007
+ }
2008
+
2009
+ useragent.isWebKit || host.addEventListener('changeSelection', function() {
2010
+ if (host.selection.isEmpty() != isSelectionEmpty) {
2011
+ isSelectionEmpty = !isSelectionEmpty;
2012
+ syncSelection.schedule();
2013
+ }
2014
+ });
2015
+
2016
+ resetValue();
2017
+ if (isFocused)
2018
+ host.onFocus();
2019
+
2020
+
2021
+ var isAllSelected = function(text) {
2022
+ return text.selectionStart === 0 && text.selectionEnd === text.value.length;
2023
+ };
2024
+
2025
+ var onSelect = function(e) {
2026
+ if (isAllSelected(text)) {
2027
+ host.selectAll();
2028
+ resetSelection();
2029
+ } else if (inputHandler) {
2030
+ resetSelection(host.selection.isEmpty());
2031
+ }
2032
+ };
2033
+
2034
+ var inputHandler = null;
2035
+ this.setInputHandler = function(cb) {inputHandler = cb};
2036
+ this.getInputHandler = function() {return inputHandler};
2037
+ var afterContextMenu = false;
2038
+
2039
+ var sendText = function(data) {
2040
+ if (text.selectionStart === 4 && text.selectionEnd === 5) {
2041
+ return;
2042
+ }
2043
+ if (inputHandler) {
2044
+ data = inputHandler(data);
2045
+ inputHandler = null;
2046
+ }
2047
+ if (pasted) {
2048
+ resetSelection();
2049
+ if (data)
2050
+ host.onPaste(data);
2051
+ pasted = false;
2052
+ } else if (data == PLACEHOLDER.substr(0) && text.selectionStart === 4) {
2053
+ if (afterContextMenu)
2054
+ host.execCommand("del", {source: "ace"});
2055
+ else // some versions of android do not fire keydown when pressing backspace
2056
+ host.execCommand("backspace", {source: "ace"});
2057
+ } else if (!copied) {
2058
+ if (data.substring(0, 9) == PLACEHOLDER && data.length > PLACEHOLDER.length)
2059
+ data = data.substr(9);
2060
+ else if (data.substr(0, 4) == PLACEHOLDER.substr(0, 4))
2061
+ data = data.substr(4, data.length - PLACEHOLDER.length + 1);
2062
+ else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0))
2063
+ data = data.slice(0, -1);
2064
+ if (data == PLACEHOLDER.charAt(0)) {
2065
+ } else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0))
2066
+ data = data.slice(0, -1);
2067
+
2068
+ if (data)
2069
+ host.onTextInput(data);
2070
+ }
2071
+ if (copied) {
2072
+ copied = false;
2073
+ }
2074
+ if (afterContextMenu)
2075
+ afterContextMenu = false;
2076
+ };
2077
+ var onInput = function(e) {
2078
+ if (inComposition)
2079
+ return;
2080
+ var data = text.value;
2081
+ sendText(data);
2082
+ resetValue();
2083
+ };
2084
+
2085
+ var handleClipboardData = function(e, data, forceIEMime) {
2086
+ var clipboardData = e.clipboardData || window.clipboardData;
2087
+ if (!clipboardData || BROKEN_SETDATA)
2088
+ return;
2089
+ var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain";
2090
+ try {
2091
+ if (data) {
2092
+ return clipboardData.setData(mime, data) !== false;
2093
+ } else {
2094
+ return clipboardData.getData(mime);
2095
+ }
2096
+ } catch(e) {
2097
+ if (!forceIEMime)
2098
+ return handleClipboardData(e, data, true);
2099
+ }
2100
+ };
2101
+
2102
+ var doCopy = function(e, isCut) {
2103
+ var data = host.getCopyText();
2104
+ if (!data)
2105
+ return event.preventDefault(e);
2106
+
2107
+ if (handleClipboardData(e, data)) {
2108
+ if (useragent.isIOS) {
2109
+ cut = isCut;
2110
+ text.value = "\n aa" + data + "a a\n";
2111
+ text.setSelectionRange(4, 4 + data.length);
2112
+ copied = {
2113
+ value: data
2114
+ };
2115
+ }
2116
+ isCut ? host.onCut() : host.onCopy();
2117
+ if (!useragent.isIOS) event.preventDefault(e);
2118
+ } else {
2119
+ copied = true;
2120
+ text.value = data;
2121
+ text.select();
2122
+ setTimeout(function(){
2123
+ copied = false;
2124
+ resetValue();
2125
+ resetSelection();
2126
+ isCut ? host.onCut() : host.onCopy();
2127
+ });
2128
+ }
2129
+ };
2130
+
2131
+ var onCut = function(e) {
2132
+ doCopy(e, true);
2133
+ };
2134
+
2135
+ var onCopy = function(e) {
2136
+ doCopy(e, false);
2137
+ };
2138
+
2139
+ var onPaste = function(e) {
2140
+ var data = handleClipboardData(e);
2141
+ if (typeof data == "string") {
2142
+ if (data)
2143
+ host.onPaste(data, e);
2144
+ if (useragent.isIE)
2145
+ setTimeout(resetSelection);
2146
+ event.preventDefault(e);
2147
+ }
2148
+ else {
2149
+ text.value = "";
2150
+ pasted = true;
2151
+ }
2152
+ };
2153
+
2154
+ event.addCommandKeyListener(text, host.onCommandKey.bind(host));
2155
+
2156
+ event.addListener(text, "select", onSelect);
2157
+
2158
+ event.addListener(text, "input", onInput);
2159
+
2160
+ event.addListener(text, "cut", onCut);
2161
+ event.addListener(text, "copy", onCopy);
2162
+ event.addListener(text, "paste", onPaste);
2163
+ var onCompositionStart = function(e) {
2164
+ if (inComposition || !host.onCompositionStart || host.$readOnly)
2165
+ return;
2166
+ inComposition = {};
2167
+ inComposition.canUndo = host.session.$undoManager;
2168
+ host.onCompositionStart();
2169
+ setTimeout(onCompositionUpdate, 0);
2170
+ host.on("mousedown", onCompositionEnd);
2171
+ if (inComposition.canUndo && !host.selection.isEmpty()) {
2172
+ host.insert("");
2173
+ host.session.markUndoGroup();
2174
+ host.selection.clearSelection();
2175
+ }
2176
+ host.session.markUndoGroup();
2177
+ };
2178
+
2179
+ var onCompositionUpdate = function() {
2180
+ if (!inComposition || !host.onCompositionUpdate || host.$readOnly)
2181
+ return;
2182
+ var val = text.value.replace(/\x01/g, "");
2183
+ if (inComposition.lastValue === val) return;
2184
+
2185
+ host.onCompositionUpdate(val);
2186
+ if (inComposition.lastValue)
2187
+ host.undo();
2188
+ if (inComposition.canUndo)
2189
+ inComposition.lastValue = val;
2190
+ if (inComposition.lastValue) {
2191
+ var r = host.selection.getRange();
2192
+ host.insert(inComposition.lastValue);
2193
+ host.session.markUndoGroup();
2194
+ inComposition.range = host.selection.getRange();
2195
+ host.selection.setRange(r);
2196
+ host.selection.clearSelection();
2197
+ }
2198
+ };
2199
+
2200
+ var onCompositionEnd = function(e) {
2201
+ if (!host.onCompositionEnd || host.$readOnly) return;
2202
+ var c = inComposition;
2203
+ inComposition = false;
2204
+ var timer = setTimeout(function() {
2205
+ timer = null;
2206
+ var str = text.value.replace(/\x01/g, "");
2207
+ if (inComposition)
2208
+ return;
2209
+ else if (str == c.lastValue)
2210
+ resetValue();
2211
+ else if (!c.lastValue && str) {
2212
+ resetValue();
2213
+ sendText(str);
2214
+ }
2215
+ });
2216
+ inputHandler = function compositionInputHandler(str) {
2217
+ if (timer)
2218
+ clearTimeout(timer);
2219
+ str = str.replace(/\x01/g, "");
2220
+ if (str == c.lastValue)
2221
+ return "";
2222
+ if (c.lastValue && timer)
2223
+ host.undo();
2224
+ return str;
2225
+ };
2226
+ host.onCompositionEnd();
2227
+ host.removeListener("mousedown", onCompositionEnd);
2228
+ if (e.type == "compositionend" && c.range) {
2229
+ host.selection.setRange(c.range);
2230
+ }
2231
+ var needsOnInput =
2232
+ (!!useragent.isChrome && useragent.isChrome >= 53) ||
2233
+ (!!useragent.isWebKit && useragent.isWebKit >= 603);
2234
+
2235
+ if (needsOnInput) {
2236
+ onInput();
2237
+ }
2238
+ };
2239
+
2240
+
2241
+
2242
+ var syncComposition = lang.delayedCall(onCompositionUpdate, 50);
2243
+
2244
+ event.addListener(text, "compositionstart", onCompositionStart);
2245
+ if (useragent.isGecko) {
2246
+ event.addListener(text, "text", function(){syncComposition.schedule()});
2247
+ } else {
2248
+ event.addListener(text, "keyup", function(){syncComposition.schedule()});
2249
+ event.addListener(text, "keydown", function(){syncComposition.schedule()});
2250
+ }
2251
+ event.addListener(text, "compositionend", onCompositionEnd);
2252
+
2253
+ this.getElement = function() {
2254
+ return text;
2255
+ };
2256
+
2257
+ this.setReadOnly = function(readOnly) {
2258
+ text.readOnly = readOnly;
2259
+ };
2260
+
2261
+ this.onContextMenu = function(e) {
2262
+ afterContextMenu = true;
2263
+ resetSelection(host.selection.isEmpty());
2264
+ host._emit("nativecontextmenu", {target: host, domEvent: e});
2265
+ this.moveToMouse(e, true);
2266
+ };
2267
+
2268
+ this.moveToMouse = function(e, bringToFront) {
2269
+ if (!tempStyle)
2270
+ tempStyle = text.style.cssText;
2271
+ text.style.cssText = (bringToFront ? "z-index:100000;" : "")
2272
+ + "height:" + text.style.height + ";"
2273
+ + (useragent.isIE ? "opacity:0.1;" : "");
1874
2274
 
2275
+ var rect = host.container.getBoundingClientRect();
2276
+ var style = dom.computedStyle(host.container);
2277
+ var top = rect.top + (parseInt(style.borderTopWidth) || 0);
2278
+ var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);
2279
+ var maxTop = rect.bottom - top - text.clientHeight -2;
2280
+ var move = function(e) {
2281
+ text.style.left = e.clientX - left - 2 + "px";
2282
+ text.style.top = Math.min(e.clientY - top - 2, maxTop) + "px";
2283
+ };
2284
+ move(e);
1875
2285
 
1876
- exports.delayedCall = function(fcn, defaultTimeout) {
1877
- var timer = null;
1878
- var callback = function() {
1879
- timer = null;
1880
- fcn();
1881
- };
2286
+ if (e.type != "mousedown")
2287
+ return;
1882
2288
 
1883
- var _self = function(timeout) {
1884
- if (timer == null)
1885
- timer = setTimeout(callback, timeout || defaultTimeout);
1886
- };
2289
+ if (host.renderer.$keepTextAreaAtCursor)
2290
+ host.renderer.$keepTextAreaAtCursor = null;
1887
2291
 
1888
- _self.delay = function(timeout) {
1889
- timer && clearTimeout(timer);
1890
- timer = setTimeout(callback, timeout || defaultTimeout);
2292
+ clearTimeout(closeTimeout);
2293
+ if (useragent.isWin)
2294
+ event.capture(host.container, move, onContextMenuClose);
1891
2295
  };
1892
- _self.schedule = _self;
1893
2296
 
1894
- _self.call = function() {
1895
- this.cancel();
1896
- fcn();
1897
- };
2297
+ this.onContextMenuClose = onContextMenuClose;
2298
+ var closeTimeout;
2299
+ function onContextMenuClose() {
2300
+ clearTimeout(closeTimeout);
2301
+ closeTimeout = setTimeout(function () {
2302
+ if (tempStyle) {
2303
+ text.style.cssText = tempStyle;
2304
+ tempStyle = '';
2305
+ }
2306
+ if (host.renderer.$keepTextAreaAtCursor == null) {
2307
+ host.renderer.$keepTextAreaAtCursor = true;
2308
+ host.renderer.$moveTextAreaToCursor();
2309
+ }
2310
+ }, 0);
2311
+ }
1898
2312
 
1899
- _self.cancel = function() {
1900
- timer && clearTimeout(timer);
1901
- timer = null;
2313
+ var onContextMenu = function(e) {
2314
+ host.textInput.onContextMenu(e);
2315
+ onContextMenuClose();
1902
2316
  };
2317
+ event.addListener(text, "mouseup", onContextMenu);
2318
+ event.addListener(text, "mousedown", function(e) {
2319
+ e.preventDefault();
2320
+ onContextMenuClose();
2321
+ });
2322
+ event.addListener(host.renderer.scroller, "contextmenu", onContextMenu);
2323
+ event.addListener(text, "contextmenu", onContextMenu);
2324
+
2325
+ if (useragent.isIOS) {
2326
+ var typingResetTimeout = null;
2327
+ var typing = false;
1903
2328
 
1904
- _self.isPending = function() {
1905
- return timer;
1906
- };
2329
+ parentNode.addEventListener("keydown", function (e) {
2330
+ if (typingResetTimeout) clearTimeout(typingResetTimeout);
2331
+ typing = true;
2332
+ });
1907
2333
 
1908
- return _self;
2334
+ parentNode.addEventListener("keyup", function (e) {
2335
+ typingResetTimeout = setTimeout(function () {
2336
+ typing = false;
2337
+ }, 100);
2338
+ });
2339
+ var detectArrowKeys = function(e) {
2340
+ if (document.activeElement !== text) return;
2341
+ if (typing) return;
2342
+
2343
+ if (cut) {
2344
+ return setTimeout(function () {
2345
+ cut = false;
2346
+ }, 100);
2347
+ }
2348
+ var selectionStart = text.selectionStart;
2349
+ var selectionEnd = text.selectionEnd;
2350
+ text.setSelectionRange(4, 5);
2351
+ if (selectionStart == selectionEnd) {
2352
+ switch (selectionStart) {
2353
+ case 0: host.onCommandKey(null, 0, KEYS.up); break;
2354
+ case 1: host.onCommandKey(null, 0, KEYS.home); break;
2355
+ case 2: host.onCommandKey(null, MODS.option, KEYS.left); break;
2356
+ case 4: host.onCommandKey(null, 0, KEYS.left); break;
2357
+ case 5: host.onCommandKey(null, 0, KEYS.right); break;
2358
+ case 7: host.onCommandKey(null, MODS.option, KEYS.right); break;
2359
+ case 8: host.onCommandKey(null, 0, KEYS.end); break;
2360
+ case 9: host.onCommandKey(null, 0, KEYS.down); break;
2361
+ }
2362
+ } else {
2363
+ switch (selectionEnd) {
2364
+ case 6: host.onCommandKey(null, MODS.shift, KEYS.right); break;
2365
+ case 7: host.onCommandKey(null, MODS.shift | MODS.option, KEYS.right); break;
2366
+ case 8: host.onCommandKey(null, MODS.shift, KEYS.end); break;
2367
+ case 9: host.onCommandKey(null, MODS.shift, KEYS.down); break;
2368
+ }
2369
+ switch (selectionStart) {
2370
+ case 0: host.onCommandKey(null, MODS.shift, KEYS.up); break;
2371
+ case 1: host.onCommandKey(null, MODS.shift, KEYS.home); break;
2372
+ case 2: host.onCommandKey(null, MODS.shift | MODS.option, KEYS.left); break;
2373
+ case 3: host.onCommandKey(null, MODS.shift, KEYS.left); break;
2374
+ }
2375
+ }
2376
+ }
2377
+ document.addEventListener("selectionchange", detectArrowKeys);
2378
+ host.on("destroy", function() {
2379
+ document.removeEventListener("selectionchange", detectArrowKeys);
2380
+ })
2381
+ }
1909
2382
  };
2383
+
2384
+ exports.TextInput = TextInput;
1910
2385
  });
1911
2386
 
1912
- define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang"], function(require, exports, module) {
2387
+ define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/keyboard/textinput_ios"], function(require, exports, module) {
1913
2388
  "use strict";
1914
2389
 
1915
2390
  var event = require("../lib/event");
@@ -1919,23 +2394,23 @@ var lang = require("../lib/lang");
1919
2394
  var BROKEN_SETDATA = useragent.isChrome < 18;
1920
2395
  var USE_IE_MIME_TYPE = useragent.isIE;
1921
2396
 
2397
+ var TextInputIOS = require("./textinput_ios").TextInput
1922
2398
  var TextInput = function(parentNode, host) {
2399
+ if (useragent.isIOS)
2400
+ return TextInputIOS.call(this, parentNode, host);
2401
+
1923
2402
  var text = dom.createElement("textarea");
1924
2403
  text.className = "ace_text-input";
1925
2404
 
1926
- if (useragent.isTouchPad)
1927
- text.setAttribute("x-palm-disable-auto-cap", true);
1928
-
1929
2405
  text.setAttribute("wrap", "off");
1930
2406
  text.setAttribute("autocorrect", "off");
1931
2407
  text.setAttribute("autocapitalize", "off");
1932
2408
  text.setAttribute("spellcheck", false);
1933
2409
 
1934
2410
  text.style.opacity = "0";
1935
- if (useragent.isOldIE) text.style.top = "-1000px";
1936
2411
  parentNode.insertBefore(text, parentNode.firstChild);
1937
2412
 
1938
- var PLACEHOLDER = "\x01\x01";
2413
+ var PLACEHOLDER = "\u2028\u2028";
1939
2414
 
1940
2415
  var copied = false;
1941
2416
  var pasted = false;
@@ -2023,54 +2498,6 @@ var TextInput = function(parentNode, host) {
2023
2498
  var isAllSelected = function(text) {
2024
2499
  return text.selectionStart === 0 && text.selectionEnd === text.value.length;
2025
2500
  };
2026
- if (!text.setSelectionRange && text.createTextRange) {
2027
- text.setSelectionRange = function(selectionStart, selectionEnd) {
2028
- var range = this.createTextRange();
2029
- range.collapse(true);
2030
- range.moveStart('character', selectionStart);
2031
- range.moveEnd('character', selectionEnd);
2032
- range.select();
2033
- };
2034
- isAllSelected = function(text) {
2035
- try {
2036
- var range = text.ownerDocument.selection.createRange();
2037
- }catch(e) {}
2038
- if (!range || range.parentElement() != text) return false;
2039
- return range.text == text.value;
2040
- }
2041
- }
2042
- if (useragent.isOldIE) {
2043
- var inPropertyChange = false;
2044
- var onPropertyChange = function(e){
2045
- if (inPropertyChange)
2046
- return;
2047
- var data = text.value;
2048
- if (inComposition || !data || data == PLACEHOLDER)
2049
- return;
2050
- if (e && data == PLACEHOLDER[0])
2051
- return syncProperty.schedule();
2052
-
2053
- sendText(data);
2054
- inPropertyChange = true;
2055
- resetValue();
2056
- inPropertyChange = false;
2057
- };
2058
- var syncProperty = lang.delayedCall(onPropertyChange);
2059
- event.addListener(text, "propertychange", onPropertyChange);
2060
-
2061
- var keytable = { 13:1, 27:1 };
2062
- event.addListener(text, "keyup", function (e) {
2063
- if (inComposition && (!text.value || keytable[e.keyCode]))
2064
- setTimeout(onCompositionEnd, 0);
2065
- if ((text.value.charCodeAt(0)||0) < 129) {
2066
- return syncProperty.call();
2067
- }
2068
- inComposition ? onCompositionUpdate() : onCompositionStart();
2069
- });
2070
- event.addListener(text, "keydown", function (e) {
2071
- syncProperty.schedule(50);
2072
- });
2073
- }
2074
2501
 
2075
2502
  var onSelect = function(e) {
2076
2503
  if (copied) {
@@ -2197,7 +2624,7 @@ var TextInput = function(parentNode, host) {
2197
2624
  event.addListener(text, "cut", onCut);
2198
2625
  event.addListener(text, "copy", onCopy);
2199
2626
  event.addListener(text, "paste", onPaste);
2200
- if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)){
2627
+ if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) {
2201
2628
  event.addListener(parentNode, "keydown", function(e) {
2202
2629
  if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)
2203
2630
  return;
@@ -2234,7 +2661,7 @@ var TextInput = function(parentNode, host) {
2234
2661
  var onCompositionUpdate = function() {
2235
2662
  if (!inComposition || !host.onCompositionUpdate || host.$readOnly)
2236
2663
  return;
2237
- var val = text.value.replace(/\x01/g, "");
2664
+ var val = text.value.replace(/\u2028/g, "");
2238
2665
  if (inComposition.lastValue === val) return;
2239
2666
 
2240
2667
  host.onCompositionUpdate(val);
@@ -2258,7 +2685,7 @@ var TextInput = function(parentNode, host) {
2258
2685
  inComposition = false;
2259
2686
  var timer = setTimeout(function() {
2260
2687
  timer = null;
2261
- var str = text.value.replace(/\x01/g, "");
2688
+ var str = text.value.replace(/\u2028/g, "");
2262
2689
  if (inComposition)
2263
2690
  return;
2264
2691
  else if (str == c.lastValue)
@@ -2271,7 +2698,7 @@ var TextInput = function(parentNode, host) {
2271
2698
  inputHandler = function compositionInputHandler(str) {
2272
2699
  if (timer)
2273
2700
  clearTimeout(timer);
2274
- str = str.replace(/\x01/g, "");
2701
+ str = str.replace(/\u2028/g, "");
2275
2702
  if (str == c.lastValue)
2276
2703
  return "";
2277
2704
  if (c.lastValue && timer)
@@ -2283,7 +2710,11 @@ var TextInput = function(parentNode, host) {
2283
2710
  if (e.type == "compositionend" && c.range) {
2284
2711
  host.selection.setRange(c.range);
2285
2712
  }
2286
- if (useragent.isChrome && useragent.isChrome >= 53) {
2713
+ var needsOnInput =
2714
+ (!!useragent.isChrome && useragent.isChrome >= 53) ||
2715
+ (!!useragent.isWebKit && useragent.isWebKit >= 603);
2716
+
2717
+ if (needsOnInput) {
2287
2718
  onInput();
2288
2719
  }
2289
2720
  };
@@ -2317,8 +2748,6 @@ var TextInput = function(parentNode, host) {
2317
2748
  };
2318
2749
 
2319
2750
  this.moveToMouse = function(e, bringToFront) {
2320
- if (!bringToFront && useragent.isOldIE)
2321
- return;
2322
2751
  if (!tempStyle)
2323
2752
  tempStyle = text.style.cssText;
2324
2753
  text.style.cssText = (bringToFront ? "z-index:100000;" : "")
@@ -2343,7 +2772,7 @@ var TextInput = function(parentNode, host) {
2343
2772
  host.renderer.$keepTextAreaAtCursor = null;
2344
2773
 
2345
2774
  clearTimeout(closeTimeout);
2346
- if (useragent.isWin && !useragent.isOldIE)
2775
+ if (useragent.isWin)
2347
2776
  event.capture(host.container, move, onContextMenuClose);
2348
2777
  };
2349
2778
 
@@ -2360,7 +2789,7 @@ var TextInput = function(parentNode, host) {
2360
2789
  host.renderer.$keepTextAreaAtCursor = true;
2361
2790
  host.renderer.$moveTextAreaToCursor();
2362
2791
  }
2363
- }, useragent.isOldIE ? 200 : 0);
2792
+ }, 0);
2364
2793
  }
2365
2794
 
2366
2795
  var onContextMenu = function(e) {
@@ -2426,9 +2855,12 @@ function DefaultHandlers(mouseHandler) {
2426
2855
  if (selectionEmpty || button == 1)
2427
2856
  editor.selection.moveToPosition(pos);
2428
2857
  editor.$blockScrolling--;
2429
- if (button == 2)
2858
+ if (button == 2) {
2430
2859
  editor.textInput.onContextMenu(ev.domEvent);
2431
- return; // stopping event here breaks contextmenu on ff mac
2860
+ if (!useragent.isMozilla)
2861
+ ev.preventDefault();
2862
+ }
2863
+ return;
2432
2864
  }
2433
2865
 
2434
2866
  this.mousedownEvent.time = Date.now();
@@ -2696,6 +3128,13 @@ function Tooltip (parentNode) {
2696
3128
  this.getWidth = function() {
2697
3129
  return this.getElement().offsetWidth;
2698
3130
  };
3131
+
3132
+ this.destroy = function() {
3133
+ this.isOpen = false;
3134
+ if (this.$element && this.$element.parentNode) {
3135
+ this.$element.parentNode.removeChild(this.$element);
3136
+ }
3137
+ };
2699
3138
 
2700
3139
  }).call(Tooltip.prototype);
2701
3140
 
@@ -4588,6 +5027,16 @@ var Selection = function(session) {
4588
5027
  this.moveCursorDown = function() {
4589
5028
  this.moveCursorBy(1, 0);
4590
5029
  };
5030
+ this.wouldMoveIntoSoftTab = function(cursor, tabSize, direction) {
5031
+ var start = cursor.column;
5032
+ var end = cursor.column + tabSize;
5033
+
5034
+ if (direction < 0) {
5035
+ start = cursor.column - tabSize;
5036
+ end = cursor.column;
5037
+ }
5038
+ return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(" ").length-1 == tabSize
5039
+ }
4591
5040
  this.moveCursorLeft = function() {
4592
5041
  var cursor = this.lead.getPosition(),
4593
5042
  fold;
@@ -4601,10 +5050,11 @@ var Selection = function(session) {
4601
5050
  }
4602
5051
  else {
4603
5052
  var tabSize = this.session.getTabSize();
4604
- if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize)
5053
+ if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) {
4605
5054
  this.moveCursorBy(0, -tabSize);
4606
- else
5055
+ } else {
4607
5056
  this.moveCursorBy(0, -1);
5057
+ }
4608
5058
  }
4609
5059
  };
4610
5060
  this.moveCursorRight = function() {
@@ -4621,10 +5071,11 @@ var Selection = function(session) {
4621
5071
  else {
4622
5072
  var tabSize = this.session.getTabSize();
4623
5073
  var cursor = this.lead;
4624
- if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize)
5074
+ if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) {
4625
5075
  this.moveCursorBy(0, tabSize);
4626
- else
5076
+ } else {
4627
5077
  this.moveCursorBy(0, 1);
5078
+ }
4628
5079
  }
4629
5080
  };
4630
5081
  this.moveCursorLineStart = function() {
@@ -5192,7 +5643,7 @@ var Tokenizer = function(rules) {
5192
5643
  rule = state[mapping[i]];
5193
5644
 
5194
5645
  if (rule.onMatch)
5195
- type = rule.onMatch(value, currentState, stack);
5646
+ type = rule.onMatch(value, currentState, stack, line);
5196
5647
  else
5197
5648
  type = rule.token;
5198
5649
 
@@ -5214,6 +5665,8 @@ var Tokenizer = function(rules) {
5214
5665
  re = this.regExps[currentState];
5215
5666
  re.lastIndex = index;
5216
5667
  }
5668
+ if (rule.consumeLineEnd)
5669
+ lastIndex = index;
5217
5670
  break;
5218
5671
  }
5219
5672
 
@@ -5427,13 +5880,12 @@ var TextHighlightRules = function() {
5427
5880
  }
5428
5881
  }
5429
5882
  }
5430
- var includeName = typeof rule == "string"
5431
- ? rule
5432
- : typeof rule.include == "string"
5433
- ? rule.include
5434
- : "";
5883
+ var includeName = typeof rule == "string" ? rule : rule.include;
5435
5884
  if (includeName) {
5436
- toInsert = rules[includeName];
5885
+ if (Array.isArray(includeName))
5886
+ toInsert = includeName.map(function(x) { return rules[x]; });
5887
+ else
5888
+ toInsert = rules[includeName];
5437
5889
  }
5438
5890
 
5439
5891
  if (toInsert) {
@@ -5636,6 +6088,8 @@ var SAFE_INSERT_BEFORE_TOKENS =
5636
6088
 
5637
6089
  var context;
5638
6090
  var contextCache = {};
6091
+ var defaultQuotes = {'"' : '"', "'" : "'"};
6092
+
5639
6093
  var initContext = function(editor) {
5640
6094
  var id = -1;
5641
6095
  if (editor.multiSelect) {
@@ -5669,7 +6123,7 @@ var getWrapped = function(selection, selected, opening, closing) {
5669
6123
  };
5670
6124
  };
5671
6125
 
5672
- var CstyleBehaviour = function() {
6126
+ var CstyleBehaviour = function(options) {
5673
6127
  this.add("braces", "insertion", function(state, action, editor, session, text) {
5674
6128
  var cursor = editor.getCursorPosition();
5675
6129
  var line = session.doc.getLine(cursor.row);
@@ -5680,7 +6134,7 @@ var CstyleBehaviour = function() {
5680
6134
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
5681
6135
  return getWrapped(selection, selected, '{', '}');
5682
6136
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
5683
- if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
6137
+ if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options && options.braces) {
5684
6138
  CstyleBehaviour.recordAutoInsert(editor, session, "}");
5685
6139
  return {
5686
6140
  text: '{}',
@@ -5843,14 +6297,15 @@ var CstyleBehaviour = function() {
5843
6297
  });
5844
6298
 
5845
6299
  this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
5846
- if (text == '"' || text == "'") {
6300
+ var quotes = session.$mode.$quotes || defaultQuotes;
6301
+ if (text.length == 1 && quotes[text]) {
5847
6302
  if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1)
5848
6303
  return;
5849
6304
  initContext(editor);
5850
6305
  var quote = text;
5851
6306
  var selection = editor.getSelectionRange();
5852
6307
  var selected = session.doc.getTextRange(selection);
5853
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
6308
+ if (selected !== "" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) {
5854
6309
  return getWrapped(selection, selected, quote, quote);
5855
6310
  } else if (!selected) {
5856
6311
  var cursor = editor.getCursorPosition();
@@ -6977,6 +7432,9 @@ var BackgroundTokenizer = function(tokenizer, editor) {
6977
7432
  }
6978
7433
  self.currentLine = currentLine;
6979
7434
 
7435
+ if (endLine == -1)
7436
+ endLine = currentLine;
7437
+
6980
7438
  if (startLine <= endLine)
6981
7439
  self.fireUpdateEvent(startLine, endLine);
6982
7440
  };
@@ -8151,9 +8609,13 @@ function Folding() {
8151
8609
  this.getCommentFoldRange = function(row, column, dir) {
8152
8610
  var iterator = new TokenIterator(this, row, column);
8153
8611
  var token = iterator.getCurrentToken();
8154
- if (token && /^comment|string/.test(token.type)) {
8612
+ var type = token.type;
8613
+ if (token && /^comment|string/.test(type)) {
8614
+ type = type.match(/comment|string/)[0];
8615
+ if (type == "comment")
8616
+ type += "|doc-start";
8617
+ var re = new RegExp(type);
8155
8618
  var range = new Range();
8156
- var re = new RegExp(token.type.replace(/\..*/, "\\."));
8157
8619
  if (dir != 1) {
8158
8620
  do {
8159
8621
  token = iterator.stepBackward();
@@ -8167,8 +8629,16 @@ function Folding() {
8167
8629
  iterator = new TokenIterator(this, row, column);
8168
8630
 
8169
8631
  if (dir != -1) {
8632
+ var lastRow = -1;
8170
8633
  do {
8171
8634
  token = iterator.stepForward();
8635
+ if (lastRow == -1) {
8636
+ var state = this.getState(iterator.$row);
8637
+ if (!re.test(state))
8638
+ lastRow = iterator.$row;
8639
+ } else if (iterator.$row > lastRow) {
8640
+ break;
8641
+ }
8172
8642
  } while (token && re.test(token.type));
8173
8643
  token = iterator.stepBackward();
8174
8644
  } else
@@ -8618,6 +9088,8 @@ var EditSession = function(text, mode) {
8618
9088
  };
8619
9089
 
8620
9090
 
9091
+ EditSession.$uid = 0;
9092
+
8621
9093
  (function() {
8622
9094
 
8623
9095
  oop.implement(this, EventEmitter);
@@ -8827,6 +9299,12 @@ var EditSession = function(text, mode) {
8827
9299
  this.isTabStop = function(position) {
8828
9300
  return this.$useSoftTabs && (position.column % this.$tabSize === 0);
8829
9301
  };
9302
+ this.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) {
9303
+ this.setOption("navigateWithinSoftTabs", navigateWithinSoftTabs)
9304
+ }
9305
+ this.getNavigateWithinSoftTabs = function() {
9306
+ return this.$navigateWithinSoftTabs;
9307
+ }
8830
9308
 
8831
9309
  this.$overwrite = false;
8832
9310
  this.setOverwrite = function(overwrite) {
@@ -10306,6 +10784,7 @@ config.defineOptions(EditSession.prototype, "session", {
10306
10784
  initialValue: 4,
10307
10785
  handlesSet: true
10308
10786
  },
10787
+ navigateWithinSoftTabs: {initialValue: false},
10309
10788
  overwrite: {
10310
10789
  set: function(val) {this._signal("changeOverwrite");},
10311
10790
  initialValue: false
@@ -10353,18 +10832,15 @@ var Search = function() {
10353
10832
  return false;
10354
10833
 
10355
10834
  var firstRange = null;
10356
- iterator.forEach(function(range, row, offset) {
10357
- if (!range.start) {
10358
- var column = range.offset + (offset || 0);
10359
- firstRange = new Range(row, column, row, column + range.length);
10360
- if (!range.length && options.start && options.start.start
10361
- && options.skipCurrent != false && firstRange.isEqual(options.start)
10362
- ) {
10363
- firstRange = null;
10364
- return false;
10365
- }
10366
- } else
10367
- firstRange = range;
10835
+ iterator.forEach(function(sr, sc, er, ec) {
10836
+ firstRange = new Range(sr, sc, er, ec);
10837
+ if (sc == ec && options.start && options.start.start
10838
+ && options.skipCurrent != false && firstRange.isEqual(options.start)
10839
+ ) {
10840
+ firstRange = null;
10841
+ return false;
10842
+ }
10843
+
10368
10844
  return true;
10369
10845
  });
10370
10846
 
@@ -10467,62 +10943,6 @@ var Search = function() {
10467
10943
  return replacement;
10468
10944
  };
10469
10945
 
10470
- this.$matchIterator = function(session, options) {
10471
- var re = this.$assembleRegExp(options);
10472
- if (!re)
10473
- return false;
10474
-
10475
- var callback;
10476
- if (options.$isMultiLine) {
10477
- var len = re.length;
10478
- var matchIterator = function(line, row, offset) {
10479
- var startIndex = line.search(re[0]);
10480
- if (startIndex == -1)
10481
- return;
10482
- for (var i = 1; i < len; i++) {
10483
- line = session.getLine(row + i);
10484
- if (line.search(re[i]) == -1)
10485
- return;
10486
- }
10487
-
10488
- var endIndex = line.match(re[len - 1])[0].length;
10489
-
10490
- var range = new Range(row, startIndex, row + len - 1, endIndex);
10491
- if (re.offset == 1) {
10492
- range.start.row--;
10493
- range.start.column = Number.MAX_VALUE;
10494
- } else if (offset)
10495
- range.start.column += offset;
10496
-
10497
- if (callback(range))
10498
- return true;
10499
- };
10500
- } else if (options.backwards) {
10501
- var matchIterator = function(line, row, startIndex) {
10502
- var matches = lang.getMatchOffsets(line, re);
10503
- for (var i = matches.length-1; i >= 0; i--)
10504
- if (callback(matches[i], row, startIndex))
10505
- return true;
10506
- };
10507
- } else {
10508
- var matchIterator = function(line, row, startIndex) {
10509
- var matches = lang.getMatchOffsets(line, re);
10510
- for (var i = 0; i < matches.length; i++)
10511
- if (callback(matches[i], row, startIndex))
10512
- return true;
10513
- };
10514
- }
10515
-
10516
- var lineIterator = this.$lineIterator(session, options);
10517
-
10518
- return {
10519
- forEach: function(_callback) {
10520
- callback = _callback;
10521
- lineIterator.forEach(matchIterator);
10522
- }
10523
- };
10524
- };
10525
-
10526
10946
  this.$assembleRegExp = function(options, $disableFakeMultiline) {
10527
10947
  if (options.needle instanceof RegExp)
10528
10948
  return options.re = options.needle;
@@ -10560,16 +10980,13 @@ var Search = function() {
10560
10980
  } catch(e) {
10561
10981
  return false;
10562
10982
  }
10563
- if (parts[0] == "") {
10564
- re.shift();
10565
- re.offset = 1;
10566
- } else {
10567
- re.offset = 0;
10568
- }
10569
10983
  return re;
10570
10984
  };
10571
10985
 
10572
- this.$lineIterator = function(session, options) {
10986
+ this.$matchIterator = function(session, options) {
10987
+ var re = this.$assembleRegExp(options);
10988
+ if (!re)
10989
+ return false;
10573
10990
  var backwards = options.backwards == true;
10574
10991
  var skipCurrent = options.skipCurrent != false;
10575
10992
 
@@ -10583,43 +11000,100 @@ var Search = function() {
10583
11000
 
10584
11001
  var firstRow = range ? range.start.row : 0;
10585
11002
  var lastRow = range ? range.end.row : session.getLength() - 1;
10586
-
10587
- var forEach = backwards ? function(callback) {
11003
+
11004
+ if (backwards) {
11005
+ var forEach = function(callback) {
10588
11006
  var row = start.row;
10589
-
10590
- var line = session.getLine(row).substring(0, start.column);
10591
- if (callback(line, row))
11007
+ if (forEachInLine(row, start.column, callback))
10592
11008
  return;
10593
-
10594
11009
  for (row--; row >= firstRow; row--)
10595
- if (callback(session.getLine(row), row))
11010
+ if (forEachInLine(row, Number.MAX_VALUE, callback))
10596
11011
  return;
10597
-
10598
11012
  if (options.wrap == false)
10599
11013
  return;
10600
-
10601
11014
  for (row = lastRow, firstRow = start.row; row >= firstRow; row--)
10602
- if (callback(session.getLine(row), row))
11015
+ if (forEachInLine(row, Number.MAX_VALUE, callback))
10603
11016
  return;
10604
- } : function(callback) {
11017
+ };
11018
+ }
11019
+ else {
11020
+ var forEach = function(callback) {
10605
11021
  var row = start.row;
10606
-
10607
- var line = session.getLine(row).substr(start.column);
10608
- if (callback(line, row, start.column))
11022
+ if (forEachInLine(row, start.column, callback))
10609
11023
  return;
10610
-
10611
- for (row = row+1; row <= lastRow; row++)
10612
- if (callback(session.getLine(row), row))
11024
+ for (row = row + 1; row <= lastRow; row++)
11025
+ if (forEachInLine(row, 0, callback))
10613
11026
  return;
10614
-
10615
11027
  if (options.wrap == false)
10616
11028
  return;
10617
-
10618
11029
  for (row = firstRow, lastRow = start.row; row <= lastRow; row++)
10619
- if (callback(session.getLine(row), row))
11030
+ if (forEachInLine(row, 0, callback))
10620
11031
  return;
10621
11032
  };
11033
+ }
10622
11034
 
11035
+ if (options.$isMultiLine) {
11036
+ var len = re.length;
11037
+ var forEachInLine = function(row, offset, callback) {
11038
+ var startRow = backwards ? row - len + 1 : row;
11039
+ if (startRow < 0) return;
11040
+ var line = session.getLine(startRow);
11041
+ var startIndex = line.search(re[0])
11042
+ if (!backwards && startIndex < offset || startIndex === -1) return;
11043
+ for (var i = 1; i < len; i++) {
11044
+ line = session.getLine(startRow + i);
11045
+ if (line.search(re[i]) == -1)
11046
+ return;
11047
+ }
11048
+ var endIndex = line.match(re[len - 1])[0].length;
11049
+ if (backwards && endIndex > offset) return;
11050
+ if (callback(startRow, startIndex, startRow + len - 1, endIndex))
11051
+ return true;
11052
+ };
11053
+ }
11054
+ else if (backwards) {
11055
+ var forEachInLine = function(row, endIndex, callback) {
11056
+ var line = session.getLine(row);
11057
+ var matches = [];
11058
+ var m, last = 0;
11059
+ re.lastIndex = 0;
11060
+ while((m = re.exec(line))) {
11061
+ var length = m[0].length;
11062
+ last = m.index;
11063
+ if (!length) {
11064
+ if (last >= line.length) break;
11065
+ re.lastIndex = last += 1;
11066
+ }
11067
+ if (m.index + length > endIndex)
11068
+ break;
11069
+ matches.push(m.index, length)
11070
+ }
11071
+ for (var i = matches.length - 1; i >= 0; i -= 2) {
11072
+ var column = matches[i - 1];
11073
+ var length = matches[i];
11074
+ if (callback(row, column, row, column + length))
11075
+ return true;
11076
+ }
11077
+ };
11078
+ }
11079
+ else {
11080
+ var forEachInLine = function(row, startIndex, callback) {
11081
+ var line = session.getLine(row);
11082
+ var m;
11083
+ var last = startIndex;
11084
+ re.lastIndex = startIndex;
11085
+ while((m = re.exec(line))) {
11086
+ var length = m[0].length;
11087
+ last = m.index;
11088
+ if (callback(row, last, row,last + length))
11089
+ return true;
11090
+ if (!length) {
11091
+ re.lastIndex = last += 1;
11092
+ if (last >= line.length) return false;
11093
+ }
11094
+ }
11095
+ };
11096
+ }
10623
11097
  return {forEach: forEach};
10624
11098
  };
10625
11099
 
@@ -10725,7 +11199,8 @@ MultiHashHandler.prototype = HashHandler.prototype;
10725
11199
 
10726
11200
  function getPosition(command) {
10727
11201
  return typeof command == "object" && command.bindKey
10728
- && command.bindKey.position || 0;
11202
+ && command.bindKey.position
11203
+ || (command.isDefault ? -100 : 0);
10729
11204
  }
10730
11205
  this._addCommandToBinding = function(keyId, command, position) {
10731
11206
  var ckb = this.commandKeyBinding, i;
@@ -10739,13 +11214,11 @@ MultiHashHandler.prototype = HashHandler.prototype;
10739
11214
  } else if ((i = ckb[keyId].indexOf(command)) != -1) {
10740
11215
  ckb[keyId].splice(i, 1);
10741
11216
  }
10742
-
11217
+
10743
11218
  if (typeof position != "number") {
10744
- if (position || command.isDefault)
10745
- position = -100;
10746
- else
10747
- position = getPosition(command);
11219
+ position = getPosition(command);
10748
11220
  }
11221
+
10749
11222
  var commands = ckb[keyId];
10750
11223
  for (i = 0; i < commands.length; i++) {
10751
11224
  var other = commands[i];
@@ -10887,7 +11360,7 @@ oop.inherits(CommandManager, MultiHashHandler);
10887
11360
  }
10888
11361
  return false;
10889
11362
  }
10890
-
11363
+
10891
11364
  if (typeof command === "string")
10892
11365
  command = this.commands[command];
10893
11366
 
@@ -10897,6 +11370,9 @@ oop.inherits(CommandManager, MultiHashHandler);
10897
11370
  if (editor && editor.$readOnly && !command.readOnly)
10898
11371
  return false;
10899
11372
 
11373
+ if (command.isAvailable && !command.isAvailable(editor))
11374
+ return false;
11375
+
10900
11376
  var e = {editor: editor, command: command, args: args};
10901
11377
  e.returnValue = this._emit("exec", e);
10902
11378
  this._signal("afterExec", e);
@@ -11552,7 +12028,7 @@ exports.commands = [{
11552
12028
  scrollIntoView: "cursor"
11553
12029
  }, {
11554
12030
  name: "transposeletters",
11555
- bindKey: bindKey("Ctrl-T", "Ctrl-T"),
12031
+ bindKey: bindKey("Alt-Shift-X", "Ctrl-T"),
11556
12032
  exec: function(editor) { editor.transposeLetters(); },
11557
12033
  multiSelectAction: function(editor) {editor.transposeSelections(1); },
11558
12034
  scrollIntoView: "cursor"
@@ -11684,13 +12160,17 @@ var Editor = function(renderer, session) {
11684
12160
  var container = renderer.getContainerElement();
11685
12161
  this.container = container;
11686
12162
  this.renderer = renderer;
12163
+ this.id = "editor" + (++Editor.$uid);
11687
12164
 
11688
12165
  this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands);
11689
- this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
11690
- this.renderer.textarea = this.textInput.getElement();
12166
+ if (typeof document == "object") {
12167
+ this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
12168
+ this.renderer.textarea = this.textInput.getElement();
12169
+ this.$mouseHandler = new MouseHandler(this);
12170
+ new FoldHandler(this);
12171
+ }
12172
+
11691
12173
  this.keyBinding = new KeyBinding(this);
11692
- this.$mouseHandler = new MouseHandler(this);
11693
- new FoldHandler(this);
11694
12174
 
11695
12175
  this.$blockScrolling = 0;
11696
12176
  this.$search = new Search().set({
@@ -11717,6 +12197,8 @@ var Editor = function(renderer, session) {
11717
12197
  config._signal("editor", this);
11718
12198
  };
11719
12199
 
12200
+ Editor.$uid = 0;
12201
+
11720
12202
  (function(){
11721
12203
 
11722
12204
  oop.implement(this, EventEmitter);
@@ -11963,6 +12445,9 @@ var Editor = function(renderer, session) {
11963
12445
 
11964
12446
  oldSession && oldSession._signal("changeEditor", {oldEditor: this});
11965
12447
  session && session._signal("changeEditor", {editor: this});
12448
+
12449
+ if (session && session.bgTokenizer)
12450
+ session.bgTokenizer.scheduleStart();
11966
12451
  };
11967
12452
  this.getSession = function() {
11968
12453
  return this.session;
@@ -12372,7 +12857,7 @@ var Editor = function(renderer, session) {
12372
12857
  cursor = this.session.remove(range);
12373
12858
  this.clearSelection();
12374
12859
  }
12375
- else if (this.session.getOverwrite()) {
12860
+ else if (this.session.getOverwrite() && text.indexOf("\n") == -1) {
12376
12861
  var range = new Range.fromPoints(cursor, cursor);
12377
12862
  range.end.column += text.length;
12378
12863
  this.session.remove(range);
@@ -12631,6 +13116,7 @@ var Editor = function(renderer, session) {
12631
13116
  range = new Range(cursor.row, column-2, cursor.row, column);
12632
13117
  }
12633
13118
  this.session.replace(range, swap);
13119
+ this.session.selection.moveToPosition(range.end);
12634
13120
  };
12635
13121
  this.toLowerCase = function() {
12636
13122
  var originalRange = this.getSelectionRange();
@@ -13786,7 +14272,7 @@ var Gutter = function(parentEl) {
13786
14272
  var text = lastLineNumber = gutterRenderer
13787
14273
  ? gutterRenderer.getText(session, row)
13788
14274
  : row + firstLineNumber;
13789
- if (text != cell.textNode.data)
14275
+ if (text !== cell.textNode.data)
13790
14276
  cell.textNode.data = text;
13791
14277
 
13792
14278
  row++;
@@ -13893,9 +14379,7 @@ var Marker = function(parentEl) {
13893
14379
  };
13894
14380
 
13895
14381
  this.update = function(config) {
13896
- var config = config || this.config;
13897
- if (!config)
13898
- return;
14382
+ if (!config) return;
13899
14383
 
13900
14384
  this.config = config;
13901
14385
 
@@ -14834,6 +15318,7 @@ var VScrollBar = function(parent, renderer) {
14834
15318
  this.width = dom.scrollbarWidth(parent.ownerDocument);
14835
15319
  this.inner.style.width =
14836
15320
  this.element.style.width = (this.width || 15) + 5 + "px";
15321
+ this.$minWidth = 0;
14837
15322
  };
14838
15323
 
14839
15324
  oop.inherits(VScrollBar, ScrollBar);
@@ -14853,7 +15338,7 @@ oop.inherits(VScrollBar, ScrollBar);
14853
15338
  this.skipEvent = false;
14854
15339
  };
14855
15340
  this.getWidth = function() {
14856
- return this.isVisible ? this.width : 0;
15341
+ return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
14857
15342
  };
14858
15343
  this.setHeight = function(height) {
14859
15344
  this.element.style.height = height + "px";
@@ -15132,6 +15617,7 @@ overflow: hidden;\
15132
15617
  font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\
15133
15618
  direction: ltr;\
15134
15619
  text-align: left;\
15620
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\
15135
15621
  }\
15136
15622
  .ace_scroller {\
15137
15623
  position: absolute;\
@@ -15305,6 +15791,9 @@ box-sizing: border-box;\
15305
15791
  border-left: 2px solid;\
15306
15792
  transform: translatez(0);\
15307
15793
  }\
15794
+ .ace_multiselect .ace_cursor {\
15795
+ border-left-width: 1px;\
15796
+ }\
15308
15797
  .ace_slim-cursors .ace_cursor {\
15309
15798
  border-left-width: 1px;\
15310
15799
  }\
@@ -15319,9 +15808,6 @@ opacity: 0.2;\
15319
15808
  -webkit-transition: opacity 0.18s;\
15320
15809
  transition: opacity 0.18s;\
15321
15810
  }\
15322
- .ace_editor.ace_multiselect .ace_cursor {\
15323
- border-left-width: 1px;\
15324
- }\
15325
15811
  .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\
15326
15812
  position: absolute;\
15327
15813
  z-index: 3;\
@@ -15499,6 +15985,11 @@ z-index: 8;\
15499
15985
  .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\
15500
15986
  .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\
15501
15987
  .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\
15988
+ .ace_text-input-ios {\
15989
+ position: absolute !important;\
15990
+ top: -100000px !important;\
15991
+ left: -100000px !important;\
15992
+ }\
15502
15993
  ";
15503
15994
 
15504
15995
  dom.importCssString(editorCss, "ace_editor.css");
@@ -15657,7 +16148,7 @@ var VirtualRenderer = function(container, theme) {
15657
16148
 
15658
16149
  this.$loop.schedule(this.CHANGE_FULL);
15659
16150
  this.session.$setFontMetrics(this.$fontMetrics);
15660
- this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;
16151
+ this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;
15661
16152
 
15662
16153
  this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);
15663
16154
  this.onChangeNewLineMode()
@@ -16260,6 +16751,7 @@ var VirtualRenderer = function(container, theme) {
16260
16751
  };
16261
16752
 
16262
16753
  this.$updateLines = function() {
16754
+ if (!this.$changedLines) return;
16263
16755
  var firstRow = this.$changedLines.firstRow;
16264
16756
  var lastRow = this.$changedLines.lastRow;
16265
16757
  this.$changedLines = null;
@@ -16774,7 +17266,26 @@ var net = require("../lib/net");
16774
17266
  var EventEmitter = require("../lib/event_emitter").EventEmitter;
16775
17267
  var config = require("../config");
16776
17268
 
16777
- var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
17269
+ function $workerBlob(workerUrl) {
17270
+ var script = "importScripts('" + net.qualifyURL(workerUrl) + "');";
17271
+ try {
17272
+ return new Blob([script], {"type": "application/javascript"});
17273
+ } catch (e) { // Backwards-compatibility
17274
+ var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
17275
+ var blobBuilder = new BlobBuilder();
17276
+ blobBuilder.append(script);
17277
+ return blobBuilder.getBlob("application/javascript");
17278
+ }
17279
+ }
17280
+
17281
+ function createWorker(workerUrl) {
17282
+ var blob = $workerBlob(workerUrl);
17283
+ var URL = window.URL || window.webkitURL;
17284
+ var blobURL = URL.createObjectURL(blob);
17285
+ return new Worker(blobURL);
17286
+ }
17287
+
17288
+ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {
16778
17289
  this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);
16779
17290
  this.changeListener = this.changeListener.bind(this);
16780
17291
  this.onMessage = this.onMessage.bind(this);
@@ -16793,19 +17304,9 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
16793
17304
  });
16794
17305
  }
16795
17306
 
16796
- try {
16797
- this.$worker = new Worker(workerUrl);
16798
- } catch(e) {
16799
- if (e instanceof window.DOMException) {
16800
- var blob = this.$workerBlob(workerUrl);
16801
- var URL = window.URL || window.webkitURL;
16802
- var blobURL = URL.createObjectURL(blob);
16803
-
16804
- this.$worker = new Worker(blobURL);
16805
- URL.revokeObjectURL(blobURL);
16806
- } else {
16807
- throw e;
16808
- }
17307
+ this.$worker = createWorker(workerUrl);
17308
+ if (importScripts) {
17309
+ this.send("importScripts", importScripts);
16809
17310
  }
16810
17311
  this.$worker.postMessage({
16811
17312
  init : true,
@@ -16826,7 +17327,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
16826
17327
 
16827
17328
  this.onMessage = function(e) {
16828
17329
  var msg = e.data;
16829
- switch(msg.type) {
17330
+ switch (msg.type) {
16830
17331
  case "event":
16831
17332
  this._signal(msg.name, {data: msg.data});
16832
17333
  break;
@@ -16887,7 +17388,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
16887
17388
  };
16888
17389
 
16889
17390
  this.attachToDocument = function(doc) {
16890
- if(this.$doc)
17391
+ if (this.$doc)
16891
17392
  this.terminate();
16892
17393
 
16893
17394
  this.$doc = doc;
@@ -16916,18 +17417,6 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
16916
17417
  this.emit("change", {data: q});
16917
17418
  };
16918
17419
 
16919
- this.$workerBlob = function(workerUrl) {
16920
- var script = "importScripts('" + net.qualifyURL(workerUrl) + "');";
16921
- try {
16922
- return new Blob([script], {"type": "application/javascript"});
16923
- } catch (e) { // Backwards-compatibility
16924
- var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
16925
- var blobBuilder = new BlobBuilder();
16926
- blobBuilder.append(script);
16927
- return blobBuilder.getBlob("application/javascript");
16928
- }
16929
- };
16930
-
16931
17420
  }).call(WorkerClient.prototype);
16932
17421
 
16933
17422
 
@@ -16985,6 +17474,8 @@ UIWorkerClient.prototype = WorkerClient.prototype;
16985
17474
 
16986
17475
  exports.UIWorkerClient = UIWorkerClient;
16987
17476
  exports.WorkerClient = WorkerClient;
17477
+ exports.createWorker = createWorker;
17478
+
16988
17479
 
16989
17480
  });
16990
17481
 
@@ -19052,7 +19543,7 @@ exports.createEditSession = function(text, mode) {
19052
19543
  }
19053
19544
  exports.EditSession = EditSession;
19054
19545
  exports.UndoManager = UndoManager;
19055
- exports.version = "1.2.6";
19546
+ exports.version = "1.2.8";
19056
19547
  });
19057
19548
  (function() {
19058
19549
  window.require(["ace/ace"], function(a) {