gollum 2.4.4 → 2.4.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

Files changed (391) hide show
  1. data/gollum.gemspec +100 -19
  2. data/lib/gollum.rb +2 -3
  3. data/lib/gollum/frontend/public/gollum/css/gollum.css +3 -1
  4. data/lib/gollum/frontend/public/gollum/css/template.css +8 -12
  5. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +64 -60
  6. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +56 -62
  7. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +25 -32
  8. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +56 -63
  9. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +25 -32
  10. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +11 -11
  11. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +59 -53
  12. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +46 -39
  13. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +32 -36
  14. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +62 -47
  15. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config_test.js +71 -0
  16. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +82 -41
  17. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +126 -145
  18. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +25 -33
  19. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +484 -467
  20. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +30 -63
  21. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +29 -37
  22. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +27 -35
  23. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +47 -55
  24. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +61 -41
  25. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +506 -517
  26. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +25 -32
  27. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +26 -34
  28. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +25 -32
  29. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +25 -32
  30. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +28 -38
  31. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +9 -14
  32. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +26 -36
  33. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +44 -36
  34. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +45 -52
  35. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +25 -34
  36. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +26 -33
  37. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +230 -165
  38. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +76 -49
  39. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +66 -61
  40. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +36 -43
  41. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +138 -156
  42. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +35 -32
  43. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +18 -18
  44. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +25 -32
  45. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +116 -101
  46. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +117 -83
  47. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +60 -71
  48. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +163 -102
  49. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +60 -41
  50. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +26 -36
  51. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +26 -36
  52. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +24 -1
  53. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +52 -54
  54. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +32 -39
  55. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +25 -32
  56. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +9 -1
  57. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +73 -33
  58. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +10 -3
  59. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +25 -32
  60. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +2 -2
  61. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +55 -58
  62. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json +8 -0
  63. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js +144 -0
  64. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +52 -0
  65. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +175 -0
  66. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +124 -0
  67. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +248 -0
  68. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +188 -0
  69. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +41 -0
  70. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +42 -0
  71. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +231 -0
  72. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +732 -0
  73. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +185 -0
  74. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +362 -0
  75. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +529 -0
  76. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +195 -0
  77. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +150 -0
  78. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +139 -0
  79. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +555 -0
  80. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +611 -0
  81. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +79 -0
  82. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +196 -0
  83. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +292 -0
  84. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +698 -0
  85. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +451 -0
  86. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +824 -0
  87. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +1202 -0
  88. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +260 -0
  89. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +311 -0
  90. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +1020 -0
  91. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +238 -0
  92. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +255 -0
  93. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +205 -0
  94. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +104 -0
  95. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +267 -0
  96. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +748 -0
  97. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +181 -0
  98. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +434 -0
  99. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +73 -0
  100. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +931 -0
  101. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +536 -0
  102. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +58 -0
  103. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +195 -0
  104. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +705 -0
  105. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +64 -0
  106. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +260 -0
  107. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +77 -0
  108. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +133 -0
  109. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +64 -0
  110. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +234 -0
  111. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +26 -34
  112. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +195 -55
  113. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +26 -34
  114. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +26 -34
  115. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +31 -31
  116. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +25 -32
  117. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +25 -32
  118. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +25 -33
  119. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +67 -60
  120. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +25 -34
  121. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +112 -130
  122. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +29 -36
  123. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +25 -32
  124. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +22 -7
  125. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +140 -64
  126. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +479 -237
  127. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +321 -230
  128. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +25 -32
  129. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +62 -28
  130. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +39 -20
  131. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +183 -82
  132. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +226 -32
  133. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +25 -32
  134. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +25 -32
  135. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +28 -35
  136. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +25 -32
  137. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +7 -21
  138. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +36 -47
  139. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +202 -697
  140. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +51 -84
  141. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +25 -32
  142. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +25 -32
  143. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +68 -40
  144. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +25 -32
  145. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js +62 -0
  146. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +192 -0
  147. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +25 -31
  148. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +27 -33
  149. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +25 -32
  150. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js +142 -0
  151. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +31 -37
  152. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +26 -33
  153. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +25 -32
  154. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +30 -51
  155. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +25 -32
  156. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +28 -35
  157. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +35 -30
  158. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +25 -32
  159. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +25 -32
  160. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +162 -0
  161. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +163 -0
  162. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js +125 -0
  163. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +25 -32
  164. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +25 -32
  165. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +26 -33
  166. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +25 -32
  167. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +25 -32
  168. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +52 -0
  169. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js +81 -0
  170. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +0 -1
  171. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +15 -22
  172. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +28 -36
  173. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js +62 -0
  174. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +132 -0
  175. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +20 -25
  176. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +11 -15
  177. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +25 -32
  178. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +32 -38
  179. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +162 -69
  180. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +25 -32
  181. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js +58 -0
  182. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +347 -0
  183. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +18 -29
  184. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +28 -51
  185. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +4838 -0
  186. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +98 -180
  187. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +26 -33
  188. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +25 -32
  189. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +163 -64
  190. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +38 -40
  191. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +26 -33
  192. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +26 -34
  193. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +25 -32
  194. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +25 -32
  195. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +56 -0
  196. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +85 -0
  197. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +3 -2
  198. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +1 -1
  199. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +25 -33
  200. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +25 -33
  201. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +25 -32
  202. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +146 -161
  203. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +25 -32
  204. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +60 -0
  205. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +127 -0
  206. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +116 -56
  207. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +75 -101
  208. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +16 -0
  209. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js +49 -0
  210. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js +99 -0
  211. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +62 -0
  212. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +75 -0
  213. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +35 -41
  214. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +29 -37
  215. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js +100 -0
  216. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +25 -32
  217. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +25 -32
  218. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +62 -0
  219. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +343 -0
  220. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +25 -32
  221. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +39 -53
  222. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +25 -32
  223. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +39 -52
  224. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +33 -24
  225. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +55 -51
  226. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +57 -36
  227. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +53 -153
  228. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +31 -21
  229. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +28 -36
  230. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +44 -61
  231. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +25 -32
  232. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r.js +135 -0
  233. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +190 -0
  234. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +36 -0
  235. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +99 -0
  236. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +67 -0
  237. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +49 -0
  238. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +27 -33
  239. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +102 -90
  240. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +29 -37
  241. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +25 -33
  242. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +32 -54
  243. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +18 -32
  244. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +25 -32
  245. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +25 -32
  246. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +28 -35
  247. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +48 -64
  248. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +28 -18
  249. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +41 -36
  250. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +62 -0
  251. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +175 -0
  252. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +25 -32
  253. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +26 -33
  254. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +110 -0
  255. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +180 -0
  256. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js +48 -0
  257. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +107 -0
  258. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +26 -36
  259. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +57 -46
  260. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +25 -32
  261. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +25 -32
  262. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +26 -33
  263. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +68 -0
  264. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +98 -0
  265. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +25 -32
  266. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +27 -34
  267. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +183 -78
  268. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +25 -32
  269. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +30 -38
  270. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +32 -37
  271. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js +92 -0
  272. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +32954 -42497
  273. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +316 -0
  274. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +31 -44
  275. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +48 -57
  276. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +30 -18
  277. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +48 -40
  278. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +26 -34
  279. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +126 -40
  280. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +35 -43
  281. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +28 -35
  282. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +78 -39
  283. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +26 -34
  284. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +39 -36
  285. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +26 -34
  286. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +234 -103
  287. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +26 -34
  288. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +30 -39
  289. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +27 -35
  290. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +190 -201
  291. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +25 -32
  292. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +25 -32
  293. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +25 -32
  294. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +31 -49
  295. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +27 -34
  296. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +52 -55
  297. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +91 -105
  298. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +31 -34
  299. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +47 -37
  300. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +138 -153
  301. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +25 -32
  302. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +67 -105
  303. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +25 -32
  304. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +3 -2
  305. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +25 -32
  306. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +25 -32
  307. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +30 -34
  308. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +217 -0
  309. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js +33 -0
  310. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +37 -38
  311. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +27 -34
  312. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +53 -47
  313. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +28 -35
  314. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +54 -48
  315. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +28 -35
  316. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +58 -59
  317. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +28 -35
  318. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +33 -33
  319. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +26 -33
  320. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +52 -64
  321. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +28 -35
  322. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +33 -36
  323. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +26 -33
  324. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +29 -25
  325. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +26 -33
  326. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +14 -21
  327. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +26 -33
  328. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +48 -60
  329. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +28 -35
  330. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +52 -57
  331. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +28 -35
  332. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +53 -71
  333. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +28 -35
  334. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +54 -77
  335. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +28 -35
  336. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +60 -70
  337. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +28 -35
  338. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +55 -72
  339. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +28 -35
  340. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +55 -64
  341. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +28 -35
  342. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +48 -66
  343. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +28 -35
  344. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +49 -61
  345. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +28 -35
  346. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +38 -44
  347. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +26 -33
  348. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +59 -87
  349. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +28 -35
  350. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +59 -87
  351. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +28 -35
  352. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +59 -90
  353. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +28 -35
  354. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +59 -87
  355. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +28 -35
  356. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +57 -85
  357. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +28 -35
  358. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +54 -78
  359. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +28 -35
  360. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +45 -68
  361. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +28 -35
  362. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +111 -0
  363. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +39 -0
  364. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +37 -50
  365. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +26 -33
  366. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +40 -41
  367. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +205 -0
  368. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +48 -55
  369. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +254 -277
  370. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +25 -32
  371. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +22 -4
  372. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +97 -56
  373. data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +24 -476
  374. data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +2 -2
  375. data/lib/gollum/frontend/views/page.rb +3 -2
  376. metadata +102 -21
  377. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +0 -59
  378. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +0 -1686
  379. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +0 -2993
  380. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +0 -69
  381. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +0 -63
  382. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +0 -10363
  383. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +0 -165
  384. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +0 -6177
  385. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +0 -55
  386. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +0 -696
  387. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +0 -598
  388. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +0 -61
  389. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +0 -2072
  390. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +0 -4469
  391. data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +0 -6396
@@ -0,0 +1,205 @@
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(function(require, exports, module) {
32
+
33
+ /*
34
+ * version of Tokenizer with additional logging
35
+ * and infinite loop checks
36
+ * can be used for developing/testing new modes
37
+ **/
38
+ var Tokenizer = function(rules, flag) {
39
+ flag = flag ? "g" + flag : "g";
40
+ this.rules = rules;
41
+
42
+ this.regExps = {};
43
+ this.matchMappings = {};
44
+ for ( var key in this.rules) {
45
+ var rule = this.rules[key];
46
+ var state = rule;
47
+ var ruleRegExps = [];
48
+ var matchTotal = 0;
49
+ var mapping = this.matchMappings[key] = {};
50
+
51
+ for ( var i = 0; i < state.length; i++) {
52
+
53
+ if (state[i].regex instanceof RegExp)
54
+ state[i].regex = state[i].regex.toString().slice(1, -1);
55
+
56
+ // Count number of matching groups. 2 extra groups from the full match
57
+ // And the catch-all on the end (used to force a match);
58
+ var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2;
59
+
60
+ // Replace any backreferences and offset appropriately.
61
+ var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) {
62
+ return "\\" + (parseInt(digit, 10) + matchTotal + 1);
63
+ });
64
+
65
+ if (matchcount > 1 && state[i].token.length !== matchcount-1)
66
+ throw new Error("For " + state[i].regex + " the matching groups and length of the token array don't match (rule #" + i + " of state " + key + ")");
67
+
68
+ mapping[matchTotal] = {
69
+ rule: i,
70
+ len: matchcount
71
+ };
72
+ matchTotal += matchcount;
73
+
74
+ ruleRegExps.push(adjustedregex);
75
+ }
76
+
77
+ this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag);
78
+ }
79
+ };
80
+
81
+ (function() {
82
+ this.getLineTokens = function(line, startState) {
83
+ var currentState = startState || "start";
84
+ var state = this.rules[currentState];
85
+ var mapping = this.matchMappings[currentState];
86
+ var re = this.regExps[currentState];
87
+ re.lastIndex = 0;
88
+
89
+ var match, tokens = [];
90
+
91
+ var lastIndex = 0;
92
+
93
+ var stateTransitions = [];
94
+ function onStateChange() {
95
+ stateTransitions.push(startState+"@"+lastIndex);
96
+ }
97
+ function initState() {
98
+ onStateChange();
99
+ stateTransitions = [];
100
+ onStateChange();
101
+ }
102
+
103
+ var token = {
104
+ type: null,
105
+ value: "",
106
+ state: currentState
107
+ };
108
+ initState();
109
+
110
+ var maxRecur = 10000;
111
+
112
+ while (match = re.exec(line)) {
113
+ var type = "default.text";
114
+ var rule = null;
115
+ var value = [match[0]];
116
+
117
+ for (var i = 0; i < match.length-2; i++) {
118
+ if (match[i + 1] === undefined)
119
+ continue;
120
+
121
+ if (!maxRecur--) {
122
+ throw "infinite" + mapping[i].rule + currentState
123
+ }
124
+
125
+ rule = state[mapping[i].rule];
126
+
127
+ if (mapping[i].len > 1)
128
+ value = match.slice(i+2, i+1+mapping[i].len);
129
+
130
+ // compute token type
131
+ if (typeof rule.token == "function")
132
+ type = rule.token.apply(this, value);
133
+ else
134
+ type = rule.token;
135
+
136
+ if (rule.next) {
137
+ currentState = rule.next;
138
+ state = this.rules[currentState];
139
+ mapping = this.matchMappings[currentState];
140
+ lastIndex = re.lastIndex;
141
+
142
+ re = this.regExps[currentState];
143
+
144
+ if (re === undefined) {
145
+ throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!");
146
+ }
147
+
148
+ re.lastIndex = lastIndex;
149
+
150
+ onStateChange();
151
+ }
152
+ break;
153
+ }
154
+
155
+ if (value[0]) {
156
+ if (typeof type == "string") {
157
+ value = [value.join("")];
158
+ type = [type];
159
+ }
160
+ for (var i = 0; i < value.length; i++) {
161
+ if (!value[i])
162
+ continue;
163
+
164
+ var mergeable = (!rule || rule.merge || type[i] === "text") && token.type === type[i];
165
+
166
+ if (false && mergeable) {
167
+ token.value += value[i];
168
+ } else {
169
+ if (token.type) {
170
+ token.stateTransitions = stateTransitions;
171
+ tokens.push(token);
172
+ initState()
173
+ }
174
+
175
+ token = {
176
+ type: type[i],
177
+ value: value[i],
178
+ state: currentState,
179
+ mergeable: mergeable
180
+ };
181
+ }
182
+ }
183
+ }
184
+
185
+ if (lastIndex == line.length)
186
+ break;
187
+
188
+ lastIndex = re.lastIndex;
189
+ }
190
+
191
+ if (token.type) {
192
+ token.stateTransitions = stateTransitions;
193
+ tokens.push(token);
194
+ }
195
+
196
+ return {
197
+ tokens : tokens,
198
+ state : currentState
199
+ };
200
+ };
201
+
202
+ }).call(Tokenizer.prototype);
203
+
204
+ exports.Tokenizer = Tokenizer;
205
+ });
@@ -1,39 +1,30 @@
1
- /* vim:ts=4:sts=4:sw=4:
2
- * ***** BEGIN LICENSE BLOCK *****
3
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
4
3
  *
5
- * The contents of this file are subject to the Mozilla Public License Version
6
- * 1.1 (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- * http://www.mozilla.org/MPL/
9
- *
10
- * Software distributed under the License is distributed on an "AS IS" basis,
11
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
- * for the specific language governing rights and limitations under the
13
- * License.
14
- *
15
- * The Original Code is Ajax.org Code Editor (ACE).
16
- *
17
- * The Initial Developer of the Original Code is
18
- * Ajax.org B.V.
19
- * Portions created by the Initial Developer are Copyright (C) 2010
20
- * the Initial Developer. All Rights Reserved.
21
- *
22
- * Contributor(s):
23
- * Fabian Jakobs <fabian AT ajax DOT org>
24
- * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
25
- *
26
- * Alternatively, the contents of this file may be used under the terms of
27
- * either the GNU General Public License Version 2 or later (the "GPL"), or
28
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
- * in which case the provisions of the GPL or the LGPL are applicable instead
30
- * of those above. If you wish to allow use of your version of this file only
31
- * under the terms of either the GPL or the LGPL, and not to allow others to
32
- * use your version of this file under the terms of the MPL, indicate your
33
- * decision by deleting the provisions above and replace them with the notice
34
- * and other provisions required by the GPL or the LGPL. If you do not delete
35
- * the provisions above, a recipient may use your version of this file under
36
- * the terms of any one of the MPL, the GPL or the LGPL.
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
28
  *
38
29
  * ***** END LICENSE BLOCK ***** */
39
30
 
@@ -41,16 +32,18 @@ define(function(require, exports, module) {
41
32
  "use strict";
42
33
 
43
34
  /**
44
- * class UndoManager
35
+ *
45
36
  *
46
37
  * This object maintains the undo stack for an [[EditSession `EditSession`]].
47
- *
38
+ * @class UndoManager
48
39
  **/
49
40
 
50
41
  /**
51
- * new UndoManager()
42
+ *
52
43
  *
53
44
  * Resets the current undo state and creates a new `UndoManager`.
45
+ *
46
+ * @constructor
54
47
  **/
55
48
  var UndoManager = function() {
56
49
  this.reset();
@@ -59,12 +52,12 @@ var UndoManager = function() {
59
52
  (function() {
60
53
 
61
54
  /**
62
- * UndoManager.execute(options) -> Void
63
- * - options (Object): Contains additional properties
64
- *
65
55
  * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements:
66
- * * `args[0]` is an array of deltas
67
- * * `args[1]` is the document to associate with
56
+ *
57
+ * - `args[0]` is an array of deltas
58
+ * - `args[1]` is the document to associate with
59
+ *
60
+ * @param {Object} options Contains additional properties
68
61
  *
69
62
  **/
70
63
  this.execute = function(options) {
@@ -75,10 +68,11 @@ var UndoManager = function() {
75
68
  };
76
69
 
77
70
  /**
78
- * UndoManager.undo(dontSelect) -> Range
79
- * - dontSelect (Boolean): {:dontSelect}
71
+ * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo}
72
+ * @param {Boolean} dontSelect {:dontSelect}
80
73
  *
81
- * [Perform an undo operation on the document, reverting the last change. Returns the range of the undo.]{: #UndoManager.undo}
74
+ *
75
+ * @returns {Range} The range of the undo.
82
76
  **/
83
77
  this.undo = function(dontSelect) {
84
78
  var deltas = this.$undoStack.pop();
@@ -92,10 +86,10 @@ var UndoManager = function() {
92
86
  };
93
87
 
94
88
  /**
95
- * UndoManager.redo(dontSelect) -> Void
96
- * - dontSelect (Boolean): {:dontSelect}
97
- *
98
89
  * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo}
90
+ * @param {Boolean} dontSelect {:dontSelect}
91
+ *
92
+ *
99
93
  **/
100
94
  this.redo = function(dontSelect) {
101
95
  var deltas = this.$redoStack.pop();
@@ -109,8 +103,7 @@ var UndoManager = function() {
109
103
  };
110
104
 
111
105
  /**
112
- * UndoManager.reset() -> Void
113
- *
106
+ *
114
107
  * Destroys the stack of undo and redo redo operations.
115
108
  **/
116
109
  this.reset = function() {
@@ -119,18 +112,18 @@ var UndoManager = function() {
119
112
  };
120
113
 
121
114
  /**
122
- * UndoManager.hasUndo() -> Boolean
123
- *
115
+ *
124
116
  * Returns `true` if there are undo operations left to perform.
117
+ * @returns {Boolean}
125
118
  **/
126
119
  this.hasUndo = function() {
127
120
  return this.$undoStack.length > 0;
128
121
  };
129
122
 
130
123
  /**
131
- * UndoManager.hasRedo() -> Boolean
132
- *
124
+ *
133
125
  * Returns `true` if there are redo operations left to perform.
126
+ * @returns {Boolean}
134
127
  **/
135
128
  this.hasRedo = function() {
136
129
  return this.$redoStack.length > 0;
@@ -1,40 +1,30 @@
1
- /* vim:ts=4:sts=4:sw=4:
2
- * ***** BEGIN LICENSE BLOCK *****
3
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
4
3
  *
5
- * The contents of this file are subject to the Mozilla Public License Version
6
- * 1.1 (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- * http://www.mozilla.org/MPL/
9
- *
10
- * Software distributed under the License is distributed on an "AS IS" basis,
11
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
- * for the specific language governing rights and limitations under the
13
- * License.
14
- *
15
- * The Original Code is Ajax.org Code Editor (ACE).
16
- *
17
- * The Initial Developer of the Original Code is
18
- * Ajax.org B.V.
19
- * Portions created by the Initial Developer are Copyright (C) 2010
20
- * the Initial Developer. All Rights Reserved.
21
- *
22
- * Contributor(s):
23
- * Fabian Jakobs <fabian@ajax.org>
24
- * Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
25
- * Julian Viereck <julian.viereck@gmail.com>
26
- *
27
- * Alternatively, the contents of this file may be used under the terms of
28
- * either the GNU General Public License Version 2 or later (the "GPL"), or
29
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30
- * in which case the provisions of the GPL or the LGPL are applicable instead
31
- * of those above. If you wish to allow use of your version of this file only
32
- * under the terms of either the GPL or the LGPL, and not to allow others to
33
- * use your version of this file under the terms of the MPL, indicate your
34
- * decision by deleting the provisions above and replace them with the notice
35
- * and other provisions required by the GPL or the LGPL. If you do not delete
36
- * the provisions above, a recipient may use your version of this file under
37
- * the terms of any one of the MPL, the GPL or the LGPL.
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
28
  *
39
29
  * ***** END LICENSE BLOCK ***** */
40
30
 
@@ -54,24 +44,26 @@ var CursorLayer = require("./layer/cursor").Cursor;
54
44
  var ScrollBar = require("./scrollbar").ScrollBar;
55
45
  var RenderLoop = require("./renderloop").RenderLoop;
56
46
  var EventEmitter = require("./lib/event_emitter").EventEmitter;
57
- var editorCss = require("ace/requirejs/text!./css/editor.css");
47
+ var editorCss = require("./requirejs/text!./css/editor.css");
58
48
 
59
49
  dom.importCssString(editorCss, "ace_editor");
60
50
 
61
51
  /**
62
- * class VirtualRenderer
52
+ *
63
53
  *
64
54
  * The class that is responsible for drawing everything you see on the screen!
65
- *
55
+ * @class VirtualRenderer
66
56
  **/
67
57
 
68
58
  /**
69
- * new VirtualRenderer(container, theme)
70
- * - container (DOMElement): The root element of the editor
71
- * - theme (String): The starting theme
72
- *
73
59
  * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`.
60
+ * @param {DOMElement} container The root element of the editor
61
+ * @param {String} theme The starting theme
62
+ *
63
+ *
74
64
  *
65
+ *
66
+ * @constructor
75
67
  **/
76
68
 
77
69
  var VirtualRenderer = function(container, theme) {
@@ -102,9 +94,9 @@ var VirtualRenderer = function(container, theme) {
102
94
  this.content.className = "ace_content";
103
95
  this.scroller.appendChild(this.content);
104
96
 
97
+ this.setHighlightGutterLine(true);
105
98
  this.$gutterLayer = new GutterLayer(this.$gutter);
106
99
  this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
107
- this.setFadeFoldWidgets(true);
108
100
 
109
101
  this.$markerBack = new MarkerLayer(this.content);
110
102
 
@@ -113,11 +105,7 @@ var VirtualRenderer = function(container, theme) {
113
105
 
114
106
  this.$markerFront = new MarkerLayer(this.content);
115
107
 
116
- this.characterWidth = textLayer.getCharacterWidth();
117
- this.lineHeight = textLayer.getLineHeight();
118
-
119
108
  this.$cursorLayer = new CursorLayer(this.content);
120
- this.$cursorPadding = 8;
121
109
 
122
110
  // Indicates whether the horizontal scrollbar is visible
123
111
  this.$horizScroll = false;
@@ -146,12 +134,8 @@ var VirtualRenderer = function(container, theme) {
146
134
  };
147
135
 
148
136
  this.$textLayer.addEventListener("changeCharacterSize", function() {
149
- _self.characterWidth = textLayer.getCharacterWidth();
150
- _self.lineHeight = textLayer.getLineHeight();
151
- _self.$updatePrintMargin();
137
+ _self.updateCharacterSize();
152
138
  _self.onResize(true);
153
-
154
- _self.$loop.schedule(_self.CHANGE_FULL);
155
139
  });
156
140
 
157
141
  this.$size = {
@@ -181,8 +165,8 @@ var VirtualRenderer = function(container, theme) {
181
165
  );
182
166
  this.$loop.schedule(this.CHANGE_FULL);
183
167
 
168
+ this.updateCharacterSize();
184
169
  this.setPadding(4);
185
- this.$updatePrintMargin();
186
170
  };
187
171
 
188
172
  (function() {
@@ -201,11 +185,21 @@ var VirtualRenderer = function(container, theme) {
201
185
  this.CHANGE_H_SCROLL = 1024;
202
186
 
203
187
  oop.implement(this, EventEmitter);
188
+
189
+ this.updateCharacterSize = function() {
190
+ if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) {
191
+ this.$allowBoldFonts = this.$textLayer.allowBoldFonts;
192
+ this.setStyle("ace_nobold", !this.$allowBoldFonts);
193
+ }
194
+
195
+ this.characterWidth = this.$textLayer.getCharacterWidth();
196
+ this.lineHeight = this.$textLayer.getLineHeight();
197
+ this.$updatePrintMargin();
198
+ };
204
199
 
205
200
  /**
206
- * VirtualRenderer.setSession(session) -> Void
207
201
  *
208
- * Associates an [[EditSession `EditSession`]].
202
+ * Associates the renderer with an [[EditSession `EditSession`]].
209
203
  **/
210
204
  this.setSession = function(session) {
211
205
  this.session = session;
@@ -222,11 +216,11 @@ var VirtualRenderer = function(container, theme) {
222
216
  };
223
217
 
224
218
  /**
225
- * VirtualRenderer.updateLines(firstRow, lastRow) -> Void
226
- * - firstRow (Number): The first row to update
227
- * - lastRow (Number): The last row to update
228
- *
229
219
  * Triggers a partial update of the text, from the range given by the two parameters.
220
+ * @param {Number} firstRow The first row to update
221
+ * @param {Number} lastRow The last row to update
222
+ *
223
+ *
230
224
  **/
231
225
  this.updateLines = function(firstRow, lastRow) {
232
226
  if (lastRow === undefined)
@@ -249,9 +243,12 @@ var VirtualRenderer = function(container, theme) {
249
243
  this.$loop.schedule(this.CHANGE_LINES);
250
244
  };
251
245
 
246
+ this.onChangeTabSize = function() {
247
+ this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);
248
+ this.$textLayer.onChangeTabSize();
249
+ };
250
+
252
251
  /**
253
- * VirtualRenderer.updateText() -> Void
254
- *
255
252
  * Triggers a full update of the text, for all the rows.
256
253
  **/
257
254
  this.updateText = function() {
@@ -259,9 +256,10 @@ var VirtualRenderer = function(container, theme) {
259
256
  };
260
257
 
261
258
  /**
262
- * VirtualRenderer.updateFull() -> Void
263
- *
264
259
  * Triggers a full update of all the layers, for all the rows.
260
+ * @param {Boolean} force If `true`, forces the changes through
261
+ *
262
+ *
265
263
  **/
266
264
  this.updateFull = function(force) {
267
265
  if (force){
@@ -273,8 +271,7 @@ var VirtualRenderer = function(container, theme) {
273
271
  };
274
272
 
275
273
  /**
276
- * VirtualRenderer.updateFontSize() -> Void
277
- *
274
+ *
278
275
  * Updates the font size.
279
276
  **/
280
277
  this.updateFontSize = function() {
@@ -282,10 +279,13 @@ var VirtualRenderer = function(container, theme) {
282
279
  };
283
280
 
284
281
  /**
285
- * VirtualRenderer.onResize(force) -> Void
286
- * - force (Boolean): If `true`, recomputes the size, even if the height and width haven't changed
287
- *
288
282
  * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize}
283
+ * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed
284
+ * @param {Number} gutterWidth The width of the gutter in pixels
285
+ * @param {Number} width The width of the editor in pixels
286
+ * @param {Number} height The hiehgt of the editor, in pixels
287
+ *
288
+ *
289
289
  **/
290
290
  this.onResize = function(force, gutterWidth, width, height) {
291
291
  var changes = this.CHANGE_SIZE;
@@ -337,8 +337,7 @@ var VirtualRenderer = function(container, theme) {
337
337
  };
338
338
 
339
339
  /**
340
- * VirtualRenderer.adjustWrapLimit() -> Void
341
- *
340
+ *
342
341
  * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.
343
342
  **/
344
343
  this.adjustWrapLimit = function() {
@@ -348,10 +347,10 @@ var VirtualRenderer = function(container, theme) {
348
347
  };
349
348
 
350
349
  /**
351
- * VirtualRenderer.setAnimatedScroll(shouldAnimate) -> Void
352
- * - shouldAnimate (Boolean): Set to `true` to show animated scrolls
353
- *
354
350
  * Identifies whether you want to have an animated scroll or not.
351
+ * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls
352
+ *
353
+ *
355
354
  *
356
355
  **/
357
356
  this.setAnimatedScroll = function(shouldAnimate){
@@ -359,19 +358,19 @@ var VirtualRenderer = function(container, theme) {
359
358
  };
360
359
 
361
360
  /**
362
- * VirtualRenderer.getAnimatedScroll() -> Boolean
363
- *
361
+ *
364
362
  * Returns whether an animated scroll happens or not.
363
+ * @returns {Boolean}
365
364
  **/
366
365
  this.getAnimatedScroll = function() {
367
366
  return this.$animatedScroll;
368
367
  };
369
368
 
370
369
  /**
371
- * VirtualRenderer.setShowInvisibles(showInvisibles) -> Void
372
- * - showInvisibles (Boolean): Set to `true` to show invisibles
373
- *
374
370
  * Identifies whether you want to show invisible characters or not.
371
+ * @param {Boolean} showInvisibles Set to `true` to show invisibles
372
+ *
373
+ *
375
374
  *
376
375
  **/
377
376
  this.setShowInvisibles = function(showInvisibles) {
@@ -380,21 +379,30 @@ var VirtualRenderer = function(container, theme) {
380
379
  };
381
380
 
382
381
  /**
383
- * VirtualRenderer.getShowInvisibles() -> Boolean
384
- *
382
+ *
385
383
  * Returns whether invisible characters are being shown or not.
384
+ * @returns {Boolean}
386
385
  **/
387
386
  this.getShowInvisibles = function() {
388
387
  return this.$textLayer.showInvisibles;
389
388
  };
390
389
 
390
+ this.getDisplayIndentGuides = function() {
391
+ return this.$textLayer.displayIndentGuides;
392
+ };
393
+
394
+ this.setDisplayIndentGuides = function(display) {
395
+ if (this.$textLayer.setDisplayIndentGuides(display))
396
+ this.$loop.schedule(this.CHANGE_TEXT);
397
+ };
398
+
391
399
  this.$showPrintMargin = true;
392
400
 
393
401
  /**
394
- * VirtualRenderer.setShowPrintMargin(showPrintMargin)
395
- * - showPrintMargin (Boolean): Set to `true` to show the print margin
396
- *
397
402
  * Identifies whether you want to show the print margin or not.
403
+ * @param {Boolean} showPrintMargin Set to `true` to show the print margin
404
+ *
405
+ *
398
406
  *
399
407
  **/
400
408
  this.setShowPrintMargin = function(showPrintMargin) {
@@ -403,9 +411,8 @@ var VirtualRenderer = function(container, theme) {
403
411
  };
404
412
 
405
413
  /**
406
- * VirtualRenderer.getShowPrintMargin() -> Boolean
407
- *
408
- * Returns whetherthe print margin is being shown or not.
414
+ * Returns whether the print margin is being shown or not.
415
+ * @returns {Boolean}
409
416
  **/
410
417
  this.getShowPrintMargin = function() {
411
418
  return this.$showPrintMargin;
@@ -414,10 +421,10 @@ var VirtualRenderer = function(container, theme) {
414
421
  this.$printMarginColumn = 80;
415
422
 
416
423
  /**
417
- * VirtualRenderer.setPrintMarginColumn(showPrintMargin)
418
- * - showPrintMargin (Boolean): Set to `true` to show the print margin column
419
- *
420
424
  * Identifies whether you want to show the print margin column or not.
425
+ * @param {Boolean} showPrintMargin Set to `true` to show the print margin column
426
+ *
427
+ *
421
428
  *
422
429
  **/
423
430
  this.setPrintMarginColumn = function(showPrintMargin) {
@@ -426,28 +433,28 @@ var VirtualRenderer = function(container, theme) {
426
433
  };
427
434
 
428
435
  /**
429
- * VirtualRenderer.getPrintMarginColumn() -> Boolean
430
- *
436
+ *
431
437
  * Returns whether the print margin column is being shown or not.
438
+ * @returns {Boolean}
432
439
  **/
433
440
  this.getPrintMarginColumn = function() {
434
441
  return this.$printMarginColumn;
435
442
  };
436
443
 
437
444
  /**
438
- * VirtualRenderer.getShowGutter() -> Boolean
439
- *
445
+ *
440
446
  * Returns `true` if the gutter is being shown.
447
+ * @returns {Boolean}
441
448
  **/
442
449
  this.getShowGutter = function(){
443
450
  return this.showGutter;
444
451
  };
445
452
 
446
453
  /**
447
- * VirtualRenderer.setShowGutter(show) -> Void
448
- * - show (Boolean): Set to `true` to show the gutter
449
- *
450
454
  * Identifies whether you want to show the gutter or not.
455
+ * @param {Boolean} show Set to `true` to show the gutter
456
+ *
457
+ *
451
458
  **/
452
459
  this.setShowGutter = function(show){
453
460
  if(this.showGutter === show)
@@ -468,53 +475,45 @@ var VirtualRenderer = function(container, theme) {
468
475
  dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets");
469
476
  };
470
477
 
471
- this.$highlightGutterLine = true;
478
+ this.$highlightGutterLine = false;
472
479
  this.setHighlightGutterLine = function(shouldHighlight) {
473
480
  if (this.$highlightGutterLine == shouldHighlight)
474
481
  return;
475
482
  this.$highlightGutterLine = shouldHighlight;
476
483
 
477
- this.$loop.schedule(this.CHANGE_GUTTER);
484
+ if (!this.$gutterLineHighlight) {
485
+ this.$gutterLineHighlight = dom.createElement("div");
486
+ this.$gutterLineHighlight.className = "ace_gutter-active-line";
487
+ this.$gutter.appendChild(this.$gutterLineHighlight);
488
+ return;
489
+ }
490
+
491
+ this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none";
492
+ // if cursorlayer have never been updated there's nothing on screen to update
493
+ if (this.$cursorLayer.$pixelPos)
494
+ this.$updateGutterLineHighlight();
478
495
  };
479
496
 
480
497
  this.getHighlightGutterLine = function() {
481
498
  return this.$highlightGutterLine;
482
499
  };
483
500
 
484
- this.$updateGutterLineHighlight = function(gutterReady) {
485
- var i = this.session.selection.lead.row;
486
- if (i == this.$gutterLineHighlight)
487
- return;
488
-
489
- if (!gutterReady) {
490
- var lineEl, ch = this.$gutterLayer.element.children;
491
- var index = this.$gutterLineHighlight - this.layerConfig.firstRow;
492
- if (index >= 0 && (lineEl = ch[index]))
493
- dom.removeCssClass(lineEl, "ace_gutter_active_line");
494
-
495
- index = i - this.layerConfig.firstRow;
496
- if (index >= 0 && (lineEl = ch[index]))
497
- dom.addCssClass(lineEl, "ace_gutter_active_line");
498
- }
499
-
500
- this.$gutterLayer.removeGutterDecoration(this.$gutterLineHighlight, "ace_gutter_active_line");
501
- this.$gutterLayer.addGutterDecoration(i, "ace_gutter_active_line");
502
- this.$gutterLineHighlight = i;
501
+ this.$updateGutterLineHighlight = function() {
502
+ this.$gutterLineHighlight.style.top = this.$cursorLayer.$pixelPos.top - this.layerConfig.offset + "px";
503
+ this.$gutterLineHighlight.style.height = this.layerConfig.lineHeight + "px";
503
504
  };
504
505
 
505
506
  this.$updatePrintMargin = function() {
506
- var containerEl;
507
-
508
507
  if (!this.$showPrintMargin && !this.$printMarginEl)
509
508
  return;
510
509
 
511
510
  if (!this.$printMarginEl) {
512
- containerEl = dom.createElement("div");
513
- containerEl.className = "ace_print_margin_layer";
511
+ var containerEl = dom.createElement("div");
512
+ containerEl.className = "ace_layer ace_print-margin-layer";
514
513
  this.$printMarginEl = dom.createElement("div");
515
- this.$printMarginEl.className = "ace_print_margin";
514
+ this.$printMarginEl.className = "ace_print-margin";
516
515
  containerEl.appendChild(this.$printMarginEl);
517
- this.content.insertBefore(containerEl, this.$textLayer.element);
516
+ this.content.insertBefore(containerEl, this.content.firstChild);
518
517
  }
519
518
 
520
519
  var style = this.$printMarginEl.style;
@@ -523,27 +522,27 @@ var VirtualRenderer = function(container, theme) {
523
522
  };
524
523
 
525
524
  /**
526
- * VirtualRenderer.getContainerElement() -> DOMElement
527
- *
525
+ *
528
526
  * Returns the root element containing this renderer.
527
+ * @returns {DOMElement}
529
528
  **/
530
529
  this.getContainerElement = function() {
531
530
  return this.container;
532
531
  };
533
532
 
534
533
  /**
535
- * VirtualRenderer.getMouseEventTarget() -> DOMElement
536
- *
534
+ *
537
535
  * Returns the element that the mouse events are attached to
536
+ * @returns {DOMElement}
538
537
  **/
539
538
  this.getMouseEventTarget = function() {
540
539
  return this.content;
541
540
  };
542
541
 
543
542
  /**
544
- * VirtualRenderer.getTextAreaContainer() -> DOMElement
545
- *
543
+ *
546
544
  * Returns the element to which the hidden text area is added.
545
+ * @returns {DOMElement}
547
546
  **/
548
547
  this.getTextAreaContainer = function() {
549
548
  return this.container;
@@ -579,27 +578,27 @@ var VirtualRenderer = function(container, theme) {
579
578
  };
580
579
 
581
580
  /**
582
- * VirtualRenderer.getFirstVisibleRow() -> Number
583
- *
581
+ *
584
582
  * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow}
583
+ * @returns {Number}
585
584
  **/
586
585
  this.getFirstVisibleRow = function() {
587
586
  return this.layerConfig.firstRow;
588
587
  };
589
588
 
590
589
  /**
591
- * VirtualRenderer.getFirstFullyVisibleRow() -> Number
592
- *
590
+ *
593
591
  * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
592
+ * @returns {Number}
594
593
  **/
595
594
  this.getFirstFullyVisibleRow = function() {
596
595
  return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
597
596
  };
598
597
 
599
598
  /**
600
- * VirtualRenderer.getLastFullyVisibleRow() -> Number
601
- *
599
+ *
602
600
  * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
601
+ * @returns {Number}
603
602
  **/
604
603
  this.getLastFullyVisibleRow = function() {
605
604
  var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
@@ -607,9 +606,9 @@ var VirtualRenderer = function(container, theme) {
607
606
  };
608
607
 
609
608
  /**
610
- * VirtualRenderer.getLastVisibleRow() -> Number
611
- *
609
+ *
612
610
  * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow}
611
+ * @returns {Number}
613
612
  **/
614
613
  this.getLastVisibleRow = function() {
615
614
  return this.layerConfig.lastRow;
@@ -618,10 +617,10 @@ var VirtualRenderer = function(container, theme) {
618
617
  this.$padding = null;
619
618
 
620
619
  /**
621
- * VirtualRenderer.setPadding(padding) -> Void
622
- * - padding (Number): A new padding value (in pixels)
623
- *
624
620
  * Sets the padding for all the layers.
621
+ * @param {Number} padding A new padding value (in pixels)
622
+ *
623
+ *
625
624
  *
626
625
  **/
627
626
  this.setPadding = function(padding) {
@@ -635,19 +634,19 @@ var VirtualRenderer = function(container, theme) {
635
634
  };
636
635
 
637
636
  /**
638
- * VirtualRenderer.getHScrollBarAlwaysVisible() -> Boolean
639
- *
637
+ *
640
638
  * Returns whether the horizontal scrollbar is set to be always visible.
639
+ * @returns {Boolean}
641
640
  **/
642
641
  this.getHScrollBarAlwaysVisible = function() {
643
642
  return this.$horizScrollAlwaysVisible;
644
643
  };
645
644
 
646
645
  /**
647
- * VirtualRenderer.setHScrollBarAlwaysVisible(alwaysVisible) -> Void
648
- * - alwaysVisible (Boolean): Set to `true` to make the horizontal scroll bar visible
649
- *
650
646
  * Identifies whether you want to show the horizontal scrollbar or not.
647
+ * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible
648
+ *
649
+ *
651
650
  **/
652
651
  this.setHScrollBarAlwaysVisible = function(alwaysVisible) {
653
652
  if (this.$horizScrollAlwaysVisible != alwaysVisible) {
@@ -684,7 +683,7 @@ var VirtualRenderer = function(container, theme) {
684
683
  this.scrollLeft = scrollLeft;
685
684
  this.session.setScrollLeft(scrollLeft);
686
685
 
687
- this.scroller.className = this.scrollLeft == 0 ? "ace_scroller" : "ace_scroller horscroll";
686
+ this.scroller.className = this.scrollLeft == 0 ? "ace_scroller" : "ace_scroller ace_scroll-left";
688
687
  }
689
688
 
690
689
  // full
@@ -693,15 +692,13 @@ var VirtualRenderer = function(container, theme) {
693
692
  // update scrollbar first to not lose scroll position when gutter calls resize
694
693
  this.$updateScrollBar();
695
694
  this.$textLayer.update(this.layerConfig);
696
- if (this.showGutter) {
697
- if (this.$highlightGutterLine)
698
- this.$updateGutterLineHighlight(true);
695
+ if (this.showGutter)
699
696
  this.$gutterLayer.update(this.layerConfig);
700
- }
701
697
  this.$markerBack.update(this.layerConfig);
702
698
  this.$markerFront.update(this.layerConfig);
703
699
  this.$cursorLayer.update(this.layerConfig);
704
700
  this.$moveTextAreaToCursor();
701
+ this.$highlightGutterLine && this.$updateGutterLineHighlight();
705
702
  return;
706
703
  }
707
704
 
@@ -713,15 +710,13 @@ var VirtualRenderer = function(container, theme) {
713
710
  else
714
711
  this.$textLayer.scrollLines(this.layerConfig);
715
712
 
716
- if (this.showGutter) {
717
- if (this.$highlightGutterLine)
718
- this.$updateGutterLineHighlight(true);
713
+ if (this.showGutter)
719
714
  this.$gutterLayer.update(this.layerConfig);
720
- }
721
715
  this.$markerBack.update(this.layerConfig);
722
716
  this.$markerFront.update(this.layerConfig);
723
717
  this.$cursorLayer.update(this.layerConfig);
724
718
  this.$moveTextAreaToCursor();
719
+ this.$highlightGutterLine && this.$updateGutterLineHighlight();
725
720
  return;
726
721
  }
727
722
 
@@ -731,12 +726,10 @@ var VirtualRenderer = function(container, theme) {
731
726
  this.$gutterLayer.update(this.layerConfig);
732
727
  }
733
728
  else if (changes & this.CHANGE_LINES) {
734
- if (this.$updateLines()) {
735
- this.$updateScrollBar();
736
- if (this.showGutter)
737
- this.$gutterLayer.update(this.layerConfig);
738
- }
739
- } else if (changes & this.CHANGE_GUTTER) {
729
+ if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.showGutter)
730
+ this.$gutterLayer.update(this.layerConfig);
731
+ }
732
+ else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {
740
733
  if (this.showGutter)
741
734
  this.$gutterLayer.update(this.layerConfig);
742
735
  }
@@ -744,7 +737,7 @@ var VirtualRenderer = function(container, theme) {
744
737
  if (changes & this.CHANGE_CURSOR) {
745
738
  this.$cursorLayer.update(this.layerConfig);
746
739
  this.$moveTextAreaToCursor();
747
- this.$highlightGutterLine && this.$updateGutterLineHighlight(false);
740
+ this.$highlightGutterLine && this.$updateGutterLineHighlight();
748
741
  }
749
742
 
750
743
  if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {
@@ -786,7 +779,7 @@ var VirtualRenderer = function(container, theme) {
786
779
 
787
780
  // Map lines on the screen to lines in the document.
788
781
  var firstRowScreen, firstRowHeight;
789
- var lineHeight = { lineHeight: this.lineHeight };
782
+ var lineHeight = this.lineHeight;
790
783
  firstRow = session.screenToDocumentRow(firstRow, 0);
791
784
 
792
785
  // Check if firstRow is inside of a foldLine. If true, then use the first
@@ -797,13 +790,13 @@ var VirtualRenderer = function(container, theme) {
797
790
  }
798
791
 
799
792
  firstRowScreen = session.documentToScreenRow(firstRow, 0);
800
- firstRowHeight = session.getRowHeight(lineHeight, firstRow);
793
+ firstRowHeight = session.getRowLength(firstRow) * lineHeight;
801
794
 
802
795
  lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);
803
- minHeight = this.$size.scrollerHeight + session.getRowHeight(lineHeight, lastRow)+
796
+ minHeight = this.$size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +
804
797
  firstRowHeight;
805
798
 
806
- offset = this.scrollTop - firstRowScreen * this.lineHeight;
799
+ offset = this.scrollTop - firstRowScreen * lineHeight;
807
800
 
808
801
  this.layerConfig = {
809
802
  width : longestLine,
@@ -811,7 +804,7 @@ var VirtualRenderer = function(container, theme) {
811
804
  firstRow : firstRow,
812
805
  firstRowScreen: firstRowScreen,
813
806
  lastRow : lastRow,
814
- lineHeight : this.lineHeight,
807
+ lineHeight : lineHeight,
815
808
  characterWidth : this.characterWidth,
816
809
  minHeight : minHeight,
817
810
  maxHeight : maxHeight,
@@ -865,8 +858,7 @@ var VirtualRenderer = function(container, theme) {
865
858
  };
866
859
 
867
860
  /**
868
- * VirtualRenderer.updateFrontMarkers() -> Void
869
- *
861
+ *
870
862
  * Schedules an update to all the front markers in the document.
871
863
  **/
872
864
  this.updateFrontMarkers = function() {
@@ -875,8 +867,7 @@ var VirtualRenderer = function(container, theme) {
875
867
  };
876
868
 
877
869
  /**
878
- * VirtualRenderer.updateBackMarkers() -> Void
879
- *
870
+ *
880
871
  * Schedules an update to all the back markers in the document.
881
872
  **/
882
873
  this.updateBackMarkers = function() {
@@ -884,33 +875,25 @@ var VirtualRenderer = function(container, theme) {
884
875
  this.$loop.schedule(this.CHANGE_MARKER_BACK);
885
876
  };
886
877
 
887
- /**
888
- * VirtualRenderer.addGutterDecoration(row, className) -> Void
889
- * - row (Number): The row number
890
- * - className (String): The class to add
891
- *
892
- * Adds `className` to the `row`, to be used for CSS stylings and whatnot.
878
+ /**
879
+ *
880
+ * Deprecated; (moved to [[EditSession]])
881
+ * @deprecated
893
882
  **/
894
883
  this.addGutterDecoration = function(row, className){
895
884
  this.$gutterLayer.addGutterDecoration(row, className);
896
- this.$loop.schedule(this.CHANGE_GUTTER);
897
885
  };
898
886
 
899
- /**
900
- * VirtualRenderer.removeGutterDecoration(row, className)-> Void
901
- * - row (Number): The row number
902
- * - className (String): The class to add
903
- *
904
- * Removes `className` from the `row`.
887
+ /**
888
+ * Deprecated; (moved to [[EditSession]])
889
+ * @deprecated
905
890
  **/
906
891
  this.removeGutterDecoration = function(row, className){
907
892
  this.$gutterLayer.removeGutterDecoration(row, className);
908
- this.$loop.schedule(this.CHANGE_GUTTER);
909
893
  };
910
894
 
911
895
  /**
912
- * VirtualRenderer.updateBreakpoints() -> Void
913
- *
896
+ *
914
897
  * Redraw breakpoints.
915
898
  **/
916
899
  this.updateBreakpoints = function(rows) {
@@ -918,10 +901,11 @@ var VirtualRenderer = function(container, theme) {
918
901
  };
919
902
 
920
903
  /**
921
- * VirtualRenderer.setAnnotations(annotations) -> Void
922
- * - annotations (Array): An array containing annotations
923
- *
904
+ *
924
905
  * Sets annotations for the gutter.
906
+ * @param {Array} annotations An array containing annotations
907
+ *
908
+ *
925
909
  **/
926
910
  this.setAnnotations = function(annotations) {
927
911
  this.$gutterLayer.setAnnotations(annotations);
@@ -929,8 +913,7 @@ var VirtualRenderer = function(container, theme) {
929
913
  };
930
914
 
931
915
  /**
932
- * VirtualRenderer.updateCursor() -> Void
933
- *
916
+ *
934
917
  * Updates the cursor icon.
935
918
  **/
936
919
  this.updateCursor = function() {
@@ -938,8 +921,7 @@ var VirtualRenderer = function(container, theme) {
938
921
  };
939
922
 
940
923
  /**
941
- * VirtualRenderer.hideCursor() -> Void
942
- *
924
+ *
943
925
  * Hides the cursor icon.
944
926
  **/
945
927
  this.hideCursor = function() {
@@ -947,8 +929,7 @@ var VirtualRenderer = function(container, theme) {
947
929
  };
948
930
 
949
931
  /**
950
- * VirtualRenderer.showCursor() -> Void
951
- *
932
+ *
952
933
  * Shows the cursor icon.
953
934
  **/
954
935
  this.showCursor = function() {
@@ -962,8 +943,7 @@ var VirtualRenderer = function(container, theme) {
962
943
  };
963
944
 
964
945
  /**
965
- * VirtualRenderer.scrollCursorIntoView(cursor, offset) -> Void
966
- *
946
+ *
967
947
  * Scrolls the cursor into the first visibile area of the editor
968
948
  **/
969
949
  this.scrollCursorIntoView = function(cursor, offset) {
@@ -997,47 +977,48 @@ var VirtualRenderer = function(container, theme) {
997
977
  }
998
978
  };
999
979
 
1000
- /** related to: EditSession.getScrollTop
1001
- * VirtualRenderer.getScrollTop() -> Number
1002
- *
980
+ /**
1003
981
  * {:EditSession.getScrollTop}
982
+ * @related EditSession.getScrollTop
983
+ * @returns {Number}
1004
984
  **/
1005
985
  this.getScrollTop = function() {
1006
986
  return this.session.getScrollTop();
1007
987
  };
1008
988
 
1009
- /** related to: EditSession.getScrollLeft
1010
- * VirtualRenderer.getScrollLeft() -> Number
1011
- *
989
+ /**
1012
990
  * {:EditSession.getScrollLeft}
991
+ * @related EditSession.getScrollLeft
992
+ * @returns {Number}
1013
993
  **/
1014
994
  this.getScrollLeft = function() {
1015
995
  return this.session.getScrollLeft();
1016
996
  };
1017
997
 
1018
998
  /**
1019
- * VirtualRenderer.getScrollTopRow() -> Number
1020
- *
999
+ *
1021
1000
  * Returns the first visible row, regardless of whether it's fully visible or not.
1001
+ * @returns {Number}
1022
1002
  **/
1023
1003
  this.getScrollTopRow = function() {
1024
1004
  return this.scrollTop / this.lineHeight;
1025
1005
  };
1026
1006
 
1027
1007
  /**
1028
- * VirtualRenderer.getScrollBottomRow() -> Number
1029
- *
1008
+ *
1030
1009
  * Returns the last visible row, regardless of whether it's fully visible or not.
1010
+ * @returns {Number}
1031
1011
  **/
1032
1012
  this.getScrollBottomRow = function() {
1033
1013
  return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
1034
1014
  };
1035
1015
 
1036
- /** related to: EditSession.setScrollTop
1037
- * VirtualRenderer.scrollToRow(row) -> Void
1038
- * - row (Number): A row id
1016
+ /**
1017
+ * Gracefully scrolls from the top of the editor to the row indicated.
1018
+ * @param {Number} row A row id
1039
1019
  *
1040
- * Gracefully scrolls the top of the editor to the row indicated.
1020
+ *
1021
+ * @related EditSession.setScrollTop
1041
1022
  **/
1042
1023
  this.scrollToRow = function(row) {
1043
1024
  this.session.setScrollTop(row * this.lineHeight);
@@ -1048,9 +1029,11 @@ var VirtualRenderer = function(container, theme) {
1048
1029
  cursor = {row: cursor, column: 0};
1049
1030
 
1050
1031
  var pos = this.$cursorLayer.getPixelPosition(cursor);
1051
- var offset = pos.top - this.$size.scrollerHeight * (alignment || 0);
1032
+ var h = this.$size.scrollerHeight - this.lineHeight;
1033
+ var offset = pos.top - h * (alignment || 0);
1052
1034
 
1053
1035
  this.session.setScrollTop(offset);
1036
+ return offset;
1054
1037
  };
1055
1038
 
1056
1039
  this.STEPS = 8;
@@ -1070,13 +1053,13 @@ var VirtualRenderer = function(container, theme) {
1070
1053
  };
1071
1054
 
1072
1055
  /**
1073
- * VirtualRenderer.scrollToLine(line, center, animate, callback) -> Void
1074
- * - line (Number): A line number
1075
- * - center (Boolean): If `true`, centers the editor the to indicated line
1076
- * - animate (Boolean): If `true` animates scrolling
1077
- * - callback (Function): Function to be called after the animation has finished
1078
- *
1079
1056
  * Gracefully scrolls the editor to the row indicated.
1057
+ * @param {Number} line A line number
1058
+ * @param {Boolean} center If `true`, centers the editor the to indicated line
1059
+ * @param {Boolean} animate If `true` animates scrolling
1060
+ * @param {Function} callback Function to be called after the animation has finished
1061
+ *
1062
+ *
1080
1063
  **/
1081
1064
  this.scrollToLine = function(line, center, animate, callback) {
1082
1065
  var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0});
@@ -1120,11 +1103,11 @@ var VirtualRenderer = function(container, theme) {
1120
1103
  };
1121
1104
 
1122
1105
  /**
1123
- * VirtualRenderer.scrollToY(scrollTop) -> Number
1124
- * - scrollTop (Number): The position to scroll to
1125
- *
1126
1106
  * Scrolls the editor to the y pixel indicated.
1107
+ * @param {Number} scrollTop The position to scroll to
1127
1108
  *
1109
+ *
1110
+ * @returns {Number}
1128
1111
  **/
1129
1112
  this.scrollToY = function(scrollTop) {
1130
1113
  // after calling scrollBar.setScrollTop
@@ -1136,11 +1119,11 @@ var VirtualRenderer = function(container, theme) {
1136
1119
  };
1137
1120
 
1138
1121
  /**
1139
- * VirtualRenderer.scrollToX(scrollLeft) -> Number
1140
- * - scrollLeft (Number): The position to scroll to
1141
- *
1142
- * Scrolls the editor to the x pixel indicated.
1122
+ * Scrolls the editor across the x-axis to the pixel indicated.
1123
+ * @param {Number} scrollLeft The position to scroll to
1143
1124
  *
1125
+ *
1126
+ * @returns {Number}
1144
1127
  **/
1145
1128
  this.scrollToX = function(scrollLeft) {
1146
1129
  if (scrollLeft < 0)
@@ -1152,11 +1135,11 @@ var VirtualRenderer = function(container, theme) {
1152
1135
  };
1153
1136
 
1154
1137
  /**
1155
- * VirtualRenderer.scrollBy(deltaX, deltaY) -> Void
1156
- * - deltaX (Number): The x value to scroll by
1157
- * - deltaY (Number): The y value to scroll by
1158
- *
1159
1138
  * Scrolls the editor across both x- and y-axes.
1139
+ * @param {Number} deltaX The x value to scroll by
1140
+ * @param {Number} deltaY The y value to scroll by
1141
+ *
1142
+ *
1160
1143
  **/
1161
1144
  this.scrollBy = function(deltaX, deltaY) {
1162
1145
  deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
@@ -1164,11 +1147,12 @@ var VirtualRenderer = function(container, theme) {
1164
1147
  };
1165
1148
 
1166
1149
  /**
1167
- * VirtualRenderer.isScrollableBy(deltaX, deltaY) -> Boolean
1168
- * - deltaX (Number): The x value to scroll by
1169
- * - deltaY (Number): The y value to scroll by
1170
- *
1171
1150
  * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.
1151
+ * @param {Number} deltaX The x value to scroll by
1152
+ * @param {Number} deltaY The y value to scroll by
1153
+ *
1154
+ *
1155
+ * @returns {Boolean}
1172
1156
  **/
1173
1157
  this.isScrollableBy = function(deltaX, deltaY) {
1174
1158
  if (deltaY < 0 && this.session.getScrollTop() > 0)
@@ -1202,13 +1186,13 @@ var VirtualRenderer = function(container, theme) {
1202
1186
  };
1203
1187
 
1204
1188
  /**
1205
- * VirtualRenderer.textToScreenCoordinates(row, column) -> Object
1206
- * - row (Number): The document row position
1207
- * - column (Number): The document column position
1208
- *
1209
1189
  * Returns an object containing the `pageX` and `pageY` coordinates of the document position.
1190
+ * @param {Number} row The document row position
1191
+ * @param {Number} column The document column position
1210
1192
  *
1193
+ *
1211
1194
  *
1195
+ * @returns {Object}
1212
1196
  **/
1213
1197
  this.textToScreenCoordinates = function(row, column) {
1214
1198
  var canvasPos = this.scroller.getBoundingClientRect();
@@ -1224,8 +1208,7 @@ var VirtualRenderer = function(container, theme) {
1224
1208
  };
1225
1209
 
1226
1210
  /**
1227
- * VirtualRenderer.visualizeFocus() -> Void
1228
- *
1211
+ *
1229
1212
  * Focuses the current container.
1230
1213
  **/
1231
1214
  this.visualizeFocus = function() {
@@ -1233,18 +1216,17 @@ var VirtualRenderer = function(container, theme) {
1233
1216
  };
1234
1217
 
1235
1218
  /**
1236
- * VirtualRenderer.visualizeBlur() -> Void
1237
- *
1219
+ *
1238
1220
  * Blurs the current container.
1239
1221
  **/
1240
1222
  this.visualizeBlur = function() {
1241
1223
  dom.removeCssClass(this.container, "ace_focus");
1242
1224
  };
1243
1225
 
1244
- /** internal, hide
1245
- * VirtualRenderer.showComposition(position) -> Void
1246
- * - position (Number):
1226
+ /**
1227
+ * @param {Number} position
1247
1228
  *
1229
+ * @private
1248
1230
  **/
1249
1231
  this.showComposition = function(position) {
1250
1232
  if (!this.$composition)
@@ -1260,8 +1242,7 @@ var VirtualRenderer = function(container, theme) {
1260
1242
  };
1261
1243
 
1262
1244
  /**
1263
- * VirtualRenderer.setCompositionText(text) -> Void
1264
- * - text (String): A string of text to use
1245
+ * @param {String} text A string of text to use
1265
1246
  *
1266
1247
  * Sets the inner text of the current composition to `text`.
1267
1248
  **/
@@ -1270,8 +1251,7 @@ var VirtualRenderer = function(container, theme) {
1270
1251
  };
1271
1252
 
1272
1253
  /**
1273
- * VirtualRenderer.hideComposition() -> Void
1274
- *
1254
+ *
1275
1255
  * Hides the current composition.
1276
1256
  **/
1277
1257
  this.hideComposition = function() {
@@ -1288,16 +1268,14 @@ var VirtualRenderer = function(container, theme) {
1288
1268
  if (!config.get("packaged"))
1289
1269
  return callback();
1290
1270
 
1291
- var base = name.split("/").pop();
1292
- var filename = config.get("themePath") + "/theme-" + base + config.get("suffix");
1293
- net.loadScript(filename, callback);
1271
+ net.loadScript(config.moduleUrl(name, "theme"), callback);
1294
1272
  };
1295
1273
 
1296
1274
  /**
1297
- * VirtualRenderer.setTheme(theme) -> Void
1298
- * - theme (String): The path to a theme
1299
- *
1300
1275
  * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme}
1276
+ * @param {String} theme The path to a theme
1277
+ *
1278
+ *
1301
1279
  **/
1302
1280
  this.setTheme = function(theme) {
1303
1281
  var _self = this;
@@ -1332,18 +1310,19 @@ var VirtualRenderer = function(container, theme) {
1332
1310
  _self.container.ownerDocument
1333
1311
  );
1334
1312
 
1335
- if (_self.$theme)
1336
- dom.removeCssClass(_self.container, _self.$theme);
1313
+ if (_self.theme)
1314
+ dom.removeCssClass(_self.container, _self.theme.cssClass);
1337
1315
 
1338
- _self.$theme = theme ? theme.cssClass : null;
1316
+ // this is kept only for backwards compatibility
1317
+ _self.$theme = theme.cssClass;
1339
1318
 
1340
- if (_self.$theme)
1341
- dom.addCssClass(_self.container, _self.$theme);
1319
+ _self.theme = theme;
1320
+ dom.addCssClass(_self.container, theme.cssClass);
1321
+ dom.setCssClass(_self.container, "ace_dark", theme.isDark);
1342
1322
 
1343
- if (theme && theme.isDark)
1344
- dom.addCssClass(_self.container, "ace_dark");
1345
- else
1346
- dom.removeCssClass(_self.container, "ace_dark");
1323
+ var padding = theme.padding || 4;
1324
+ if (_self.$padding && padding != _self.$padding)
1325
+ _self.setPadding(padding);
1347
1326
 
1348
1327
  // force re-measure of the gutter width
1349
1328
  if (_self.$size) {
@@ -1354,9 +1333,8 @@ var VirtualRenderer = function(container, theme) {
1354
1333
  };
1355
1334
 
1356
1335
  /**
1357
- * VirtualRenderer.getTheme() -> String
1358
- *
1359
1336
  * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme}
1337
+ * @returns {String}
1360
1338
  **/
1361
1339
  this.getTheme = function() {
1362
1340
  return this.$themeValue;
@@ -1367,28 +1345,27 @@ var VirtualRenderer = function(container, theme) {
1367
1345
  // a certain mode that editor is in.
1368
1346
 
1369
1347
  /**
1370
- * VirtualRenderer.setStyle(style) -> Void
1371
- * - style (String): A class name
1372
- *
1373
1348
  * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle}
1349
+ * @param {String} style A class name
1350
+ *
1351
+ *
1374
1352
  **/
1375
- this.setStyle = function setStyle(style) {
1376
- dom.addCssClass(this.container, style);
1353
+ this.setStyle = function setStyle(style, include) {
1354
+ dom.setCssClass(this.container, style, include != false);
1377
1355
  };
1378
1356
 
1379
1357
  /**
1380
- * VirtualRenderer.unsetStyle(style) -> Void
1381
- * - style (String): A class name
1382
- *
1383
1358
  * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle}
1359
+ * @param {String} style A class name
1360
+ *
1361
+ *
1384
1362
  **/
1385
1363
  this.unsetStyle = function unsetStyle(style) {
1386
- dom.removeCssClass(this.container, style);
1364
+ dom.removeCssClass(this.container, style);
1387
1365
  };
1388
1366
 
1389
1367
  /**
1390
- * VirtualRenderer.destroy()
1391
- *
1368
+ *
1392
1369
  * Destroys the text and cursor layers for this renderer.
1393
1370
  **/
1394
1371
  this.destroy = function() {