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
@@ -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 AT ajax DOT 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
 
@@ -49,7 +39,6 @@ var useragent = require("./lib/useragent");
49
39
  var TextInput = require("./keyboard/textinput").TextInput;
50
40
  var MouseHandler = require("./mouse/mouse_handler").MouseHandler;
51
41
  var FoldHandler = require("./mouse/fold_handler").FoldHandler;
52
- //var TouchHandler = require("./touch_handler").TouchHandler;
53
42
  var KeyBinding = require("./keyboard/keybinding").KeyBinding;
54
43
  var EditSession = require("./edit_session").EditSession;
55
44
  var Search = require("./search").Search;
@@ -59,19 +48,24 @@ var CommandManager = require("./commands/command_manager").CommandManager;
59
48
  var defaultCommands = require("./commands/default_commands").commands;
60
49
 
61
50
  /**
62
- * class Editor
63
51
  *
64
- * The main entry point into the Ace functionality. The `Editor` manages the `EditSession` (which manages `Document`s), as well as the `VirtualRenderer`, which draws everything to the screen. Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them.
65
52
  *
53
+ * The main entry point into the Ace functionality.
54
+ *
55
+ * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen.
56
+ *
57
+ * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them.
58
+ * @class Editor
66
59
  **/
67
60
 
68
61
  /**
69
- * new Editor(renderer, session)
70
- * - renderer (VirtualRenderer): Associated `VirtualRenderer` that draws everything
71
- * - session (EditSession): The `EditSession` to refer to
72
- *
73
62
  * Creates a new `Editor` object.
74
63
  *
64
+ * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything
65
+ * @param {EditSession} session The `EditSession` to refer to
66
+ *
67
+ *
68
+ * @constructor
75
69
  **/
76
70
  var Editor = function(renderer, session) {
77
71
  var container = renderer.getContainerElement();
@@ -84,12 +78,8 @@ var Editor = function(renderer, session) {
84
78
  this.keyBinding = new KeyBinding(this);
85
79
 
86
80
  // TODO detect touch event support
87
- if (useragent.isIPad) {
88
- //this.$mouseHandler = new TouchHandler(this);
89
- } else {
90
- this.$mouseHandler = new MouseHandler(this);
91
- new FoldHandler(this);
92
- }
81
+ this.$mouseHandler = new MouseHandler(this);
82
+ new FoldHandler(this);
93
83
 
94
84
  this.$blockScrolling = 0;
95
85
  this.$search = new Search().set({
@@ -104,28 +94,38 @@ var Editor = function(renderer, session) {
104
94
  oop.implement(this, EventEmitter);
105
95
 
106
96
  /**
107
- * Editor.setKeyboardHandler(keyboardHandler)
97
+ * Sets a new key handler, such as "vim" or "windows".
98
+ * @param {String} keyboardHandler The new key handler
99
+ *
108
100
  *
109
- * Sets a new keyboard handler.
110
101
  **/
111
102
  this.setKeyboardHandler = function(keyboardHandler) {
112
103
  this.keyBinding.setKeyboardHandler(keyboardHandler);
113
104
  };
114
105
 
115
- /** related to: KeyBinding
116
- * Editor.getKeyboardHandler() -> String
106
+ /**
107
+ * Returns the keyboard handler, such as "vim" or "windows".
108
+ *
109
+ * @returns {String}
117
110
  *
118
- * Returns the keyboard handler.
119
111
  **/
120
112
  this.getKeyboardHandler = function() {
121
113
  return this.keyBinding.getKeyboardHandler();
122
114
  };
123
115
 
116
+
124
117
  /**
125
- * Editor.setSession(session)
126
- * - session (EditSession): The new session to use
118
+ * Emitted whenever the [[EditSession]] changes.
119
+ * @event changeSession
120
+ * @param {Object} e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s.
121
+ *
127
122
  *
123
+ **/
124
+ /**
128
125
  * Sets a new editsession to use. This method also emits the `'changeSession'` event.
126
+ * @param {EditSession} session The new session to use
127
+ *
128
+ *
129
129
  **/
130
130
  this.setSession = function(session) {
131
131
  if (this.session == session)
@@ -165,7 +165,7 @@ var Editor = function(renderer, session) {
165
165
  this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);
166
166
  session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
167
167
 
168
- this.$onChangeTabSize = this.renderer.updateText.bind(this.renderer);
168
+ this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);
169
169
  session.addEventListener("changeTabSize", this.$onChangeTabSize);
170
170
 
171
171
  this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);
@@ -227,20 +227,22 @@ var Editor = function(renderer, session) {
227
227
  };
228
228
 
229
229
  /**
230
- * Editor.getSession() -> EditSession
231
- *
232
230
  * Returns the current session being used.
231
+ * @returns {EditSession}
233
232
  **/
234
233
  this.getSession = function() {
235
234
  return this.session;
236
235
  };
237
236
 
238
- /** related to: Document.setValue
239
- * Editor.setValue(val [,dontSelect]) -> String
240
- * - val (String): The new value to set for the document
241
- * - cursorPos (number): 0: selectAll, -1 document start, 1 end
242
- *
237
+ /**
243
238
  * Sets the current document to `val`.
239
+ * @param {String} val The new value to set for the document
240
+ * @param {Number} cursorPos Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end
241
+ *
242
+ *
243
+ *
244
+ * @returns {String} The current document value
245
+ * @related Document.setValue
244
246
  **/
245
247
  this.setValue = function(val, cursorPos) {
246
248
  this.session.doc.setValue(val);
@@ -255,84 +257,86 @@ var Editor = function(renderer, session) {
255
257
  return val;
256
258
  };
257
259
 
258
- /** related to: EditSession.getValue
259
- * Editor.getValue() -> String
260
- *
260
+ /**
261
261
  * Returns the current session's content.
262
+ *
263
+ * @returns {String}
264
+ * @related EditSession.getValue
262
265
  **/
263
266
  this.getValue = function() {
264
267
  return this.session.getValue();
265
268
  };
266
269
 
267
270
  /**
268
- * Editor.getSelection() -> String
269
271
  *
270
272
  * Returns the currently highlighted selection.
273
+ * @returns {String} The highlighted selection
271
274
  **/
272
275
  this.getSelection = function() {
273
276
  return this.selection;
274
277
  };
275
278
 
276
- /** related to: VirtualRenderer.onResize
277
- * Editor.resize()
278
- *
279
+ /**
279
280
  * {:VirtualRenderer.onResize}
281
+ * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed
282
+ *
283
+ *
284
+ * @related VirtualRenderer.onResize
280
285
  **/
281
286
  this.resize = function(force) {
282
287
  this.renderer.onResize(force);
283
288
  };
284
289
 
285
290
  /**
286
- * Editor.setTheme(theme)
287
- *
288
291
  * {:VirtualRenderer.setTheme}
292
+ * @param {String} theme The path to a theme
293
+ *
294
+ *
289
295
  **/
290
296
  this.setTheme = function(theme) {
291
297
  this.renderer.setTheme(theme);
292
298
  };
293
299
 
294
- /** related to: VirtualRenderer.getTheme
295
- * Editor.getTheme() -> String
296
- *
300
+ /**
297
301
  * {:VirtualRenderer.getTheme}
302
+ *
303
+ * @returns {String} The set theme
304
+ * @related VirtualRenderer.getTheme
298
305
  **/
299
306
  this.getTheme = function() {
300
307
  return this.renderer.getTheme();
301
308
  };
302
309
 
303
- /** related to: VirtualRenderer.setStyle
304
- * Editor.setStyle(style)
305
- *
310
+ /**
306
311
  * {:VirtualRenderer.setStyle}
312
+ * @param {String} style A class name
313
+ *
314
+ *
315
+ * @related VirtualRenderer.setStyle
307
316
  **/
308
317
  this.setStyle = function(style) {
309
318
  this.renderer.setStyle(style);
310
319
  };
311
320
 
312
- /** related to: VirtualRenderer.unsetStyle
313
- * Editor.unsetStyle(style)
314
- *
321
+ /**
315
322
  * {:VirtualRenderer.unsetStyle}
323
+ * @related VirtualRenderer.unsetStyle
316
324
  **/
317
325
  this.unsetStyle = function(style) {
318
326
  this.renderer.unsetStyle(style);
319
327
  };
320
328
 
321
329
  /**
322
- * Editor.setFontSize(size)
323
- * - size (Number): A font size
324
- *
325
330
  * Set a new font size (in pixels) for the editor text.
331
+ * @param {Number} size A font size
332
+ *
333
+ *
326
334
  **/
327
335
  this.setFontSize = function(size) {
328
336
  this.container.style.fontSize = size;
329
337
  this.renderer.updateFontSize();
330
338
  };
331
339
 
332
- /** internal, hide
333
- * Editor.$highlightBrackets()
334
- *
335
- **/
336
340
  this.$highlightBrackets = function() {
337
341
  if (this.session.$bracketHighlight) {
338
342
  this.session.removeMarker(this.session.$bracketHighlight);
@@ -354,11 +358,10 @@ var Editor = function(renderer, session) {
354
358
  var range = new Range(pos.row, pos.column, pos.row, pos.column+1);
355
359
  self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket", "text");
356
360
  }
357
- }, 10);
361
+ }, 50);
358
362
  };
359
363
 
360
364
  /**
361
- * Editor.focus()
362
365
  *
363
366
  * Brings the current `textInput` into focus.
364
367
  **/
@@ -374,16 +377,14 @@ var Editor = function(renderer, session) {
374
377
  };
375
378
 
376
379
  /**
377
- * Editor.isFocused() -> Boolean
378
- *
379
- * Returns true if the current `textInput` is in focus.
380
+ * Returns `true` if the current `textInput` is in focus.
381
+ * @return Boolean
380
382
  **/
381
383
  this.isFocused = function() {
382
384
  return this.textInput.isFocused();
383
385
  };
384
386
 
385
387
  /**
386
- * Editor.blur()
387
388
  *
388
389
  * Blurs the current `textInput`.
389
390
  **/
@@ -392,9 +393,10 @@ var Editor = function(renderer, session) {
392
393
  };
393
394
 
394
395
  /**
395
- * Editor@onFocus()
396
- *
397
396
  * Emitted once the editor comes into focus.
397
+ * @event focus
398
+ *
399
+ *
398
400
  **/
399
401
  this.onFocus = function() {
400
402
  if (this.$isFocused)
@@ -406,9 +408,10 @@ var Editor = function(renderer, session) {
406
408
  };
407
409
 
408
410
  /**
409
- * Editor@onBlur()
410
- *
411
411
  * Emitted once the editor has been blurred.
412
+ * @event blur
413
+ *
414
+ *
412
415
  **/
413
416
  this.onBlur = function() {
414
417
  if (!this.$isFocused)
@@ -424,10 +427,11 @@ var Editor = function(renderer, session) {
424
427
  };
425
428
 
426
429
  /**
427
- * Editor@onDocumentChange(e)
428
- * - e (Object): Contains a single property, `data`, which has the delta of changes
429
- *
430
430
  * Emitted whenever the document is changed.
431
+ * @event change
432
+ * @param {Object} e Contains a single property, `data`, which has the delta of changes
433
+ *
434
+ *
431
435
  *
432
436
  **/
433
437
  this.onDocumentChange = function(e) {
@@ -447,39 +451,23 @@ var Editor = function(renderer, session) {
447
451
  this.$cursorChange();
448
452
  };
449
453
 
450
- /**
451
- * Editor@onTokenizerUpdate(e)
452
- * - e (Object): Contains a single property, `data`, which indicates the changed rows
453
- *
454
- * Emitted when the a tokenizer is updated.
455
- **/
456
454
  this.onTokenizerUpdate = function(e) {
457
455
  var rows = e.data;
458
456
  this.renderer.updateLines(rows.first, rows.last);
459
457
  };
460
458
 
461
- /**
462
- * Editor@onScrollTopChange()
463
- *
464
- * Emitted when the scroll top changes.
465
- **/
459
+
466
460
  this.onScrollTopChange = function() {
467
461
  this.renderer.scrollToY(this.session.getScrollTop());
468
462
  };
469
-
470
- /**
471
- * Editor@onScrollLeftChange()
472
- *
473
- * Emitted when the scroll left changes.
474
- **/
463
+
475
464
  this.onScrollLeftChange = function() {
476
465
  this.renderer.scrollToX(this.session.getScrollLeft());
477
466
  };
478
467
 
479
468
  /**
480
- * Editor@onCursorChange()
469
+ * Emitted when the selection changes.
481
470
  *
482
- * Emitted when the cursor changes.
483
471
  **/
484
472
  this.onCursorChange = function() {
485
473
  this.$cursorChange();
@@ -490,44 +478,30 @@ var Editor = function(renderer, session) {
490
478
 
491
479
  this.$highlightBrackets();
492
480
  this.$updateHighlightActiveLine();
481
+ this._emit("changeSelection");
493
482
  };
494
483
 
495
- /** internal, hide
496
- * Editor.$updateHighlightActiveLine()
497
- *
498
- *
499
- **/
500
484
  this.$updateHighlightActiveLine = function() {
501
485
  var session = this.getSession();
502
486
 
503
- if (session.$highlightLineMarker)
504
- session.removeMarker(session.$highlightLineMarker);
505
-
506
- session.$highlightLineMarker = null;
507
-
487
+ var highlight;
508
488
  if (this.$highlightActiveLine) {
509
- var cursor = this.getCursorPosition();
510
- var foldLine = this.session.getFoldLine(cursor.row);
489
+ if ((this.$selectionStyle != "line" || !this.selection.isMultiLine()))
490
+ highlight = this.getCursorPosition();
491
+ }
511
492
 
512
- if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) {
513
- var range;
514
- if (foldLine) {
515
- range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0);
516
- } else {
517
- range = new Range(cursor.row, 0, cursor.row+1, 0);
518
- }
519
- session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background");
520
- }
493
+ if (session.$highlightLineMarker && !highlight) {
494
+ session.removeMarker(session.$highlightLineMarker.id);
495
+ session.$highlightLineMarker = null;
496
+ } else if (!session.$highlightLineMarker && highlight) {
497
+ session.$highlightLineMarker = session.highlightLines(highlight.row, highlight.row, "ace_active-line");
498
+ } else if (highlight) {
499
+ session.$highlightLineMarker.start.row = highlight.row;
500
+ session.$highlightLineMarker.end.row = highlight.row;
501
+ session._emit("changeBackMarker");
521
502
  }
522
503
  };
523
504
 
524
-
525
- /**
526
- * Editor@onSelectionChange(e)
527
- * - e (Object): Contains a single property, `data`, which has the delta of changes
528
- *
529
- * Emitted when a selection has changed.
530
- **/
531
505
  this.onSelectionChange = function(e) {
532
506
  var session = this.session;
533
507
 
@@ -546,6 +520,8 @@ var Editor = function(renderer, session) {
546
520
 
547
521
  var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()
548
522
  this.session.highlight(re);
523
+
524
+ this._emit("changeSelection");
549
525
  };
550
526
 
551
527
  this.$getSelectionHighLightRegexp = function() {
@@ -580,74 +556,39 @@ var Editor = function(renderer, session) {
580
556
  return re;
581
557
  };
582
558
 
583
- /**
584
- * Editor@onChangeFrontMarker()
585
- *
586
- * Emitted when a front marker changes.
587
- **/
559
+
588
560
  this.onChangeFrontMarker = function() {
589
561
  this.renderer.updateFrontMarkers();
590
562
  };
591
563
 
592
- /**
593
- * Editor@onChangeBackMarker()
594
- *
595
- * Emitted when a back marker changes.
596
- **/
597
564
  this.onChangeBackMarker = function() {
598
565
  this.renderer.updateBackMarkers();
599
566
  };
600
567
 
601
- /**
602
- * Editor@onChangeBreakpoint()
603
- *
604
- * Emitted when a breakpoint changes.
605
- **/
568
+
606
569
  this.onChangeBreakpoint = function() {
607
570
  this.renderer.updateBreakpoints();
608
571
  };
609
572
 
610
- /**
611
- * Editor@onChangeAnnotation()
612
- *
613
- * Emitted when an annotation changes.
614
- **/
615
573
  this.onChangeAnnotation = function() {
616
574
  this.renderer.setAnnotations(this.session.getAnnotations());
617
575
  };
618
576
 
619
- /**
620
- * Editor@onChangeMode()
621
- *
622
- * Emitted when the mode changes.
623
- **/
577
+
624
578
  this.onChangeMode = function() {
625
579
  this.renderer.updateText();
626
580
  };
627
581
 
628
- /**
629
- * Editor@onChangeWrapLimit()
630
- *
631
- * Emitted when the wrap limit changes.
632
- **/
582
+
633
583
  this.onChangeWrapLimit = function() {
634
584
  this.renderer.updateFull();
635
585
  };
636
586
 
637
- /**
638
- * Editor@onChangeWrapMode()
639
- *
640
- * Emitted when the wrap mode changes.
641
- **/
642
587
  this.onChangeWrapMode = function() {
643
588
  this.renderer.onResize(true);
644
589
  };
645
590
 
646
- /**
647
- * Editor@onChangeFold()
648
- *
649
- * Emitted when the code folds change.
650
- **/
591
+
651
592
  this.onChangeFold = function() {
652
593
  // Update the active line marker as due to folding changes the current
653
594
  // line range on the screen might have changed.
@@ -657,10 +598,18 @@ var Editor = function(renderer, session) {
657
598
  };
658
599
 
659
600
  /**
660
- * Editor.getCopyText() -> String
601
+ * Emitted when text is copied.
602
+ * @event copy
603
+ * @param {String} text The copied text
604
+ *
661
605
  *
606
+ **/
607
+ /**
608
+ *
662
609
  * Returns the string of text currently highlighted.
610
+ * @returns {String}
663
611
  **/
612
+
664
613
  this.getCopyText = function() {
665
614
  var text = "";
666
615
  if (!this.selection.isEmpty())
@@ -671,8 +620,6 @@ var Editor = function(renderer, session) {
671
620
  };
672
621
 
673
622
  /**
674
- * Editor.onCopy()
675
- *
676
623
  * Called whenever a text "copy" happens.
677
624
  **/
678
625
  this.onCopy = function() {
@@ -680,34 +627,47 @@ var Editor = function(renderer, session) {
680
627
  };
681
628
 
682
629
  /**
683
- * Editor.onCut()
684
- *
685
- * called whenever a text "cut" happens.
630
+ * Called whenever a text "cut" happens.
686
631
  **/
687
632
  this.onCut = function() {
688
633
  this.commands.exec("cut", this);
689
634
  };
690
635
 
691
636
  /**
692
- * Editor.onPaste()
693
- *
694
- * called whenever a text "paste" happens.
637
+ * Emitted when text is pasted.
638
+ * @event paste
639
+ * @param {String} text The pasted text
640
+ *
641
+ *
642
+ **/
643
+ /**
644
+ * Called whenever a text "paste" happens.
645
+ * @param {String} text The pasted text
646
+ *
647
+ *
695
648
  **/
696
649
  this.onPaste = function(text) {
650
+ // todo this should change when paste becomes a command
651
+ if (this.$readOnly)
652
+ return;
697
653
  this._emit("paste", text);
698
654
  this.insert(text);
699
655
  };
700
656
 
657
+
658
+ this.execCommand = function(command, args) {
659
+ this.commands.exec(command, this, args);
660
+ };
661
+
701
662
  /**
702
- * Editor.insert(text)
703
- * - text (String): The new text to add
704
- *
705
663
  * Inserts `text` into wherever the cursor is pointing.
664
+ * @param {String} text The new text to add
665
+ *
666
+ *
706
667
  **/
707
668
  this.insert = function(text) {
708
669
  var session = this.session;
709
670
  var mode = session.getMode();
710
-
711
671
  var cursor = this.getCursorPosition();
712
672
 
713
673
  if (this.getBehavioursEnabled()) {
@@ -734,9 +694,8 @@ var Editor = function(renderer, session) {
734
694
 
735
695
  var start = cursor.column;
736
696
  var lineState = session.getState(cursor.row);
737
- var shouldOutdent = mode.checkOutdent(lineState, session.getLine(cursor.row), text);
738
697
  var line = session.getLine(cursor.row);
739
- var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());
698
+ var shouldOutdent = mode.checkOutdent(lineState, line, text);
740
699
  var end = session.insert(cursor, text);
741
700
 
742
701
  if (transform && transform.selection) {
@@ -753,12 +712,12 @@ var Editor = function(renderer, session) {
753
712
  }
754
713
  }
755
714
 
756
- var lineState = session.getState(cursor.row);
757
-
758
715
  // TODO disabled multiline auto indent
759
716
  // possibly doing the indent before inserting the text
760
717
  // if (cursor.row !== end.row) {
761
718
  if (session.getDocument().isNewLine(text)) {
719
+ var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());
720
+
762
721
  this.moveCursorTo(cursor.row+1, 0);
763
722
 
764
723
  var size = session.getTabSize();
@@ -796,60 +755,47 @@ var Editor = function(renderer, session) {
796
755
  mode.autoOutdent(lineState, session, cursor.row);
797
756
  };
798
757
 
799
- /**
800
- * Editor@onTextInput(text, pasted)
801
- * - text (String): The text entered
802
- * - pasted (Boolean): Identifies whether the text was pasted (`true`) or not
803
- *
804
- * Emitted when text is entered.
805
- **/
806
758
  this.onTextInput = function(text) {
807
759
  this.keyBinding.onTextInput(text);
808
760
  };
809
761
 
810
- /**
811
- * Editor@onCommandKey(e, hashId, keyCode)
812
- *
813
- * Emitted when the command-key is pressed.
814
- **/
815
762
  this.onCommandKey = function(e, hashId, keyCode) {
816
763
  this.keyBinding.onCommandKey(e, hashId, keyCode);
817
764
  };
818
765
 
819
- /** related to: EditSession.setOverwrite
820
- * Editor.setOverwrite(overwrite)
821
- * - overwrite (Boolean): Defines wheter or not to set overwrites
822
- *
766
+ /**
823
767
  * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event.
768
+ * @param {Boolean} overwrite Defines wheter or not to set overwrites
769
+ *
824
770
  *
771
+ * @related EditSession.setOverwrite
825
772
  **/
826
773
  this.setOverwrite = function(overwrite) {
827
774
  this.session.setOverwrite(overwrite);
828
775
  };
829
776
 
830
- /** related to: EditSession.getOverwrite
831
- * Editor.getOverwrite() -> Boolean
832
- *
777
+ /**
833
778
  * Returns `true` if overwrites are enabled; `false` otherwise.
779
+ * @returns {Boolean}
780
+ * @related EditSession.getOverwrite
834
781
  **/
835
782
  this.getOverwrite = function() {
836
783
  return this.session.getOverwrite();
837
784
  };
838
785
 
839
- /** related to: EditSession.toggleOverwrite
840
- * Editor.toggleOverwrite()
841
- *
786
+ /**
842
787
  * Sets the value of overwrite to the opposite of whatever it currently is.
788
+ * @related EditSession.toggleOverwrite
843
789
  **/
844
790
  this.toggleOverwrite = function() {
845
791
  this.session.toggleOverwrite();
846
792
  };
847
793
 
848
794
  /**
849
- * Editor.setScrollSpeed(speed)
850
- * - speed (Number): A value indicating the new speed
851
- *
852
795
  * Sets how fast the mouse scrolling should do.
796
+ * @param {Number} speed A value indicating the new speed
797
+ *
798
+ *
853
799
  *
854
800
  **/
855
801
  this.setScrollSpeed = function(speed) {
@@ -857,19 +803,18 @@ var Editor = function(renderer, session) {
857
803
  };
858
804
 
859
805
  /**
860
- * Editor.getScrollSpeed() -> Number
861
- *
862
806
  * Returns the value indicating how fast the mouse scroll speed is.
807
+ * @returns {Number}
863
808
  **/
864
809
  this.getScrollSpeed = function() {
865
810
  return this.$mouseHandler.getScrollSpeed();
866
811
  };
867
812
 
868
813
  /**
869
- * Editor.setDragDelay(dragDelay)
870
- * - dragDelay (Number): A value indicating the new delay
871
- *
872
814
  * Sets the delay (in milliseconds) of the mouse drag.
815
+ * @param {Number} dragDelay A value indicating the new delay
816
+ *
817
+ *
873
818
  *
874
819
  **/
875
820
  this.setDragDelay = function(dragDelay) {
@@ -877,20 +822,30 @@ var Editor = function(renderer, session) {
877
822
  };
878
823
 
879
824
  /**
880
- * Editor.getDragDelay() -> Number
881
- *
882
825
  * Returns the current mouse drag delay.
826
+ * @returns {Number}
883
827
  **/
884
828
  this.getDragDelay = function() {
885
829
  return this.$mouseHandler.getDragDelay();
886
830
  };
887
831
 
888
832
  this.$selectionStyle = "line";
833
+
889
834
  /**
890
- * Editor.setSelectionStyle(style)
891
- * - style (String): The new selection style
835
+ * Emitted when the selection style changes, via [[Editor.setSelectionStyle]].
836
+ * @event changeSelectionStyle
837
+ * @param {Object} data Contains one property, `data`, which indicates the new selection style
838
+ *
839
+ *
840
+ *
841
+ **/
842
+ /**
843
+ * Indicates how selections should occur.
844
+ *
845
+ * By default, selections are set to "line". This function also emits the `'changeSelectionStyle'` event.
846
+ *
847
+ * @param {String} style The new selection style
892
848
  *
893
- * Indicates how selections should occur. By default, selections are set to "line". This function also emits the `'changeSelectionStyle'` event.
894
849
  *
895
850
  **/
896
851
  this.setSelectionStyle = function(style) {
@@ -902,9 +857,8 @@ var Editor = function(renderer, session) {
902
857
  };
903
858
 
904
859
  /**
905
- * Editor.getSelectionStyle() -> String
906
- *
907
860
  * Returns the current selection style.
861
+ * @returns {String}
908
862
  **/
909
863
  this.getSelectionStyle = function() {
910
864
  return this.$selectionStyle;
@@ -913,10 +867,10 @@ var Editor = function(renderer, session) {
913
867
  this.$highlightActiveLine = true;
914
868
 
915
869
  /**
916
- * Editor.setHighlightActiveLine(shouldHighlight)
917
- * - shouldHighlight (Boolean): Set to `true` to highlight the current line
918
- *
919
870
  * Determines whether or not the current line should be highlighted.
871
+ * @param {Boolean} shouldHighlight Set to `true` to highlight the current line
872
+ *
873
+ *
920
874
  *
921
875
  **/
922
876
  this.setHighlightActiveLine = function(shouldHighlight) {
@@ -928,9 +882,8 @@ var Editor = function(renderer, session) {
928
882
  };
929
883
 
930
884
  /**
931
- * Editor.getHighlightActiveLine() -> Boolean
932
- *
933
885
  * Returns `true` if current lines are always highlighted.
886
+ * @return Boolean
934
887
  **/
935
888
  this.getHighlightActiveLine = function() {
936
889
  return this.$highlightActiveLine;
@@ -951,10 +904,10 @@ var Editor = function(renderer, session) {
951
904
 
952
905
  this.$highlightSelectedWord = true;
953
906
  /**
954
- * Editor.setHighlightSelectedWord(shouldHighlight)
955
- * - shouldHighlight (Boolean): Set to `true` to highlight the currently selected word
956
- *
957
907
  * Determines if the currently selected word should be highlighted.
908
+ * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word
909
+ *
910
+ *
958
911
  **/
959
912
  this.setHighlightSelectedWord = function(shouldHighlight) {
960
913
  if (this.$highlightSelectedWord == shouldHighlight)
@@ -965,9 +918,8 @@ var Editor = function(renderer, session) {
965
918
  };
966
919
 
967
920
  /**
968
- * Editor.getHighlightSelectedWord() -> Boolean
969
- *
970
921
  * Returns `true` if currently highlighted words are to be highlighted.
922
+ * @returns {Boolean}
971
923
  **/
972
924
  this.getHighlightSelectedWord = function() {
973
925
  return this.$highlightSelectedWord;
@@ -982,51 +934,54 @@ var Editor = function(renderer, session) {
982
934
  };
983
935
 
984
936
  /**
985
- * Editor.setShowInvisibles(showInvisibles)
986
- * - showInvisibles (Boolean): Specifies whether or not to show invisible characters
987
- *
988
937
  * If `showInvisibiles` is set to `true`, invisible characters&mdash;like spaces or new lines&mdash;are show in the editor.
938
+ * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters
939
+ *
940
+ *
989
941
  **/
990
942
  this.setShowInvisibles = function(showInvisibles) {
991
- if (this.getShowInvisibles() == showInvisibles)
992
- return;
993
-
994
943
  this.renderer.setShowInvisibles(showInvisibles);
995
944
  };
996
945
 
997
946
  /**
998
- * Editor.getShowInvisibles() -> Boolean
999
- *
1000
947
  * Returns `true` if invisible characters are being shown.
948
+ * @returns {Boolean}
1001
949
  **/
1002
950
  this.getShowInvisibles = function() {
1003
951
  return this.renderer.getShowInvisibles();
1004
952
  };
1005
953
 
954
+ this.setDisplayIndentGuides = function(display) {
955
+ this.renderer.setDisplayIndentGuides(display);
956
+ };
957
+
958
+ this.getDisplayIndentGuides = function() {
959
+ return this.renderer.getDisplayIndentGuides();
960
+ };
961
+
1006
962
  /**
1007
- * Editor.setShowPrintMargin(showPrintMargin)
1008
- * - showPrintMargin (Boolean): Specifies whether or not to show the print margin
1009
- *
1010
963
  * If `showPrintMargin` is set to `true`, the print margin is shown in the editor.
964
+ * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin
965
+ *
966
+ *
1011
967
  **/
1012
968
  this.setShowPrintMargin = function(showPrintMargin) {
1013
969
  this.renderer.setShowPrintMargin(showPrintMargin);
1014
970
  };
1015
971
 
1016
972
  /**
1017
- * Editor.getShowPrintMargin() -> Boolean
1018
- *
1019
973
  * Returns `true` if the print margin is being shown.
974
+ * @returns {Boolean}
1020
975
  **/
1021
976
  this.getShowPrintMargin = function() {
1022
977
  return this.renderer.getShowPrintMargin();
1023
978
  };
1024
979
 
1025
980
  /**
1026
- * Editor.setPrintMarginColumn(showPrintMargin)
1027
- * - showPrintMargin (Number): Specifies the new print margin
1028
- *
1029
981
  * Sets the column defining where the print margin should be.
982
+ * @param {Number} showPrintMargin Specifies the new print margin
983
+ *
984
+ *
1030
985
  *
1031
986
  **/
1032
987
  this.setPrintMarginColumn = function(showPrintMargin) {
@@ -1034,9 +989,8 @@ var Editor = function(renderer, session) {
1034
989
  };
1035
990
 
1036
991
  /**
1037
- * Editor.getPrintMarginColumn() -> Number
1038
- *
1039
992
  * Returns the column number of where the print margin is.
993
+ * @returns {Number}
1040
994
  **/
1041
995
  this.getPrintMarginColumn = function() {
1042
996
  return this.renderer.getPrintMarginColumn();
@@ -1044,19 +998,18 @@ var Editor = function(renderer, session) {
1044
998
 
1045
999
  this.$readOnly = false;
1046
1000
  /**
1047
- * Editor.setReadOnly(readOnly)
1048
- * - readOnly (Boolean): Specifies whether the editor can be modified or not
1049
- *
1050
1001
  * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change.
1002
+ * @param {Boolean} readOnly Specifies whether the editor can be modified or not
1003
+ *
1004
+ *
1051
1005
  **/
1052
1006
  this.setReadOnly = function(readOnly) {
1053
1007
  this.$readOnly = readOnly;
1054
1008
  };
1055
1009
 
1056
1010
  /**
1057
- * Editor.getReadOnly() -> Boolean
1058
- *
1059
1011
  * Returns `true` if the editor is set to read-only mode.
1012
+ * @returns {Boolean}
1060
1013
  **/
1061
1014
  this.getReadOnly = function() {
1062
1015
  return this.$readOnly;
@@ -1065,29 +1018,49 @@ var Editor = function(renderer, session) {
1065
1018
  this.$modeBehaviours = true;
1066
1019
 
1067
1020
  /**
1068
- * Editor.setBehavioursEnabled()
1069
- * - enabled (Boolean): Enables or disables behaviors
1070
- *
1071
1021
  * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef}
1022
+ * @param {Boolean} enabled Enables or disables behaviors
1023
+ *
1024
+ *
1072
1025
  **/
1073
1026
  this.setBehavioursEnabled = function (enabled) {
1074
1027
  this.$modeBehaviours = enabled;
1075
1028
  };
1076
1029
 
1077
1030
  /**
1078
- * Editor.getBehavioursEnabled() -> Boolean
1079
- *
1080
1031
  * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef}
1032
+ *
1033
+ * @returns {Boolean}
1081
1034
  **/
1082
1035
  this.getBehavioursEnabled = function () {
1083
1036
  return this.$modeBehaviours;
1084
1037
  };
1085
1038
 
1039
+ this.$modeWrapBehaviours = true;
1040
+
1086
1041
  /**
1087
- * Editor.setShowFoldWidgets(show)
1088
- * - show (Boolean): Specifies whether the fold widgets are shown
1042
+ * Editor.setWrapBehavioursEnabled(enabled)
1043
+ * - enabled (Boolean): Enables or disables wrapping behaviors
1089
1044
  *
1045
+ * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets
1046
+ * when such a character is typed in.
1047
+ **/
1048
+ this.setWrapBehavioursEnabled = function (enabled) {
1049
+ this.$modeWrapBehaviours = enabled;
1050
+ };
1051
+
1052
+ /**
1053
+ * Returns `true` if the wrapping behaviors are currently enabled.
1054
+ **/
1055
+ this.getWrapBehavioursEnabled = function () {
1056
+ return this.$modeWrapBehaviours;
1057
+ };
1058
+
1059
+ /**
1090
1060
  * Indicates whether the fold widgets are shown or not.
1061
+ * @param {Boolean} show Specifies whether the fold widgets are shown
1062
+ *
1063
+ *
1091
1064
  **/
1092
1065
  this.setShowFoldWidgets = function(show) {
1093
1066
  var gutter = this.renderer.$gutterLayer;
@@ -1100,9 +1073,8 @@ var Editor = function(renderer, session) {
1100
1073
  };
1101
1074
 
1102
1075
  /**
1103
- * Editor.getShowFoldWidgets() -> Boolean
1104
- *
1105
1076
  * Returns `true` if the fold widgets are shown.
1077
+ * @return Boolean
1106
1078
  **/
1107
1079
  this.getShowFoldWidgets = function() {
1108
1080
  return this.renderer.$gutterLayer.getShowFoldWidgets();
@@ -1117,10 +1089,10 @@ var Editor = function(renderer, session) {
1117
1089
  };
1118
1090
 
1119
1091
  /**
1120
- * Editor.remove(dir)
1121
- * - dir (String): The direction of the deletion to occur, either "left" or "right"
1122
- *
1123
1092
  * Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.
1093
+ * @param {String} dir The direction of the deletion to occur, either "left" or "right"
1094
+ *
1095
+ *
1124
1096
  *
1125
1097
  **/
1126
1098
  this.remove = function(dir) {
@@ -1145,8 +1117,6 @@ var Editor = function(renderer, session) {
1145
1117
  };
1146
1118
 
1147
1119
  /**
1148
- * Editor.removeWordRight()
1149
- *
1150
1120
  * Removes the word directly to the right of the current selection.
1151
1121
  **/
1152
1122
  this.removeWordRight = function() {
@@ -1158,8 +1128,6 @@ var Editor = function(renderer, session) {
1158
1128
  };
1159
1129
 
1160
1130
  /**
1161
- * Editor.removeWordLeft()
1162
- *
1163
1131
  * Removes the word directly to the left of the current selection.
1164
1132
  **/
1165
1133
  this.removeWordLeft = function() {
@@ -1171,8 +1139,6 @@ var Editor = function(renderer, session) {
1171
1139
  };
1172
1140
 
1173
1141
  /**
1174
- * Editor.removeToLineStart()
1175
- *
1176
1142
  * Removes all the words to the left of the current selection, until the start of the line.
1177
1143
  **/
1178
1144
  this.removeToLineStart = function() {
@@ -1184,8 +1150,6 @@ var Editor = function(renderer, session) {
1184
1150
  };
1185
1151
 
1186
1152
  /**
1187
- * Editor.removeToLineEnd()
1188
- *
1189
1153
  * Removes all the words to the right of the current selection, until the end of the line.
1190
1154
  **/
1191
1155
  this.removeToLineEnd = function() {
@@ -1203,8 +1167,6 @@ var Editor = function(renderer, session) {
1203
1167
  };
1204
1168
 
1205
1169
  /**
1206
- * Editor.splitLine()
1207
- *
1208
1170
  * Splits the line at the current selection (by inserting an `'\n'`).
1209
1171
  **/
1210
1172
  this.splitLine = function() {
@@ -1219,8 +1181,6 @@ var Editor = function(renderer, session) {
1219
1181
  };
1220
1182
 
1221
1183
  /**
1222
- * Editor.transposeLetters()
1223
- *
1224
1184
  * Transposes current line.
1225
1185
  **/
1226
1186
  this.transposeLetters = function() {
@@ -1247,8 +1207,6 @@ var Editor = function(renderer, session) {
1247
1207
  };
1248
1208
 
1249
1209
  /**
1250
- * Editor.toLowerCase()
1251
- *
1252
1210
  * Converts the current selection entirely into lowercase.
1253
1211
  **/
1254
1212
  this.toLowerCase = function() {
@@ -1264,8 +1222,6 @@ var Editor = function(renderer, session) {
1264
1222
  };
1265
1223
 
1266
1224
  /**
1267
- * Editor.toUpperCase()
1268
- *
1269
1225
  * Converts the current selection entirely into uppercase.
1270
1226
  **/
1271
1227
  this.toUpperCase = function() {
@@ -1280,10 +1236,10 @@ var Editor = function(renderer, session) {
1280
1236
  this.selection.setSelectionRange(originalRange);
1281
1237
  };
1282
1238
 
1283
- /** related to: EditSession.indentRows
1284
- * Editor.indent()
1285
- *
1239
+ /**
1286
1240
  * Indents the current line.
1241
+ *
1242
+ * @related EditSession.indentRows
1287
1243
  **/
1288
1244
  this.indent = function() {
1289
1245
  var session = this.session;
@@ -1308,20 +1264,43 @@ var Editor = function(renderer, session) {
1308
1264
  }
1309
1265
  };
1310
1266
 
1311
- /** related to: EditSession.outdentRows
1312
- * Editor.blockOutdent()
1313
- *
1267
+ /**
1314
1268
  * Outdents the current line.
1269
+ * @related EditSession.outdentRows
1315
1270
  **/
1316
1271
  this.blockOutdent = function() {
1317
1272
  var selection = this.session.getSelection();
1318
1273
  this.session.outdentRows(selection.getRange());
1319
1274
  };
1320
1275
 
1276
+ // TODO: move out of core when we have good mechanism for managing extensions
1277
+ this.sortLines = function() {
1278
+ var rows = this.$getSelectedRows();
1279
+ var session = this.session;
1280
+
1281
+ var lines = [];
1282
+ for (i = rows.first; i <= rows.last; i++)
1283
+ lines.push(session.getLine(i));
1284
+
1285
+ lines.sort(function(a, b) {
1286
+ if (a.toLowerCase() < b.toLowerCase()) return -1;
1287
+ if (a.toLowerCase() > b.toLowerCase()) return 1;
1288
+ return 0;
1289
+ });
1290
+
1291
+ var deleteRange = new Range(0, 0, 0, 0);
1292
+ for (var i = rows.first; i <= rows.last; i++) {
1293
+ var line = session.getLine(i);
1294
+ deleteRange.start.row = i;
1295
+ deleteRange.end.row = i;
1296
+ deleteRange.end.column = line.length;
1297
+ session.replace(deleteRange, lines[i-rows.first]);
1298
+ }
1299
+ };
1300
+
1321
1301
  /**
1322
- * Editor.toggleCommentLines()
1323
1302
  *
1324
- * Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not).
1303
+ * Given the currently selected range, this function either comments all the lines, or uncomments all of them.
1325
1304
  **/
1326
1305
  this.toggleCommentLines = function() {
1327
1306
  var state = this.session.getState(this.getCursorPosition().row);
@@ -1329,10 +1308,81 @@ var Editor = function(renderer, session) {
1329
1308
  this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);
1330
1309
  };
1331
1310
 
1332
- /** related to: EditSession.remove
1333
- * Editor.removeLines()
1334
- *
1311
+ /**
1312
+ * Works like [[EditSession.getTokenAt]], except it returns a number.
1313
+ * @returns {Number}
1314
+ **/
1315
+ this.getNumberAt = function( row, column ) {
1316
+ var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g
1317
+ _numberRx.lastIndex = 0
1318
+
1319
+ var s = this.session.getLine(row)
1320
+ while(_numberRx.lastIndex < column - 1 ){
1321
+ var m = _numberRx.exec(s)
1322
+ if(m.index <= column && m.index+m[0].length >= column){
1323
+ var number = {
1324
+ value: m[0],
1325
+ start: m.index,
1326
+ end: m.index+m[0].length
1327
+
1328
+ }
1329
+ return number
1330
+ }
1331
+ }
1332
+ return null;
1333
+ };
1334
+
1335
+ /**
1336
+ * Editor.modifyNumber(amount)
1337
+ * @param {Number} amount The value to change the numeral by (can be negative to decrease value)
1338
+ *
1339
+ * If the character before the cursor is a number, this functions changes its value by `amount`.
1340
+ **/
1341
+ this.modifyNumber = function(amount) {
1342
+ var row = this.selection.getCursor().row;
1343
+ var column = this.selection.getCursor().column;
1344
+
1345
+ // get the char before the cursor
1346
+ var charRange = new Range(row, column-1, row, column);
1347
+
1348
+ var c = this.session.getTextRange(charRange);
1349
+ // if the char is a digit
1350
+ if (!isNaN(parseFloat(c)) && isFinite(c)) {
1351
+ // get the whole number the digit is part of
1352
+ var nr = this.getNumberAt(row, column);
1353
+ // if number found
1354
+ if (nr) {
1355
+ var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end;
1356
+ var decimals = nr.start + nr.value.length - fp;
1357
+
1358
+ var t = parseFloat(nr.value);
1359
+ t *= Math.pow(10, decimals);
1360
+
1361
+
1362
+ if(fp !== nr.end && column < fp){
1363
+ amount *= Math.pow(10, nr.end - column - 1);
1364
+ } else {
1365
+ amount *= Math.pow(10, nr.end - column);
1366
+ }
1367
+
1368
+ t += amount;
1369
+ t /= Math.pow(10, decimals);
1370
+ var nnr = t.toFixed(decimals);
1371
+
1372
+ //update number
1373
+ var replaceRange = new Range(row, nr.start, row, nr.end);
1374
+ this.session.replace(replaceRange, nnr);
1375
+
1376
+ //reposition the cursor
1377
+ this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length));
1378
+
1379
+ }
1380
+ }
1381
+ };
1382
+
1383
+ /**
1335
1384
  * Removes all the lines in the current selection
1385
+ * @related EditSession.remove
1336
1386
  **/
1337
1387
  this.removeLines = function() {
1338
1388
  var rows = this.$getSelectedRows();
@@ -1350,30 +1400,27 @@ var Editor = function(renderer, session) {
1350
1400
 
1351
1401
  this.duplicateSelection = function() {
1352
1402
  var sel = this.selection;
1353
- var doc = this.session;
1354
- var range = sel.getRange();
1355
- if (range.isEmpty()) {
1356
- var row = range.start.row;
1357
- doc.duplicateLines(row, row);
1358
- } else {
1359
- var reverse = sel.isBackwards()
1360
- var point = sel.isBackwards() ? range.start : range.end;
1361
- var endPoint = doc.insert(point, doc.getTextRange(range), false);
1362
- range.start = point;
1363
- range.end = endPoint;
1364
-
1365
- sel.setSelectionRange(range, reverse)
1366
- }
1403
+ var doc = this.session;
1404
+ var range = sel.getRange();
1405
+ if (range.isEmpty()) {
1406
+ var row = range.start.row;
1407
+ doc.duplicateLines(row, row);
1408
+ } else {
1409
+ var reverse = sel.isBackwards()
1410
+ var point = sel.isBackwards() ? range.start : range.end;
1411
+ var endPoint = doc.insert(point, doc.getTextRange(range), false);
1412
+ range.start = point;
1413
+ range.end = endPoint;
1414
+
1415
+ sel.setSelectionRange(range, reverse)
1416
+ }
1367
1417
  };
1368
1418
 
1369
- /** related to: EditSession.moveLinesDown
1370
- * Editor.moveLinesDown() -> Number
1371
- * + (Number): On success, it returns -1.
1372
- *
1419
+ /**
1373
1420
  * Shifts all the selected lines down one row.
1374
1421
  *
1375
- *
1376
- *
1422
+ * @returns {Number} On success, it returns -1.
1423
+ * @related EditSession.moveLinesUp
1377
1424
  **/
1378
1425
  this.moveLinesDown = function() {
1379
1426
  this.$moveLines(function(firstRow, lastRow) {
@@ -1381,13 +1428,10 @@ var Editor = function(renderer, session) {
1381
1428
  });
1382
1429
  };
1383
1430
 
1384
- /** related to: EditSession.moveLinesUp
1385
- * Editor.moveLinesUp() -> Number
1386
- * + (Number): On success, it returns -1.
1387
- *
1431
+ /**
1388
1432
  * Shifts all the selected lines up one row.
1389
- *
1390
- *
1433
+ * @returns {Number} On success, it returns -1.
1434
+ * @related EditSession.moveLinesDown
1391
1435
  **/
1392
1436
  this.moveLinesUp = function() {
1393
1437
  this.$moveLines(function(firstRow, lastRow) {
@@ -1395,17 +1439,16 @@ var Editor = function(renderer, session) {
1395
1439
  });
1396
1440
  };
1397
1441
 
1398
- /** related to: EditSession.moveText
1399
- * Editor.moveText(fromRange, toPosition) -> Range
1400
- * - fromRange (Range): The range of text you want moved within the document
1401
- * - toPosition (Object): The location (row and column) where you want to move the text to
1402
- * + (Range): The new range where the text was moved to.
1403
- *
1442
+ /**
1404
1443
  * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this:
1405
- *
1444
+ * ```json
1406
1445
  * { row: newRowLocation, column: newColumnLocation }
1446
+ * ```
1447
+ * @param {Range} fromRange The range of text you want moved within the document
1448
+ * @param {Object} toPosition The location (row and column) where you want to move the text to
1407
1449
  *
1408
- *
1450
+ * @returns {Range} The new range where the text was moved to.
1451
+ * @related EditSession.moveText
1409
1452
  **/
1410
1453
  this.moveText = function(range, toPosition) {
1411
1454
  if (this.$readOnly)
@@ -1414,12 +1457,9 @@ var Editor = function(renderer, session) {
1414
1457
  return this.session.moveText(range, toPosition);
1415
1458
  };
1416
1459
 
1417
- /** related to: EditSession.duplicateLines
1418
- * Editor.copyLinesUp() -> Number
1419
- * + (Number): On success, returns 0.
1420
- *
1460
+ /**
1421
1461
  * Copies all the selected lines up one row.
1422
- *
1462
+ * @returns {Number} On success, returns 0.
1423
1463
  *
1424
1464
  **/
1425
1465
  this.copyLinesUp = function() {
@@ -1429,13 +1469,10 @@ var Editor = function(renderer, session) {
1429
1469
  });
1430
1470
  };
1431
1471
 
1432
- /** related to: EditSession.duplicateLines
1433
- * Editor.copyLinesDown() -> Number
1434
- * + (Number): On success, returns the number of new rows added; in other words, `lastRow - firstRow + 1`.
1435
- *
1472
+ /**
1436
1473
  * Copies all the selected lines down one row.
1437
- *
1438
- *
1474
+ * @returns {Number} On success, returns the number of new rows added; in other words, `lastRow - firstRow + 1`.
1475
+ * @related EditSession.duplicateLines
1439
1476
  *
1440
1477
  **/
1441
1478
  this.copyLinesDown = function() {
@@ -1446,10 +1483,9 @@ var Editor = function(renderer, session) {
1446
1483
 
1447
1484
 
1448
1485
  /**
1449
- * Editor.$moveLines(mover)
1450
- * - mover (Function): A method to call on each selected row
1451
- *
1452
1486
  * Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them.
1487
+ * @param {Function} mover A method to call on each selected row
1488
+ *
1453
1489
  *
1454
1490
  **/
1455
1491
  this.$moveLines = function(mover) {
@@ -1476,12 +1512,11 @@ var Editor = function(renderer, session) {
1476
1512
  };
1477
1513
 
1478
1514
  /**
1479
- * Editor.$getSelectedRows() -> Object
1480
- *
1481
1515
  * Returns an object indicating the currently selected rows. The object looks like this:
1482
- *
1516
+ * ```json
1483
1517
  * { first: range.start.row, last: range.end.row }
1484
- *
1518
+ * ```
1519
+ * @returns {Object}
1485
1520
  **/
1486
1521
  this.$getSelectedRows = function() {
1487
1522
  var range = this.getSelectionRange().collapseRows();
@@ -1492,77 +1527,60 @@ var Editor = function(renderer, session) {
1492
1527
  };
1493
1528
  };
1494
1529
 
1495
- /** internal, hide
1496
- * Editor@onCompositionStart(text)
1497
- * - text (String): The text being written
1498
- *
1499
- *
1500
- **/
1501
1530
  this.onCompositionStart = function(text) {
1502
1531
  this.renderer.showComposition(this.getCursorPosition());
1503
1532
  };
1504
1533
 
1505
- /** internal, hide
1506
- * Editor@onCompositionUpdate(text)
1507
- * - text (String): The text being written
1508
- *
1509
- *
1510
- **/
1511
1534
  this.onCompositionUpdate = function(text) {
1512
1535
  this.renderer.setCompositionText(text);
1513
1536
  };
1514
1537
 
1515
- /** internal, hide
1516
- * Editor@onCompositionEnd()
1517
- *
1518
- *
1519
- **/
1520
1538
  this.onCompositionEnd = function() {
1521
1539
  this.renderer.hideComposition();
1522
1540
  };
1523
1541
 
1524
- /** related to: VirtualRenderer.getFirstVisibleRow
1525
- * Editor.getFirstVisibleRow() -> Number
1526
- *
1542
+ /**
1527
1543
  * {:VirtualRenderer.getFirstVisibleRow}
1544
+ * @returns {Number}
1545
+ * @related VirtualRenderer.getFirstVisibleRow
1528
1546
  **/
1529
1547
  this.getFirstVisibleRow = function() {
1530
1548
  return this.renderer.getFirstVisibleRow();
1531
1549
  };
1532
1550
 
1533
- /** related to: VirtualRenderer.getLastVisibleRow
1534
- * Editor.getLastVisibleRow() -> Number
1535
- *
1551
+ /**
1536
1552
  * {:VirtualRenderer.getLastVisibleRow}
1553
+ * @returns {Number}
1554
+ * @related VirtualRenderer.getLastVisibleRow
1537
1555
  **/
1538
1556
  this.getLastVisibleRow = function() {
1539
1557
  return this.renderer.getLastVisibleRow();
1540
1558
  };
1541
1559
 
1542
1560
  /**
1543
- * Editor.isRowVisible(row) -> Boolean
1544
- * - row (Number): The row to check
1545
- *
1546
1561
  * Indicates if the row is currently visible on the screen.
1562
+ * @param {Number} row The row to check
1563
+ *
1564
+ * @returns {Boolean}
1547
1565
  **/
1548
1566
  this.isRowVisible = function(row) {
1549
1567
  return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
1550
1568
  };
1551
1569
 
1552
1570
  /**
1553
- * Editor.isRowFullyVisible(row) -> Boolean
1554
- * - row (Number): The row to check
1555
- *
1556
1571
  * Indicates if the entire row is currently visible on the screen.
1572
+ * @param {Number} row The row to check
1573
+ *
1574
+ *
1575
+ * @returns {Boolean}
1557
1576
  **/
1558
1577
  this.isRowFullyVisible = function(row) {
1559
1578
  return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());
1560
1579
  };
1561
1580
 
1562
1581
  /**
1563
- * Editor.$getVisibleRowCount() -> Number
1564
- *
1565
1582
  * Returns the number of currently visibile rows.
1583
+ * @returns {Number}
1566
1584
  **/
1567
1585
  this.$getVisibleRowCount = function() {
1568
1586
  return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
@@ -1594,8 +1612,6 @@ var Editor = function(renderer, session) {
1594
1612
  };
1595
1613
 
1596
1614
  /**
1597
- * Editor.selectPageDown()
1598
- *
1599
1615
  * Selects the text from the current position of the document until where a "page down" finishes.
1600
1616
  **/
1601
1617
  this.selectPageDown = function() {
@@ -1603,8 +1619,6 @@ var Editor = function(renderer, session) {
1603
1619
  };
1604
1620
 
1605
1621
  /**
1606
- * Editor.selectPageUp()
1607
- *
1608
1622
  * Selects the text from the current position of the document until where a "page up" finishes.
1609
1623
  **/
1610
1624
  this.selectPageUp = function() {
@@ -1612,8 +1626,6 @@ var Editor = function(renderer, session) {
1612
1626
  };
1613
1627
 
1614
1628
  /**
1615
- * Editor.gotoPageDown()
1616
- *
1617
1629
  * Shifts the document to wherever "page down" is, as well as moving the cursor position.
1618
1630
  **/
1619
1631
  this.gotoPageDown = function() {
@@ -1621,8 +1633,6 @@ var Editor = function(renderer, session) {
1621
1633
  };
1622
1634
 
1623
1635
  /**
1624
- * Editor.gotoPageUp()
1625
- *
1626
1636
  * Shifts the document to wherever "page up" is, as well as moving the cursor position.
1627
1637
  **/
1628
1638
  this.gotoPageUp = function() {
@@ -1630,8 +1640,6 @@ var Editor = function(renderer, session) {
1630
1640
  };
1631
1641
 
1632
1642
  /**
1633
- * Editor.scrollPageDown()
1634
- *
1635
1643
  * Scrolls the document to wherever "page down" is, without changing the cursor position.
1636
1644
  **/
1637
1645
  this.scrollPageDown = function() {
@@ -1639,41 +1647,35 @@ var Editor = function(renderer, session) {
1639
1647
  };
1640
1648
 
1641
1649
  /**
1642
- * Editor.scrollPageUp()
1643
- *
1644
1650
  * Scrolls the document to wherever "page up" is, without changing the cursor position.
1645
1651
  **/
1646
1652
  this.scrollPageUp = function() {
1647
1653
  this.$moveByPage(-1);
1648
1654
  };
1649
1655
 
1650
- /** related to: VirtualRenderer.scrollToRow
1651
- * Editor.scrollToRow(row)
1652
- * - row (Number): The row to move to
1653
- *
1656
+ /**
1654
1657
  * Moves the editor to the specified row.
1655
- *
1658
+ * @related VirtualRenderer.scrollToRow
1656
1659
  **/
1657
1660
  this.scrollToRow = function(row) {
1658
1661
  this.renderer.scrollToRow(row);
1659
1662
  };
1660
1663
 
1661
- /** related to: VirtualRenderer.scrollToLine
1662
- * Editor.scrollToLine(line, center)
1663
- * - line (Number): The line to scroll to
1664
- * - center (Boolean): If `true`
1665
- * - animate (Boolean): If `true` animates scrolling
1666
- * - callback (Function): Function to be called when the animation has finished
1664
+ /**
1665
+ * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to).
1666
+ * @param {Number} line The line to scroll to
1667
+ * @param {Boolean} center If `true`
1668
+ * @param {Boolean} animate If `true` animates scrolling
1669
+ * @param {Function} callback Function to be called when the animation has finished
1667
1670
  *
1668
- * TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to)
1671
+ *
1672
+ * @related VirtualRenderer.scrollToLine
1669
1673
  **/
1670
1674
  this.scrollToLine = function(line, center, animate, callback) {
1671
1675
  this.renderer.scrollToLine(line, center, animate, callback);
1672
1676
  };
1673
1677
 
1674
1678
  /**
1675
- * Editor.centerSelection()
1676
- *
1677
1679
  * Attempts to center the current selection on the screen.
1678
1680
  **/
1679
1681
  this.centerSelection = function() {
@@ -1685,43 +1687,41 @@ var Editor = function(renderer, session) {
1685
1687
  this.renderer.alignCursor(pos, 0.5);
1686
1688
  };
1687
1689
 
1688
- /** related to: Selection.getCursor
1689
- * Editor.getCursorPosition() -> Object
1690
- * + (Object): This returns an object that looks something like this:<br/>
1691
- * ```{ row: currRow, column: currCol }```
1692
- *
1690
+ /**
1693
1691
  * Gets the current position of the cursor.
1692
+ * @returns {Object} An object that looks something like this:
1693
+ * ```json
1694
+ * { row: currRow, column: currCol }
1695
+ * ```
1694
1696
  *
1695
- *
1696
- *
1697
+ * @related Selection.getCursor
1697
1698
  **/
1698
1699
  this.getCursorPosition = function() {
1699
1700
  return this.selection.getCursor();
1700
1701
  };
1701
1702
 
1702
- /** related to: EditSession.documentToScreenPosition
1703
- * Editor.getCursorPositionScreen() -> Number
1704
- *
1703
+ /**
1705
1704
  * Returns the screen position of the cursor.
1705
+ * @returns {Number}
1706
+ * @related EditSession.documentToScreenPosition
1706
1707
  **/
1707
1708
  this.getCursorPositionScreen = function() {
1708
1709
  return this.session.documentToScreenPosition(this.getCursorPosition());
1709
1710
  };
1710
1711
 
1711
- /** related to: Selection.getRange
1712
- * Editor.getSelectionRange() -> Range
1713
- *
1712
+ /**
1714
1713
  * {:Selection.getRange}
1714
+ * @returns {Range}
1715
+ * @related Selection.getRange
1715
1716
  **/
1716
1717
  this.getSelectionRange = function() {
1717
1718
  return this.selection.getRange();
1718
1719
  };
1719
1720
 
1720
1721
 
1721
- /** related to: Selection.selectAll
1722
- * Editor.selectAll()
1723
- *
1722
+ /**
1724
1723
  * Selects all the text in editor.
1724
+ * @related Selection.selectAll
1725
1725
  **/
1726
1726
  this.selectAll = function() {
1727
1727
  this.$blockScrolling += 1;
@@ -1729,41 +1729,38 @@ var Editor = function(renderer, session) {
1729
1729
  this.$blockScrolling -= 1;
1730
1730
  };
1731
1731
 
1732
- /** related to: Selection.clearSelection
1733
- * Editor.clearSelection()
1734
- *
1732
+ /**
1735
1733
  * {:Selection.clearSelection}
1734
+ * @related Selection.clearSelection
1736
1735
  **/
1737
1736
  this.clearSelection = function() {
1738
1737
  this.selection.clearSelection();
1739
1738
  };
1740
1739
 
1741
- /** related to: Selection.moveCursorTo
1742
- * Editor.moveCursorTo(row, column)
1743
- * - row (Number): The new row number
1744
- * - column (Number): The new column number
1745
- *
1740
+ /**
1746
1741
  * Moves the cursor to the specified row and column. Note that this does not de-select the current selection.
1742
+ * @param {Number} row The new row number
1743
+ * @param {Number} column The new column number
1744
+ *
1747
1745
  *
1746
+ * @related Selection.moveCursorTo
1748
1747
  **/
1749
1748
  this.moveCursorTo = function(row, column) {
1750
1749
  this.selection.moveCursorTo(row, column);
1751
1750
  };
1752
1751
 
1753
- /** related to: Selection.moveCursorToPosition
1754
- * Editor.moveCursorToPosition(pos)
1755
- * - pos (Object): An object with two properties, row and column
1756
- *
1752
+ /**
1757
1753
  * Moves the cursor to the position indicated by `pos.row` and `pos.column`.
1754
+ * @param {Object} pos An object with two properties, row and column
1755
+ *
1758
1756
  *
1757
+ * @related Selection.moveCursorToPosition
1759
1758
  **/
1760
1759
  this.moveCursorToPosition = function(pos) {
1761
1760
  this.selection.moveCursorToPosition(pos);
1762
1761
  };
1763
1762
 
1764
1763
  /**
1765
- * Editor.jumpToMatching()
1766
- *
1767
1764
  * Moves the cursor's row and column to the next matching bracket.
1768
1765
  *
1769
1766
  **/
@@ -1799,12 +1796,10 @@ var Editor = function(renderer, session) {
1799
1796
  };
1800
1797
 
1801
1798
  /**
1802
- * Editor.gotoLine(lineNumber, column)
1803
- * - lineNumber (Number): The line number to go to
1804
- * - column (Number): A column number to go to
1805
- * - animate (Boolean): If `true` animates scolling
1806
- *
1807
1799
  * Moves the cursor to the specified line number, and also into the indiciated column.
1800
+ * @param {Number} lineNumber The line number to go to
1801
+ * @param {Number} column A column number to go to
1802
+ * @param {Boolean} animate If `true` animates scolling
1808
1803
  *
1809
1804
  **/
1810
1805
  this.gotoLine = function(lineNumber, column, animate) {
@@ -1819,13 +1814,13 @@ var Editor = function(renderer, session) {
1819
1814
  this.scrollToLine(lineNumber - 1, true, animate);
1820
1815
  };
1821
1816
 
1822
- /** related to: Editor.moveCursorTo
1823
- * Editor.navigateTo(row, column)
1824
- * - row (Number): The new row number
1825
- * - column (Number): The new column number
1826
- *
1817
+ /**
1827
1818
  * Moves the cursor to the specified row and column. Note that this does de-select the current selection.
1819
+ * @param {Number} row The new row number
1820
+ * @param {Number} column The new column number
1821
+ *
1828
1822
  *
1823
+ * @related Editor.moveCursorTo
1829
1824
  **/
1830
1825
  this.navigateTo = function(row, column) {
1831
1826
  this.clearSelection();
@@ -1833,10 +1828,10 @@ var Editor = function(renderer, session) {
1833
1828
  };
1834
1829
 
1835
1830
  /**
1836
- * Editor.navigateUp(times)
1837
- * - times (Number): The number of times to change navigation
1838
- *
1839
1831
  * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.
1832
+ * @param {Number} times The number of times to change navigation
1833
+ *
1834
+ *
1840
1835
  **/
1841
1836
  this.navigateUp = function(times) {
1842
1837
  this.selection.clearSelection();
@@ -1845,10 +1840,10 @@ var Editor = function(renderer, session) {
1845
1840
  };
1846
1841
 
1847
1842
  /**
1848
- * Editor.navigateDown(times)
1849
- * - times (Number): The number of times to change navigation
1850
- *
1851
1843
  * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.
1844
+ * @param {Number} times The number of times to change navigation
1845
+ *
1846
+ *
1852
1847
  **/
1853
1848
  this.navigateDown = function(times) {
1854
1849
  this.selection.clearSelection();
@@ -1857,10 +1852,10 @@ var Editor = function(renderer, session) {
1857
1852
  };
1858
1853
 
1859
1854
  /**
1860
- * Editor.navigateLeft(times)
1861
- * - times (Number): The number of times to change navigation
1862
- *
1863
1855
  * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.
1856
+ * @param {Number} times The number of times to change navigation
1857
+ *
1858
+ *
1864
1859
  **/
1865
1860
  this.navigateLeft = function(times) {
1866
1861
  if (!this.selection.isEmpty()) {
@@ -1877,10 +1872,10 @@ var Editor = function(renderer, session) {
1877
1872
  };
1878
1873
 
1879
1874
  /**
1880
- * Editor.navigateRight(times)
1881
- * - times (Number): The number of times to change navigation
1882
- *
1883
1875
  * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.
1876
+ * @param {Number} times The number of times to change navigation
1877
+ *
1878
+ *
1884
1879
  **/
1885
1880
  this.navigateRight = function(times) {
1886
1881
  if (!this.selection.isEmpty()) {
@@ -1897,7 +1892,6 @@ var Editor = function(renderer, session) {
1897
1892
  };
1898
1893
 
1899
1894
  /**
1900
- * Editor.navigateLineStart()
1901
1895
  *
1902
1896
  * Moves the cursor to the start of the current line. Note that this does de-select the current selection.
1903
1897
  **/
@@ -1907,7 +1901,6 @@ var Editor = function(renderer, session) {
1907
1901
  };
1908
1902
 
1909
1903
  /**
1910
- * Editor.navigateLineEnd()
1911
1904
  *
1912
1905
  * Moves the cursor to the end of the current line. Note that this does de-select the current selection.
1913
1906
  **/
@@ -1917,7 +1910,6 @@ var Editor = function(renderer, session) {
1917
1910
  };
1918
1911
 
1919
1912
  /**
1920
- * Editor.navigateFileEnd()
1921
1913
  *
1922
1914
  * Moves the cursor to the end of the current file. Note that this does de-select the current selection.
1923
1915
  **/
@@ -1929,7 +1921,6 @@ var Editor = function(renderer, session) {
1929
1921
  };
1930
1922
 
1931
1923
  /**
1932
- * Editor.navigateFileStart()
1933
1924
  *
1934
1925
  * Moves the cursor to the start of the current file. Note that this does de-select the current selection.
1935
1926
  **/
@@ -1941,7 +1932,6 @@ var Editor = function(renderer, session) {
1941
1932
  };
1942
1933
 
1943
1934
  /**
1944
- * Editor.navigateWordRight()
1945
1935
  *
1946
1936
  * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.
1947
1937
  **/
@@ -1951,7 +1941,6 @@ var Editor = function(renderer, session) {
1951
1941
  };
1952
1942
 
1953
1943
  /**
1954
- * Editor.navigateWordLeft()
1955
1944
  *
1956
1945
  * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.
1957
1946
  **/
@@ -1961,11 +1950,11 @@ var Editor = function(renderer, session) {
1961
1950
  };
1962
1951
 
1963
1952
  /**
1964
- * Editor.replace(replacement, options)
1965
- * - replacement (String): The text to replace with
1966
- * - options (Object): The [[Search `Search`]] options to use
1967
- *
1968
1953
  * Replaces the first occurance of `options.needle` with the value in `replacement`.
1954
+ * @param {String} replacement The text to replace with
1955
+ * @param {Object} options The [[Search `Search`]] options to use
1956
+ *
1957
+ *
1969
1958
  **/
1970
1959
  this.replace = function(replacement, options) {
1971
1960
  if (options)
@@ -1988,11 +1977,11 @@ var Editor = function(renderer, session) {
1988
1977
  };
1989
1978
 
1990
1979
  /**
1991
- * Editor.replaceAll(replacement, options)
1992
- * - replacement (String): The text to replace with
1993
- * - options (Object): The [[Search `Search`]] options to use
1994
- *
1995
1980
  * Replaces all occurances of `options.needle` with the value in `replacement`.
1981
+ * @param {String} replacement The text to replace with
1982
+ * @param {Object} options The [[Search `Search`]] options to use
1983
+ *
1984
+ *
1996
1985
  **/
1997
1986
  this.replaceAll = function(replacement, options) {
1998
1987
  if (options) {
@@ -2033,22 +2022,23 @@ var Editor = function(renderer, session) {
2033
2022
  }
2034
2023
  };
2035
2024
 
2036
- /** related to: Search.getOptions
2037
- * Editor.getLastSearchOptions() -> Object
2038
- *
2025
+ /**
2039
2026
  * {:Search.getOptions} For more information on `options`, see [[Search `Search`]].
2027
+ * @related Search.getOptions
2028
+ * @returns {Object}
2040
2029
  **/
2041
2030
  this.getLastSearchOptions = function() {
2042
2031
  return this.$search.getOptions();
2043
2032
  };
2044
2033
 
2045
- /** related to: Search.find
2046
- * Editor.find(needle, options)
2047
- * - needle (String): The text to search for (optional)
2048
- * - options (Object): An object defining various search properties
2049
- * - animate (Boolean): If `true` animate scrolling
2050
- *
2034
+ /**
2051
2035
  * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]].
2036
+ * @param {String} needle The text to search for (optional)
2037
+ * @param {Object} options An object defining various search properties
2038
+ * @param {Boolean} animate If `true` animate scrolling
2039
+ *
2040
+ *
2041
+ * @related Search.find
2052
2042
  **/
2053
2043
  this.find = function(needle, options, animate) {
2054
2044
  if (!options)
@@ -2089,23 +2079,25 @@ var Editor = function(renderer, session) {
2089
2079
  this.selection.setRange(range);
2090
2080
  };
2091
2081
 
2092
- /** related to: Editor.find
2093
- * Editor.findNext(options)
2094
- * - options (Object): search options
2095
- * - animate (Boolean): If `true` animate scrolling
2096
- *
2082
+ /**
2097
2083
  * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]].
2084
+ * @param {Object} options search options
2085
+ * @param {Boolean} animate If `true` animate scrolling
2086
+ *
2087
+ *
2088
+ * @related Editor.find
2098
2089
  **/
2099
2090
  this.findNext = function(options, animate) {
2100
2091
  this.find({skipCurrent: true, backwards: false}, options, animate);
2101
2092
  };
2102
2093
 
2103
- /** related to: Editor.find
2104
- * Editor.findPrevious(options)
2105
- * - options (Object): search options
2106
- * - animate (Boolean): If `true` animate scrolling
2107
- *
2094
+ /**
2108
2095
  * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]].
2096
+ * @param {Object} options search options
2097
+ * @param {Boolean} animate If `true` animate scrolling
2098
+ *
2099
+ *
2100
+ * @related Editor.find
2109
2101
  **/
2110
2102
  this.findPrevious = function(options, animate) {
2111
2103
  this.find(options, {skipCurrent: true, backwards: true}, animate);
@@ -2123,10 +2115,9 @@ var Editor = function(renderer, session) {
2123
2115
  this.renderer.animateScrolling(scrollTop);
2124
2116
  };
2125
2117
 
2126
- /** related to: UndoManager.undo
2127
- * Editor.undo()
2128
- *
2118
+ /**
2129
2119
  * {:UndoManager.undo}
2120
+ * @related UndoManager.undo
2130
2121
  **/
2131
2122
  this.undo = function() {
2132
2123
  this.$blockScrolling++;
@@ -2135,10 +2126,9 @@ var Editor = function(renderer, session) {
2135
2126
  this.renderer.scrollCursorIntoView(null, 0.5);
2136
2127
  };
2137
2128
 
2138
- /** related to: UndoManager.redo
2139
- * Editor.redo()
2140
- *
2129
+ /**
2141
2130
  * {:UndoManager.redo}
2131
+ * @related UndoManager.redo
2142
2132
  **/
2143
2133
  this.redo = function() {
2144
2134
  this.$blockScrolling++;
@@ -2148,7 +2138,6 @@ var Editor = function(renderer, session) {
2148
2138
  };
2149
2139
 
2150
2140
  /**
2151
- * Editor.destroy()
2152
2141
  *
2153
2142
  * Cleans up the entire editor.
2154
2143
  **/
@@ -2160,4 +2149,4 @@ var Editor = function(renderer, session) {
2160
2149
 
2161
2150
 
2162
2151
  exports.Editor = Editor;
2163
- });
2152
+ });