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.
- data/gollum.gemspec +100 -19
- data/lib/gollum.rb +2 -3
- data/lib/gollum/frontend/public/gollum/css/gollum.css +3 -1
- data/lib/gollum/frontend/public/gollum/css/template.css +8 -12
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +64 -60
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +56 -62
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +56 -63
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +11 -11
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +59 -53
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +46 -39
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +32 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +62 -47
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config_test.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +82 -41
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +126 -145
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +25 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +484 -467
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +30 -63
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +29 -37
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +27 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +47 -55
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +61 -41
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +506 -517
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +28 -38
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +9 -14
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +26 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +44 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +45 -52
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +25 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +230 -165
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +76 -49
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +66 -61
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +36 -43
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +138 -156
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +35 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +18 -18
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +116 -101
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +117 -83
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +60 -71
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +163 -102
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +60 -41
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +26 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +26 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +24 -1
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +52 -54
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +32 -39
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +9 -1
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +73 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +10 -3
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +2 -2
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +55 -58
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json +8 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +52 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +175 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +124 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +248 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +188 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +41 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +231 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +732 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +185 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +362 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +529 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +150 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +139 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +555 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +611 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +79 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +196 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +292 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +698 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +451 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +824 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +1202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +260 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +311 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +1020 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +238 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +255 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +205 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +267 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +748 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +181 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +434 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +931 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +536 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +705 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +64 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +260 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +77 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +133 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +64 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +234 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +195 -55
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +31 -31
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +25 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +67 -60
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +25 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +112 -130
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +29 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +22 -7
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +140 -64
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +479 -237
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +321 -230
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +62 -28
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +39 -20
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +183 -82
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +226 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +7 -21
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +36 -47
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +202 -697
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +51 -84
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +68 -40
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +192 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +25 -31
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +27 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +31 -37
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +30 -51
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +35 -30
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js +125 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +52 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +0 -1
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +15 -22
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +28 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +20 -25
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +11 -15
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +32 -38
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +162 -69
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +347 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +18 -29
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +28 -51
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +4838 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +98 -180
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +163 -64
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +38 -40
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +56 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +3 -2
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +1 -1
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +25 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +25 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +146 -161
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +60 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +127 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +116 -56
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +75 -101
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +16 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js +49 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +75 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +35 -41
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +29 -37
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +343 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +39 -53
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +39 -52
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +33 -24
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +55 -51
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +57 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +53 -153
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +31 -21
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +28 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +44 -61
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r.js +135 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +190 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +36 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +67 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +49 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +27 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +102 -90
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +29 -37
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +25 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +32 -54
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +18 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +48 -64
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +28 -18
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +41 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +175 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +110 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +180 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js +48 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +26 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +57 -46
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +27 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +183 -78
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +30 -38
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +32 -37
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +32954 -42497
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +316 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +31 -44
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +48 -57
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +30 -18
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +48 -40
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +126 -40
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +35 -43
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +78 -39
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +39 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +234 -103
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +26 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +30 -39
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +27 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +190 -201
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +31 -49
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +27 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +52 -55
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +91 -105
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +31 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +47 -37
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +138 -153
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +67 -105
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +3 -2
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +30 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +217 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js +33 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +37 -38
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +27 -34
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +53 -47
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +54 -48
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +58 -59
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +33 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +52 -64
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +33 -36
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +29 -25
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +14 -21
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +48 -60
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +52 -57
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +53 -71
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +54 -77
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +60 -70
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +55 -72
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +55 -64
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +48 -66
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +49 -61
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +38 -44
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +59 -87
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +59 -87
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +59 -90
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +59 -87
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +57 -85
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +54 -78
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +45 -68
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +28 -35
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +111 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +39 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +37 -50
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +26 -33
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +40 -41
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +205 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +48 -55
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +254 -277
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +25 -32
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +22 -4
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +97 -56
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +24 -476
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +2 -2
- data/lib/gollum/frontend/views/page.rb +3 -2
- metadata +102 -21
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +0 -59
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +0 -1686
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +0 -2993
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +0 -69
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +0 -63
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +0 -10363
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +0 -165
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +0 -6177
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +0 -55
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +0 -696
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +0 -598
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +0 -61
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +0 -2072
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +0 -4469
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +0 -6396
@@ -1,38 +1,30 @@
|
|
1
1
|
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
-
*
|
2
|
+
* Distributed under the BSD license:
|
3
3
|
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
28
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
29
|
-
* of those above. If you wish to allow use of your version of this file only
|
30
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
31
|
-
* use your version of this file under the terms of the MPL, indicate your
|
32
|
-
* decision by deleting the provisions above and replace them with the notice
|
33
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
34
|
-
* the provisions above, a recipient may use your version of this file under
|
35
|
-
* 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.
|
36
28
|
*
|
37
29
|
* ***** END LICENSE BLOCK ***** */
|
38
30
|
|
@@ -1,40 +1,30 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
4
3
|
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
28
|
-
*
|
29
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
30
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
31
|
-
* of those above. If you wish to allow use of your version of this file only
|
32
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
33
|
-
* use your version of this file under the terms of the MPL, indicate your
|
34
|
-
* decision by deleting the provisions above and replace them with the notice
|
35
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
36
|
-
* the provisions above, a recipient may use your version of this file under
|
37
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
38
28
|
*
|
39
29
|
* ***** END LICENSE BLOCK ***** */
|
40
30
|
|
@@ -54,32 +44,121 @@ var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer;
|
|
54
44
|
var SearchHighlight = require("./search_highlight").SearchHighlight;
|
55
45
|
|
56
46
|
/**
|
57
|
-
* class EditSession
|
58
47
|
*
|
59
|
-
*
|
48
|
+
*
|
49
|
+
* Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state.
|
50
|
+
*
|
51
|
+
* `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s.
|
52
|
+
* @class EditSession
|
53
|
+
**/
|
54
|
+
|
55
|
+
// events
|
56
|
+
/**
|
57
|
+
*
|
58
|
+
* Emitted when the document changes.
|
59
|
+
* @event change
|
60
|
+
* @param {Object} e An object containing a `delta` of information about the change.
|
61
|
+
**/
|
62
|
+
/**
|
63
|
+
* Emitted when the tab size changes, via [[EditSession.setTabSize]].
|
64
|
+
*
|
65
|
+
* @event changeTabSize
|
66
|
+
**/
|
67
|
+
/**
|
68
|
+
* Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]].
|
69
|
+
*
|
70
|
+
* @event changeOverwrite
|
71
|
+
**/
|
72
|
+
/**
|
73
|
+
* Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.
|
74
|
+
*
|
75
|
+
* @event changeBreakpoint
|
76
|
+
**/
|
77
|
+
/**
|
78
|
+
* Emitted when a front marker changes.
|
79
|
+
*
|
80
|
+
* @event changeFrontMarker
|
81
|
+
**/
|
82
|
+
/**
|
83
|
+
* Emitted when a back marker changes.
|
84
|
+
*
|
85
|
+
* @event changeBackMarker
|
86
|
+
**/
|
87
|
+
/**
|
88
|
+
* Emitted when an annotation changes, like through [[EditSession.setAnnotations]].
|
89
|
+
*
|
90
|
+
* @event changeAnnotation
|
91
|
+
**/
|
92
|
+
/**
|
93
|
+
* Emitted when a background tokenizer asynchronously processes new rows.
|
94
|
+
* @event tokenizerUpdate
|
95
|
+
*
|
96
|
+
* @param {Object} e An object containing one property, `"data"`, that contains information about the changing rows
|
97
|
+
*
|
98
|
+
**/
|
99
|
+
/**
|
100
|
+
* Emitted when the mode is loaded.
|
101
|
+
*
|
102
|
+
* @event loadMode
|
103
|
+
*
|
104
|
+
**/
|
105
|
+
/**
|
106
|
+
* Emitted when the current mode changes.
|
107
|
+
*
|
108
|
+
* @event changeMode
|
109
|
+
*
|
110
|
+
**/
|
111
|
+
/**
|
112
|
+
* Emitted when the wrap mode changes.
|
113
|
+
*
|
114
|
+
* @event changeWrapMode
|
115
|
+
*
|
116
|
+
**/
|
117
|
+
/**
|
118
|
+
* Emitted when the wrapping limit changes.
|
119
|
+
*
|
120
|
+
* @event changeWrapLimit
|
121
|
+
*
|
122
|
+
**/
|
123
|
+
/**
|
124
|
+
* Emitted when a code fold is added or removed.
|
125
|
+
*
|
126
|
+
* @event changeFold
|
60
127
|
*
|
61
128
|
**/
|
129
|
+
/**
|
130
|
+
* Emitted when the scroll top changes.
|
131
|
+
* @event changeScrollTop
|
132
|
+
*
|
133
|
+
* @param {Number} scrollTop The new scroll top value
|
134
|
+
**/
|
135
|
+
/**
|
136
|
+
* Emitted when the scroll left changes.
|
137
|
+
* @event changeScrollLeft
|
138
|
+
*
|
139
|
+
* @param {Number} scrollLeft The new scroll left value
|
140
|
+
**/
|
141
|
+
|
62
142
|
|
63
143
|
/**
|
64
|
-
* new EditSession(text, mode)
|
65
|
-
* - text (Document | String): If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text
|
66
|
-
* - mode (TextMode): The inital language mode to use for the document
|
67
144
|
*
|
68
145
|
* Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`.
|
146
|
+
* @param {Document | String} text If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text
|
147
|
+
*
|
148
|
+
* @param {TextMode} mode The inital language mode to use for the document
|
69
149
|
*
|
150
|
+
* @constructor
|
70
151
|
**/
|
71
152
|
|
72
153
|
var EditSession = function(text, mode) {
|
73
|
-
this.$modified = true;
|
74
154
|
this.$breakpoints = [];
|
155
|
+
this.$decorations = [];
|
75
156
|
this.$frontMarkers = {};
|
76
157
|
this.$backMarkers = {};
|
77
158
|
this.$markerId = 1;
|
78
|
-
this.$resetRowCache(0);
|
79
|
-
this.$wrapData = [];
|
80
|
-
this.$foldData = [];
|
81
|
-
this.$rowLengthCache = [];
|
82
159
|
this.$undoSelect = true;
|
160
|
+
|
161
|
+
this.$foldData = [];
|
83
162
|
this.$foldData.toString = function() {
|
84
163
|
var str = "";
|
85
164
|
this.forEach(function(foldLine) {
|
@@ -87,12 +166,13 @@ var EditSession = function(text, mode) {
|
|
87
166
|
});
|
88
167
|
return str;
|
89
168
|
}
|
169
|
+
this.on("changeFold", this.onChangeFold.bind(this));
|
170
|
+
this.$onChange = this.onChange.bind(this);
|
171
|
+
|
172
|
+
if (typeof text != "object" || !text.getLine)
|
173
|
+
text = new Document(text);
|
90
174
|
|
91
|
-
|
92
|
-
this.setDocument(text);
|
93
|
-
} else {
|
94
|
-
this.setDocument(new Document(text));
|
95
|
-
}
|
175
|
+
this.setDocument(text);
|
96
176
|
|
97
177
|
this.selection = new Selection(this);
|
98
178
|
this.setMode(mode);
|
@@ -104,51 +184,44 @@ var EditSession = function(text, mode) {
|
|
104
184
|
oop.implement(this, EventEmitter);
|
105
185
|
|
106
186
|
/**
|
107
|
-
* EditSession.setDocument(doc)
|
108
|
-
* - doc (Document): The new `Document` to use
|
109
|
-
*
|
110
187
|
* Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`.
|
111
188
|
*
|
189
|
+
* @param {Document} doc The new `Document` to use
|
190
|
+
*
|
112
191
|
**/
|
113
192
|
this.setDocument = function(doc) {
|
114
193
|
if (this.doc)
|
115
|
-
|
194
|
+
this.doc.removeListener("change", this.$onChange);
|
116
195
|
|
117
196
|
this.doc = doc;
|
118
|
-
doc.on("change", this
|
119
|
-
this.on("changeFold", this.onChangeFold.bind(this));
|
197
|
+
doc.on("change", this.$onChange);
|
120
198
|
|
121
|
-
if (this.bgTokenizer)
|
199
|
+
if (this.bgTokenizer)
|
122
200
|
this.bgTokenizer.setDocument(this.getDocument());
|
123
|
-
|
124
|
-
|
201
|
+
|
202
|
+
this.resetCaches();
|
125
203
|
};
|
126
204
|
|
127
205
|
/**
|
128
|
-
* EditSession.getDocument() -> Document
|
129
|
-
*
|
130
206
|
* Returns the `Document` associated with this session.
|
131
|
-
*
|
207
|
+
* @return {Document}
|
132
208
|
**/
|
133
209
|
this.getDocument = function() {
|
134
210
|
return this.doc;
|
135
211
|
};
|
136
212
|
|
137
|
-
/**
|
138
|
-
*
|
139
|
-
* - row (Number): The row to work with
|
140
|
-
*
|
141
|
-
*
|
213
|
+
/**
|
214
|
+
* @param {Number} row The row to work with
|
142
215
|
*
|
143
216
|
**/
|
144
|
-
this.$resetRowCache = function(
|
145
|
-
if (!
|
217
|
+
this.$resetRowCache = function(docRow) {
|
218
|
+
if (!docRow) {
|
146
219
|
this.$docRowCache = [];
|
147
220
|
this.$screenRowCache = [];
|
148
221
|
return;
|
149
222
|
}
|
150
223
|
|
151
|
-
var i = this.$getRowCacheIndex(this.$docRowCache,
|
224
|
+
var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
|
152
225
|
var l = this.$docRowCache.length;
|
153
226
|
this.$docRowCache.splice(i, l);
|
154
227
|
this.$screenRowCache.splice(i, l);
|
@@ -174,22 +247,20 @@ var EditSession = function(text, mode) {
|
|
174
247
|
return low && low -1;
|
175
248
|
};
|
176
249
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
250
|
+
this.resetCaches = function() {
|
251
|
+
this.$modified = true;
|
252
|
+
this.$wrapData = [];
|
253
|
+
this.$rowLengthCache = [];
|
254
|
+
this.$resetRowCache(0);
|
255
|
+
if (this.bgTokenizer)
|
256
|
+
this.bgTokenizer.start(0);
|
257
|
+
};
|
258
|
+
|
183
259
|
this.onChangeFold = function(e) {
|
184
260
|
var fold = e.data;
|
185
261
|
this.$resetRowCache(fold.start.row);
|
186
262
|
};
|
187
263
|
|
188
|
-
/**
|
189
|
-
* EditSession@onChange(e)
|
190
|
-
*
|
191
|
-
* Emitted when the document changes.
|
192
|
-
**/
|
193
264
|
this.onChange = function(e) {
|
194
265
|
var delta = e.data;
|
195
266
|
this.$modified = true;
|
@@ -214,10 +285,10 @@ var EditSession = function(text, mode) {
|
|
214
285
|
};
|
215
286
|
|
216
287
|
/**
|
217
|
-
* EditSession.setValue(text)
|
218
|
-
* - text (String): The new text to place
|
219
|
-
*
|
220
288
|
* Sets the session text.
|
289
|
+
* @param {String} text The new text to place
|
290
|
+
*
|
291
|
+
*
|
221
292
|
*
|
222
293
|
**/
|
223
294
|
this.setValue = function(text) {
|
@@ -232,17 +303,17 @@ var EditSession = function(text, mode) {
|
|
232
303
|
this.getUndoManager().reset();
|
233
304
|
};
|
234
305
|
|
235
|
-
/**
|
236
|
-
* EditSession.getValue() -> String
|
237
|
-
*
|
306
|
+
/**
|
238
307
|
* Returns the current [[Document `Document`]] as a string.
|
308
|
+
* @method toString
|
309
|
+
* @alias EditSession.getValue
|
239
310
|
*
|
240
311
|
**/
|
241
|
-
|
242
|
-
|
243
|
-
*
|
312
|
+
|
313
|
+
/**
|
244
314
|
* Returns the current [[Document `Document`]] as a string.
|
245
|
-
*
|
315
|
+
* @method getValue
|
316
|
+
* @alias EditSession.toString
|
246
317
|
**/
|
247
318
|
this.getValue =
|
248
319
|
this.toString = function() {
|
@@ -250,30 +321,27 @@ var EditSession = function(text, mode) {
|
|
250
321
|
};
|
251
322
|
|
252
323
|
/**
|
253
|
-
* EditSession.getSelection() -> String
|
254
|
-
*
|
255
324
|
* Returns the string of the current selection.
|
256
325
|
**/
|
257
326
|
this.getSelection = function() {
|
258
327
|
return this.selection;
|
259
328
|
};
|
260
329
|
|
261
|
-
/**
|
262
|
-
* EditSession.getState(row) -> Array
|
263
|
-
* - row (Number): The row to start at
|
264
|
-
*
|
330
|
+
/**
|
265
331
|
* {:BackgroundTokenizer.getState}
|
332
|
+
* @param {Number} row The row to start at
|
266
333
|
*
|
334
|
+
* @related BackgroundTokenizer.getState
|
267
335
|
**/
|
268
336
|
this.getState = function(row) {
|
269
337
|
return this.bgTokenizer.getState(row);
|
270
338
|
};
|
271
339
|
|
272
|
-
/**
|
273
|
-
* EditSession.getTokens(row) -> Array
|
274
|
-
* - row (Number): The row to start at
|
275
|
-
*
|
340
|
+
/**
|
276
341
|
* Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.
|
342
|
+
* @param {Number} row The row to start at
|
343
|
+
*
|
344
|
+
*
|
277
345
|
*
|
278
346
|
**/
|
279
347
|
this.getTokens = function(row) {
|
@@ -281,11 +349,11 @@ var EditSession = function(text, mode) {
|
|
281
349
|
};
|
282
350
|
|
283
351
|
/**
|
284
|
-
*
|
285
|
-
*
|
286
|
-
*
|
352
|
+
* Returns an object indicating the token at the current row. The object has two properties: `index` and `start`.
|
353
|
+
* @param {Number} row The row number to retrieve from
|
354
|
+
* @param {Number} column The column number to retrieve from
|
355
|
+
*
|
287
356
|
*
|
288
|
-
* Returns an array of tokens at the indicated row and column.
|
289
357
|
**/
|
290
358
|
this.getTokenAt = function(row, column) {
|
291
359
|
var tokens = this.bgTokenizer.getTokens(row);
|
@@ -308,18 +376,11 @@ var EditSession = function(text, mode) {
|
|
308
376
|
return token;
|
309
377
|
};
|
310
378
|
|
311
|
-
this.highlight = function(re) {
|
312
|
-
if (!this.$searchHighlight) {
|
313
|
-
var highlight = new SearchHighlight(null, "ace_selected_word", "text");
|
314
|
-
this.$searchHighlight = this.addDynamicMarker(highlight);
|
315
|
-
}
|
316
|
-
this.$searchHighlight.setRegexp(re);
|
317
|
-
}
|
318
379
|
/**
|
319
|
-
* EditSession.setUndoManager(undoManager)
|
320
|
-
* - undoManager (UndoManager): The new undo manager
|
321
|
-
*
|
322
380
|
* Sets the undo manager.
|
381
|
+
* @param {UndoManager} undoManager The new undo manager
|
382
|
+
*
|
383
|
+
*
|
323
384
|
**/
|
324
385
|
this.setUndoManager = function(undoManager) {
|
325
386
|
this.$undoManager = undoManager;
|
@@ -332,11 +393,7 @@ var EditSession = function(text, mode) {
|
|
332
393
|
|
333
394
|
if (undoManager) {
|
334
395
|
var self = this;
|
335
|
-
|
336
|
-
* EditSession.$syncInformUndoManager()
|
337
|
-
*
|
338
|
-
*
|
339
|
-
**/
|
396
|
+
|
340
397
|
this.$syncInformUndoManager = function() {
|
341
398
|
self.$informUndoManager.cancel();
|
342
399
|
|
@@ -377,17 +434,13 @@ var EditSession = function(text, mode) {
|
|
377
434
|
};
|
378
435
|
|
379
436
|
/**
|
380
|
-
* EditSession.getUndoManager() -> UndoManager
|
381
|
-
*
|
382
437
|
* Returns the current undo manager.
|
383
438
|
**/
|
384
439
|
this.getUndoManager = function() {
|
385
440
|
return this.$undoManager || this.$defaultUndoManager;
|
386
|
-
}
|
441
|
+
};
|
387
442
|
|
388
443
|
/**
|
389
|
-
* EditSession.getTabString() -> String
|
390
|
-
*
|
391
444
|
* Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`.
|
392
445
|
**/
|
393
446
|
this.getTabString = function() {
|
@@ -400,10 +453,10 @@ var EditSession = function(text, mode) {
|
|
400
453
|
|
401
454
|
this.$useSoftTabs = true;
|
402
455
|
/**
|
403
|
-
* EditSession.setUseSoftTabs(useSoftTabs)
|
404
|
-
* - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs
|
405
|
-
*
|
406
456
|
* Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`).
|
457
|
+
* @param {Boolean} useSoftTabs Value indicating whether or not to use soft tabs
|
458
|
+
*
|
459
|
+
*
|
407
460
|
*
|
408
461
|
**/
|
409
462
|
this.setUseSoftTabs = function(useSoftTabs) {
|
@@ -413,10 +466,8 @@ var EditSession = function(text, mode) {
|
|
413
466
|
};
|
414
467
|
|
415
468
|
/**
|
416
|
-
* EditSession.getUseSoftTabs() -> Boolean
|
417
|
-
*
|
418
469
|
* Returns `true` if soft tabs are being used, `false` otherwise.
|
419
|
-
*
|
470
|
+
* @returns {Boolean}
|
420
471
|
**/
|
421
472
|
this.getUseSoftTabs = function() {
|
422
473
|
return this.$useSoftTabs;
|
@@ -424,10 +475,10 @@ var EditSession = function(text, mode) {
|
|
424
475
|
|
425
476
|
this.$tabSize = 4;
|
426
477
|
/**
|
427
|
-
* EditSession.setTabSize(tabSize)
|
428
|
-
* - tabSize (Number): The new tab size
|
429
|
-
*
|
430
478
|
* Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event.
|
479
|
+
* @param {Number} tabSize The new tab size
|
480
|
+
*
|
481
|
+
*
|
431
482
|
**/
|
432
483
|
this.setTabSize = function(tabSize) {
|
433
484
|
if (isNaN(tabSize) || this.$tabSize === tabSize) return;
|
@@ -439,8 +490,6 @@ var EditSession = function(text, mode) {
|
|
439
490
|
};
|
440
491
|
|
441
492
|
/**
|
442
|
-
* EditSession.getTabSize() -> Number
|
443
|
-
*
|
444
493
|
* Returns the current tab size.
|
445
494
|
**/
|
446
495
|
this.getTabSize = function() {
|
@@ -448,10 +497,10 @@ var EditSession = function(text, mode) {
|
|
448
497
|
};
|
449
498
|
|
450
499
|
/**
|
451
|
-
* EditSession.isTabStop(position) -> Boolean
|
452
|
-
* - position (Object): The position to check
|
453
|
-
*
|
454
500
|
* Returns `true` if the character at the position is a soft tab.
|
501
|
+
* @param {Object} position The position to check
|
502
|
+
*
|
503
|
+
*
|
455
504
|
**/
|
456
505
|
this.isTabStop = function(position) {
|
457
506
|
return this.$useSoftTabs && (position.column % this.$tabSize == 0);
|
@@ -459,10 +508,12 @@ var EditSession = function(text, mode) {
|
|
459
508
|
|
460
509
|
this.$overwrite = false;
|
461
510
|
/**
|
462
|
-
*
|
463
|
-
*
|
511
|
+
* Pass in `true` to enable overwrites in your session, or `false` to disable.
|
512
|
+
*
|
513
|
+
* 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.
|
514
|
+
*
|
515
|
+
* @param {Boolean} overwrite Defines wheter or not to set overwrites
|
464
516
|
*
|
465
|
-
* 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.
|
466
517
|
*
|
467
518
|
**/
|
468
519
|
this.setOverwrite = function(overwrite) {
|
@@ -473,8 +524,6 @@ var EditSession = function(text, mode) {
|
|
473
524
|
};
|
474
525
|
|
475
526
|
/**
|
476
|
-
* EditSession.getOverwrite() -> Boolean
|
477
|
-
*
|
478
527
|
* Returns `true` if overwrites are enabled; `false` otherwise.
|
479
528
|
**/
|
480
529
|
this.getOverwrite = function() {
|
@@ -482,8 +531,6 @@ var EditSession = function(text, mode) {
|
|
482
531
|
};
|
483
532
|
|
484
533
|
/**
|
485
|
-
* EditSession.toggleOverwrite()
|
486
|
-
*
|
487
534
|
* Sets the value of overwrite to the opposite of whatever it currently is.
|
488
535
|
**/
|
489
536
|
this.toggleOverwrite = function() {
|
@@ -491,32 +538,55 @@ var EditSession = function(text, mode) {
|
|
491
538
|
};
|
492
539
|
|
493
540
|
/**
|
494
|
-
*
|
541
|
+
* Adds `className` to the `row`, to be used for CSS stylings and whatnot.
|
542
|
+
* @param {Number} row The row number
|
543
|
+
* @param {String} className The class to add
|
544
|
+
*
|
545
|
+
*
|
546
|
+
**/
|
547
|
+
this.addGutterDecoration = function(row, className) {
|
548
|
+
if (!this.$decorations[row])
|
549
|
+
this.$decorations[row] = "";
|
550
|
+
this.$decorations[row] += " " + className;
|
551
|
+
this._emit("changeBreakpoint", {});
|
552
|
+
};
|
553
|
+
|
554
|
+
/**
|
555
|
+
* Removes `className` from the `row`.
|
556
|
+
* @param {Number} row The row number
|
557
|
+
* @param {String} className The class to add
|
558
|
+
*
|
495
559
|
*
|
560
|
+
**/
|
561
|
+
this.removeGutterDecoration = function(row, className) {
|
562
|
+
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
563
|
+
this._emit("changeBreakpoint", {});
|
564
|
+
};
|
565
|
+
|
566
|
+
/**
|
496
567
|
* Returns an array of numbers, indicating which rows have breakpoints.
|
568
|
+
* @returns [Number]
|
497
569
|
**/
|
498
570
|
this.getBreakpoints = function() {
|
499
571
|
return this.$breakpoints;
|
500
572
|
};
|
501
573
|
|
502
574
|
/**
|
503
|
-
* EditSession.setBreakpoints(rows)
|
504
|
-
* - rows (Array): An array of row indicies
|
505
|
-
*
|
506
575
|
* Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
|
576
|
+
* @param {Number} rows An array of row indicies
|
577
|
+
*
|
578
|
+
*
|
507
579
|
*
|
508
580
|
**/
|
509
581
|
this.setBreakpoints = function(rows) {
|
510
582
|
this.$breakpoints = [];
|
511
583
|
for (var i=0; i<rows.length; i++) {
|
512
|
-
this.$breakpoints[rows[i]] =
|
584
|
+
this.$breakpoints[rows[i]] = "ace_breakpoint";
|
513
585
|
}
|
514
586
|
this._emit("changeBreakpoint", {});
|
515
587
|
};
|
516
588
|
|
517
589
|
/**
|
518
|
-
* EditSession.clearBreakpoints()
|
519
|
-
*
|
520
590
|
* Removes all breakpoints on the rows. This function also emites the `'changeBreakpoint'` event.
|
521
591
|
**/
|
522
592
|
this.clearBreakpoints = function() {
|
@@ -525,21 +595,27 @@ var EditSession = function(text, mode) {
|
|
525
595
|
};
|
526
596
|
|
527
597
|
/**
|
528
|
-
* EditSession.setBreakpoint(row)
|
529
|
-
* - row (Number): A row index
|
530
|
-
*
|
531
598
|
* Sets a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
|
599
|
+
* @param {Number} row A row index
|
600
|
+
* @param {String} className Class of the breakpoint
|
601
|
+
*
|
602
|
+
*
|
532
603
|
**/
|
533
|
-
this.setBreakpoint = function(row) {
|
534
|
-
|
604
|
+
this.setBreakpoint = function(row, className) {
|
605
|
+
if (className === undefined)
|
606
|
+
className = "ace_breakpoint";
|
607
|
+
if (className)
|
608
|
+
this.$breakpoints[row] = className;
|
609
|
+
else
|
610
|
+
delete this.$breakpoints[row];
|
535
611
|
this._emit("changeBreakpoint", {});
|
536
612
|
};
|
537
613
|
|
538
614
|
/**
|
539
|
-
* EditSession.clearBreakpoint(row)
|
540
|
-
* - row (Number): A row index
|
541
|
-
*
|
542
615
|
* Removes a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
|
616
|
+
* @param {Number} row A row index
|
617
|
+
*
|
618
|
+
*
|
543
619
|
**/
|
544
620
|
this.clearBreakpoint = function(row) {
|
545
621
|
delete this.$breakpoints[row];
|
@@ -547,14 +623,14 @@ var EditSession = function(text, mode) {
|
|
547
623
|
};
|
548
624
|
|
549
625
|
/**
|
550
|
-
* EditSession.addMarker(range, clazz, type = "line", inFront) -> Number
|
551
|
-
* - range (Range): Define the range of the marker
|
552
|
-
* - clazz (String): Set the CSS class for the marker
|
553
|
-
* - type (Function | String): Identify the type of the marker
|
554
|
-
* - inFront (Boolean): Set to `true` to establish a front marker
|
555
|
-
*
|
556
626
|
* Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires.
|
627
|
+
* @param {Range} range Define the range of the marker
|
628
|
+
* @param {String} clazz Set the CSS class for the marker
|
629
|
+
* @param {Function | String} type Identify the type of the marker
|
630
|
+
* @param {Boolean} inFront Set to `true` to establish a front marker
|
557
631
|
*
|
632
|
+
*
|
633
|
+
* @return Number
|
558
634
|
**/
|
559
635
|
this.addMarker = function(range, clazz, type, inFront) {
|
560
636
|
var id = this.$markerId++;
|
@@ -580,11 +656,13 @@ var EditSession = function(text, mode) {
|
|
580
656
|
};
|
581
657
|
|
582
658
|
/**
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
659
|
+
* Adds a dynamic marker to the session.
|
660
|
+
* @param {Object} marker object with update method
|
661
|
+
* @param {Boolean} inFront Set to `true` to establish a front marker
|
662
|
+
*
|
663
|
+
*
|
664
|
+
* @return Object The added marker
|
665
|
+
**/
|
588
666
|
this.addDynamicMarker = function(marker, inFront) {
|
589
667
|
if (!marker.update)
|
590
668
|
return;
|
@@ -604,10 +682,10 @@ var EditSession = function(text, mode) {
|
|
604
682
|
};
|
605
683
|
|
606
684
|
/**
|
607
|
-
* EditSession.removeMarker(markerId)
|
608
|
-
* - markerId (Number): A number representing a marker
|
609
|
-
*
|
610
685
|
* Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted.
|
686
|
+
* @param {Number} markerId A number representing a marker
|
687
|
+
*
|
688
|
+
*
|
611
689
|
*
|
612
690
|
**/
|
613
691
|
this.removeMarker = function(markerId) {
|
@@ -623,16 +701,39 @@ var EditSession = function(text, mode) {
|
|
623
701
|
};
|
624
702
|
|
625
703
|
/**
|
626
|
-
* EditSession.getMarkers(inFront) -> Array
|
627
|
-
* - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers
|
628
|
-
*
|
629
704
|
* Returns an array containing the IDs of all the markers, either front or back.
|
705
|
+
* @param {Boolean} inFront If `true`, indicates you only want front markers; `false` indicates only back markers
|
630
706
|
*
|
707
|
+
* @returns {Array}
|
631
708
|
**/
|
632
709
|
this.getMarkers = function(inFront) {
|
633
710
|
return inFront ? this.$frontMarkers : this.$backMarkers;
|
634
711
|
};
|
635
712
|
|
713
|
+
this.highlight = function(re) {
|
714
|
+
if (!this.$searchHighlight) {
|
715
|
+
var highlight = new SearchHighlight(null, "ace_selected-word", "text");
|
716
|
+
this.$searchHighlight = this.addDynamicMarker(highlight);
|
717
|
+
}
|
718
|
+
this.$searchHighlight.setRegexp(re);
|
719
|
+
}
|
720
|
+
|
721
|
+
// experimental
|
722
|
+
this.highlightLines = function(startRow, endRow, clazz, inFront) {
|
723
|
+
if (typeof endRow != "number") {
|
724
|
+
clazz = endRow;
|
725
|
+
endRow = startRow;
|
726
|
+
}
|
727
|
+
if (!clazz)
|
728
|
+
clazz = "ace_step";
|
729
|
+
|
730
|
+
var range = new Range(startRow, 0, endRow, Infinity);
|
731
|
+
|
732
|
+
var id = this.addMarker(range, clazz, "fullLine", inFront);
|
733
|
+
range.id = id;
|
734
|
+
return range;
|
735
|
+
};
|
736
|
+
|
636
737
|
/*
|
637
738
|
* Error:
|
638
739
|
* {
|
@@ -643,36 +744,24 @@ var EditSession = function(text, mode) {
|
|
643
744
|
* }
|
644
745
|
*/
|
645
746
|
/**
|
646
|
-
* EditSession.setAnnotations(annotations)
|
647
|
-
* - annotations (Array): A list of annotations
|
648
|
-
*
|
649
747
|
* Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event.
|
748
|
+
* @param {Array} annotations A list of annotations
|
749
|
+
*
|
650
750
|
**/
|
651
751
|
this.setAnnotations = function(annotations) {
|
652
|
-
this.$annotations =
|
653
|
-
for (var i=0; i<annotations.length; i++) {
|
654
|
-
var annotation = annotations[i];
|
655
|
-
var row = annotation.row;
|
656
|
-
if (this.$annotations[row])
|
657
|
-
this.$annotations[row].push(annotation);
|
658
|
-
else
|
659
|
-
this.$annotations[row] = [annotation];
|
660
|
-
}
|
752
|
+
this.$annotations = annotations;
|
661
753
|
this._emit("changeAnnotation", {});
|
662
754
|
};
|
663
755
|
|
664
756
|
/**
|
665
|
-
* EditSession.getAnnotations() -> Object
|
666
|
-
*
|
667
757
|
* Returns the annotations for the `EditSession`.
|
758
|
+
* @returns {Object}
|
668
759
|
**/
|
669
760
|
this.getAnnotations = function() {
|
670
|
-
return this.$annotations ||
|
761
|
+
return this.$annotations || [];
|
671
762
|
};
|
672
763
|
|
673
764
|
/**
|
674
|
-
* EditSession.clearAnnotations()
|
675
|
-
*
|
676
765
|
* Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event.
|
677
766
|
**/
|
678
767
|
this.clearAnnotations = function() {
|
@@ -680,11 +769,10 @@ var EditSession = function(text, mode) {
|
|
680
769
|
this._emit("changeAnnotation", {});
|
681
770
|
};
|
682
771
|
|
683
|
-
/**
|
684
|
-
* EditSession.$detectNewLine(text)
|
685
|
-
* - text (String): A block of text
|
686
|
-
*
|
772
|
+
/**
|
687
773
|
* If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value.
|
774
|
+
* @param {String} text A block of text
|
775
|
+
*
|
688
776
|
*
|
689
777
|
**/
|
690
778
|
this.$detectNewLine = function(text) {
|
@@ -697,12 +785,11 @@ var EditSession = function(text, mode) {
|
|
697
785
|
};
|
698
786
|
|
699
787
|
/**
|
700
|
-
* EditSession.getWordRange(row, column) -> Range
|
701
|
-
* - row (Number): The row to start at
|
702
|
-
* - column (Number): The column to start at
|
703
|
-
*
|
704
788
|
* Given a starting row and column, this method returns the `Range` of the first word boundary it finds.
|
789
|
+
* @param {Number} row The row to start at
|
790
|
+
* @param {Number} column The column to start at
|
705
791
|
*
|
792
|
+
* @returns {Range}
|
706
793
|
**/
|
707
794
|
this.getWordRange = function(row, column) {
|
708
795
|
var line = this.getLine(row);
|
@@ -739,11 +826,11 @@ var EditSession = function(text, mode) {
|
|
739
826
|
};
|
740
827
|
|
741
828
|
/**
|
742
|
-
* EditSession.getAWordRange(row, column) -> Range
|
743
|
-
* - row (Number): The row number to start from
|
744
|
-
* - column (Number): The column number to start from
|
745
|
-
*
|
746
829
|
* Gets the range of a word, including its right whitespace.
|
830
|
+
* @param {Number} row The row number to start from
|
831
|
+
* @param {Number} column The column number to start from
|
832
|
+
*
|
833
|
+
* @return Range
|
747
834
|
**/
|
748
835
|
this.getAWordRange = function(row, column) {
|
749
836
|
var wordRange = this.getWordRange(row, column);
|
@@ -755,20 +842,22 @@ var EditSession = function(text, mode) {
|
|
755
842
|
return wordRange;
|
756
843
|
};
|
757
844
|
|
758
|
-
/**
|
759
|
-
* EditSession.setNewLineMode(newLineMode)
|
760
|
-
* - newLineMode (String): {:Document.setNewLineMode.param}
|
761
|
-
*
|
845
|
+
/**
|
762
846
|
* {:Document.setNewLineMode.desc}
|
847
|
+
* @param {String} newLineMode {:Document.setNewLineMode.param}
|
848
|
+
*
|
849
|
+
*
|
850
|
+
* @related Document.setNewLineMode
|
763
851
|
**/
|
764
852
|
this.setNewLineMode = function(newLineMode) {
|
765
853
|
this.doc.setNewLineMode(newLineMode);
|
766
854
|
};
|
767
855
|
|
768
|
-
/**
|
769
|
-
* EditSession.getNewLineMode() -> String
|
856
|
+
/**
|
770
857
|
*
|
771
858
|
* Returns the current new line mode.
|
859
|
+
* @returns String
|
860
|
+
* @related Document.getNewLineMode
|
772
861
|
**/
|
773
862
|
this.getNewLineMode = function() {
|
774
863
|
return this.doc.getNewLineMode();
|
@@ -777,10 +866,8 @@ var EditSession = function(text, mode) {
|
|
777
866
|
this.$useWorker = true;
|
778
867
|
|
779
868
|
/**
|
780
|
-
* EditSession.setUseWorker(useWorker)
|
781
|
-
* - useWorker (Boolean): Set to `true` to use a worker
|
782
|
-
*
|
783
869
|
* Identifies if you want to use a worker for the `EditSession`.
|
870
|
+
* @param {Boolean} useWorker Set to `true` to use a worker
|
784
871
|
*
|
785
872
|
**/
|
786
873
|
this.setUseWorker = function(useWorker) {
|
@@ -795,8 +882,6 @@ var EditSession = function(text, mode) {
|
|
795
882
|
};
|
796
883
|
|
797
884
|
/**
|
798
|
-
* EditSession.getUseWorker() -> Boolean
|
799
|
-
*
|
800
885
|
* Returns `true` if workers are being used.
|
801
886
|
**/
|
802
887
|
this.getUseWorker = function() {
|
@@ -804,8 +889,6 @@ var EditSession = function(text, mode) {
|
|
804
889
|
};
|
805
890
|
|
806
891
|
/**
|
807
|
-
* EditSession@onReloadTokenizer(e)
|
808
|
-
*
|
809
892
|
* Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event.
|
810
893
|
**/
|
811
894
|
this.onReloadTokenizer = function(e) {
|
@@ -835,7 +918,7 @@ var EditSession = function(text, mode) {
|
|
835
918
|
if (!this.$mode)
|
836
919
|
this.$setModePlaceholder();
|
837
920
|
|
838
|
-
fetch(function() {
|
921
|
+
fetch(mode, function() {
|
839
922
|
require([mode], done);
|
840
923
|
});
|
841
924
|
|
@@ -852,13 +935,11 @@ var EditSession = function(text, mode) {
|
|
852
935
|
callback(_self.$modes[mode]);
|
853
936
|
}
|
854
937
|
|
855
|
-
function fetch(callback) {
|
938
|
+
function fetch(name, callback) {
|
856
939
|
if (!config.get("packaged"))
|
857
940
|
return callback();
|
858
941
|
|
859
|
-
|
860
|
-
var filename = config.get("modePath") + "/mode-" + base + ".js";
|
861
|
-
net.loadScript(filename, callback);
|
942
|
+
net.loadScript(config.moduleUrl(name, "mode"), callback);
|
862
943
|
}
|
863
944
|
};
|
864
945
|
|
@@ -882,10 +963,8 @@ var EditSession = function(text, mode) {
|
|
882
963
|
};
|
883
964
|
|
884
965
|
/**
|
885
|
-
* EditSession.setMode(mode)
|
886
|
-
* - mode (TextMode): Set a new text mode
|
887
|
-
*
|
888
966
|
* Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted.
|
967
|
+
* @param {TextMode} mode Set a new text mode
|
889
968
|
*
|
890
969
|
**/
|
891
970
|
this.$mode = null;
|
@@ -945,11 +1024,7 @@ var EditSession = function(text, mode) {
|
|
945
1024
|
this._emit("changeMode");
|
946
1025
|
};
|
947
1026
|
|
948
|
-
|
949
|
-
* EditSession.stopWorker()
|
950
|
-
*
|
951
|
-
*
|
952
|
-
**/
|
1027
|
+
|
953
1028
|
this.$stopWorker = function() {
|
954
1029
|
if (this.$worker)
|
955
1030
|
this.$worker.terminate();
|
@@ -957,11 +1032,7 @@ var EditSession = function(text, mode) {
|
|
957
1032
|
this.$worker = null;
|
958
1033
|
};
|
959
1034
|
|
960
|
-
|
961
|
-
* EditSession.$startWorker()
|
962
|
-
*
|
963
|
-
*
|
964
|
-
**/
|
1035
|
+
|
965
1036
|
this.$startWorker = function() {
|
966
1037
|
if (typeof Worker !== "undefined" && !require.noWorker) {
|
967
1038
|
try {
|
@@ -977,9 +1048,8 @@ var EditSession = function(text, mode) {
|
|
977
1048
|
};
|
978
1049
|
|
979
1050
|
/**
|
980
|
-
* EditSession.getMode() -> TextMode
|
981
|
-
*
|
982
1051
|
* Returns the current text mode.
|
1052
|
+
* @returns {TextMode} The current text mode
|
983
1053
|
**/
|
984
1054
|
this.getMode = function() {
|
985
1055
|
return this.$mode;
|
@@ -987,10 +1057,9 @@ var EditSession = function(text, mode) {
|
|
987
1057
|
|
988
1058
|
this.$scrollTop = 0;
|
989
1059
|
/**
|
990
|
-
* EditSession.setScrollTop(scrollTop)
|
991
|
-
* - scrollTop (Number): The new scroll top value
|
992
|
-
*
|
993
1060
|
* This function sets the scroll top value. It also emits the `'changeScrollTop'` event.
|
1061
|
+
* @param {Number} scrollTop The new scroll top value
|
1062
|
+
*
|
994
1063
|
**/
|
995
1064
|
this.setScrollTop = function(scrollTop) {
|
996
1065
|
scrollTop = Math.round(Math.max(0, scrollTop));
|
@@ -1002,9 +1071,8 @@ var EditSession = function(text, mode) {
|
|
1002
1071
|
};
|
1003
1072
|
|
1004
1073
|
/**
|
1005
|
-
* EditSession.getScrollTop() -> Number
|
1006
|
-
*
|
1007
1074
|
* [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop}
|
1075
|
+
* @returns {Number}
|
1008
1076
|
**/
|
1009
1077
|
this.getScrollTop = function() {
|
1010
1078
|
return this.$scrollTop;
|
@@ -1012,8 +1080,6 @@ var EditSession = function(text, mode) {
|
|
1012
1080
|
|
1013
1081
|
this.$scrollLeft = 0;
|
1014
1082
|
/**
|
1015
|
-
* EditSession.setScrollLeft(scrollLeft)
|
1016
|
-
*
|
1017
1083
|
* [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
|
1018
1084
|
**/
|
1019
1085
|
this.setScrollLeft = function(scrollLeft) {
|
@@ -1026,18 +1092,16 @@ var EditSession = function(text, mode) {
|
|
1026
1092
|
};
|
1027
1093
|
|
1028
1094
|
/**
|
1029
|
-
* EditSession.getScrollLeft() -> Number
|
1030
|
-
*
|
1031
1095
|
* [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
|
1096
|
+
* @returns {Number}
|
1032
1097
|
**/
|
1033
1098
|
this.getScrollLeft = function() {
|
1034
1099
|
return this.$scrollLeft;
|
1035
1100
|
};
|
1036
1101
|
|
1037
1102
|
/**
|
1038
|
-
* EditSession.getScreenWidth() -> Number
|
1039
|
-
*
|
1040
1103
|
* Returns the width of the screen.
|
1104
|
+
* @returns {Number}
|
1041
1105
|
**/
|
1042
1106
|
this.getScreenWidth = function() {
|
1043
1107
|
this.$computeWidth();
|
@@ -1063,7 +1127,7 @@ var EditSession = function(text, mode) {
|
|
1063
1127
|
if (i > foldStart) {
|
1064
1128
|
i = foldLine.end.row + 1;
|
1065
1129
|
if (i >= len)
|
1066
|
-
break
|
1130
|
+
break;
|
1067
1131
|
foldLine = this.$foldData[foldIndex++];
|
1068
1132
|
foldStart = foldLine ? foldLine.start.row : Infinity;
|
1069
1133
|
}
|
@@ -1078,55 +1142,53 @@ var EditSession = function(text, mode) {
|
|
1078
1142
|
}
|
1079
1143
|
};
|
1080
1144
|
|
1081
|
-
/**
|
1082
|
-
|
1083
|
-
|
1145
|
+
/**
|
1146
|
+
* Returns a verbatim copy of the given line as it is in the document
|
1147
|
+
* @param {Number} row The row to retrieve from
|
1148
|
+
*
|
1084
1149
|
*
|
1085
|
-
|
1150
|
+
* @returns {String}
|
1086
1151
|
*
|
1087
1152
|
**/
|
1088
1153
|
this.getLine = function(row) {
|
1089
1154
|
return this.doc.getLine(row);
|
1090
1155
|
};
|
1091
1156
|
|
1092
|
-
/**
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1157
|
+
/**
|
1158
|
+
* Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`.
|
1159
|
+
* @param {Number} firstRow The first row index to retrieve
|
1160
|
+
* @param {Number} lastRow The final row index to retrieve
|
1161
|
+
*
|
1162
|
+
* @returns [String]
|
1163
|
+
*
|
1164
|
+
**/
|
1100
1165
|
this.getLines = function(firstRow, lastRow) {
|
1101
1166
|
return this.doc.getLines(firstRow, lastRow);
|
1102
1167
|
};
|
1103
1168
|
|
1104
|
-
/**
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
**/
|
1169
|
+
/**
|
1170
|
+
* Returns the number of rows in the document.
|
1171
|
+
* @returns {Number}
|
1172
|
+
**/
|
1109
1173
|
this.getLength = function() {
|
1110
1174
|
return this.doc.getLength();
|
1111
1175
|
};
|
1112
1176
|
|
1113
|
-
/**
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1177
|
+
/**
|
1178
|
+
* {:Document.getTextRange.desc}
|
1179
|
+
* @param {Range} range The range to work with
|
1180
|
+
*
|
1181
|
+
* @returns {Range}
|
1182
|
+
**/
|
1119
1183
|
this.getTextRange = function(range) {
|
1120
1184
|
return this.doc.getTextRange(range || this.selection.getRange());
|
1121
1185
|
};
|
1122
1186
|
|
1123
|
-
/**
|
1124
|
-
* EditSession.insert(position, text) -> Number
|
1125
|
-
* - position (Number): The position to start inserting at
|
1126
|
-
* - text (String): A chunk of text to insert
|
1127
|
-
* + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`.
|
1128
|
-
*
|
1187
|
+
/**
|
1129
1188
|
* Inserts a block of `text` and the indicated `position`.
|
1189
|
+
* @param {Object} position The position {row, column} to start inserting at
|
1190
|
+
* @param {String} text A chunk of text to insert
|
1191
|
+
* @returns {Object} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`.
|
1130
1192
|
*
|
1131
1193
|
*
|
1132
1194
|
**/
|
@@ -1134,13 +1196,12 @@ var EditSession = function(text, mode) {
|
|
1134
1196
|
return this.doc.insert(position, text);
|
1135
1197
|
};
|
1136
1198
|
|
1137
|
-
/**
|
1138
|
-
* EditSession.remove(range) -> Object
|
1139
|
-
* - range (Range): A specified Range to remove
|
1140
|
-
* + (Object): The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`.
|
1141
|
-
*
|
1199
|
+
/**
|
1142
1200
|
* Removes the `range` from the document.
|
1201
|
+
* @param {Range} range A specified Range to remove
|
1202
|
+
* @returns {Object} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`.
|
1143
1203
|
*
|
1204
|
+
* @related Document.remove
|
1144
1205
|
*
|
1145
1206
|
**/
|
1146
1207
|
this.remove = function(range) {
|
@@ -1148,11 +1209,12 @@ var EditSession = function(text, mode) {
|
|
1148
1209
|
};
|
1149
1210
|
|
1150
1211
|
/**
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1212
|
+
* Reverts previous changes to your document.
|
1213
|
+
* @param {Array} deltas An array of previous changes
|
1214
|
+
* @param {Boolean} dontSelect [If `true`, doesn't select the range of where the change occured]{: #dontSelect}
|
1154
1215
|
*
|
1155
|
-
|
1216
|
+
*
|
1217
|
+
* @returns {Range}
|
1156
1218
|
**/
|
1157
1219
|
this.undoChanges = function(deltas, dontSelect) {
|
1158
1220
|
if (!deltas.length)
|
@@ -1181,11 +1243,12 @@ var EditSession = function(text, mode) {
|
|
1181
1243
|
};
|
1182
1244
|
|
1183
1245
|
/**
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1246
|
+
* Re-implements a previously undone change to your document.
|
1247
|
+
* @param {Array} deltas An array of previous changes
|
1248
|
+
* @param {Boolean} dontSelect {:dontSelect}
|
1249
|
+
*
|
1187
1250
|
*
|
1188
|
-
|
1251
|
+
* @returns {Range}
|
1189
1252
|
**/
|
1190
1253
|
this.redoChanges = function(deltas, dontSelect) {
|
1191
1254
|
if (!deltas.length)
|
@@ -1210,20 +1273,14 @@ var EditSession = function(text, mode) {
|
|
1210
1273
|
};
|
1211
1274
|
|
1212
1275
|
/**
|
1213
|
-
|
1214
|
-
|
1276
|
+
* Enables or disables highlighting of the range where an undo occured.
|
1277
|
+
* @param {Boolean} enable If `true`, selects the range of the reinserted change
|
1215
1278
|
*
|
1216
|
-
* ENables or disables highlighting of the range where an undo occured.
|
1217
1279
|
**/
|
1218
1280
|
this.setUndoSelect = function(enable) {
|
1219
1281
|
this.$undoSelect = enable;
|
1220
1282
|
};
|
1221
1283
|
|
1222
|
-
/** internal, hide
|
1223
|
-
* EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range
|
1224
|
-
*
|
1225
|
-
*
|
1226
|
-
**/
|
1227
1284
|
this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) {
|
1228
1285
|
function isInsert(delta) {
|
1229
1286
|
var insert =
|
@@ -1276,20 +1333,24 @@ var EditSession = function(text, mode) {
|
|
1276
1333
|
}
|
1277
1334
|
|
1278
1335
|
return range;
|
1279
|
-
}
|
1280
|
-
|
1281
|
-
/**
|
1282
|
-
*
|
1283
|
-
*
|
1284
|
-
*
|
1285
|
-
*
|
1286
|
-
*
|
1287
|
-
*
|
1336
|
+
};
|
1337
|
+
|
1338
|
+
/**
|
1339
|
+
* Replaces a range in the document with the new `text`.
|
1340
|
+
*
|
1341
|
+
* @param {Range} range A specified Range to replace
|
1342
|
+
* @param {String} text The new text to use as a replacement
|
1343
|
+
* @returns {Object} An object containing the final row and column, like this:
|
1344
|
+
* ```
|
1345
|
+
* {row: endRow, column: 0}
|
1346
|
+
* ```
|
1347
|
+
* If the text and range are empty, this function returns an object containing the current `range.start` value.
|
1288
1348
|
* If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value.
|
1289
1349
|
*
|
1290
|
-
* Replaces a range in the document with the new `text`.
|
1291
1350
|
*
|
1292
1351
|
*
|
1352
|
+
* @related Document.replace
|
1353
|
+
*
|
1293
1354
|
*
|
1294
1355
|
**/
|
1295
1356
|
this.replace = function(range, text) {
|
@@ -1297,13 +1358,13 @@ var EditSession = function(text, mode) {
|
|
1297
1358
|
};
|
1298
1359
|
|
1299
1360
|
/**
|
1300
|
-
* EditSession.moveText(fromRange, toPosition) -> Range
|
1301
|
-
* - fromRange (Range): The range of text you want moved within the document
|
1302
|
-
* - toPosition (Object): The location (row and column) where you want to move the text to
|
1303
|
-
* + (Range): The new range where the text was moved to.
|
1304
1361
|
* Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this:
|
1305
|
-
|
1362
|
+
* ```json
|
1306
1363
|
* { row: newRowLocation, column: newColumnLocation }
|
1364
|
+
* ```
|
1365
|
+
* @param {Range} fromRange The range of text you want moved within the document
|
1366
|
+
* @param {Object} toPosition The location (row and column) where you want to move the text to
|
1367
|
+
* @returns {Range} The new range where the text was moved to.
|
1307
1368
|
*
|
1308
1369
|
*
|
1309
1370
|
*
|
@@ -1339,14 +1400,13 @@ var EditSession = function(text, mode) {
|
|
1339
1400
|
};
|
1340
1401
|
|
1341
1402
|
/**
|
1342
|
-
* EditSession.indentRows(startRow, endRow, indentString)
|
1343
|
-
* - startRow (Number): Starting row
|
1344
|
-
* - endRow (Number): Ending row
|
1345
|
-
* - indentString (String): The indent token
|
1346
|
-
*
|
1347
1403
|
* Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`.
|
1348
1404
|
*
|
1349
1405
|
* If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]].
|
1406
|
+
* @param {Number} startRow Starting row
|
1407
|
+
* @param {Number} endRow Ending row
|
1408
|
+
* @param {String} indentString The indent token
|
1409
|
+
*
|
1350
1410
|
*
|
1351
1411
|
**/
|
1352
1412
|
this.indentRows = function(startRow, endRow, indentString) {
|
@@ -1356,10 +1416,9 @@ var EditSession = function(text, mode) {
|
|
1356
1416
|
};
|
1357
1417
|
|
1358
1418
|
/**
|
1359
|
-
* EditSession.outdentRows(range)
|
1360
|
-
* - range (Range): A range of rows
|
1361
|
-
*
|
1362
1419
|
* Outdents all the rows defined by the `start` and `end` properties of `range`.
|
1420
|
+
* @param {Range} range A range of rows
|
1421
|
+
*
|
1363
1422
|
*
|
1364
1423
|
**/
|
1365
1424
|
this.outdentRows = function (range) {
|
@@ -1386,14 +1445,13 @@ var EditSession = function(text, mode) {
|
|
1386
1445
|
}
|
1387
1446
|
};
|
1388
1447
|
|
1389
|
-
/**
|
1390
|
-
* EditSession.moveLinesUp(firstRow, lastRow) -> Number
|
1391
|
-
* - firstRow (Number): The starting row to move up
|
1392
|
-
* - lastRow (Number): The final row to move up
|
1393
|
-
* + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
1394
|
-
*
|
1448
|
+
/**
|
1395
1449
|
* Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`.
|
1450
|
+
* @param {Number} firstRow The starting row to move up
|
1451
|
+
* @param {Number} lastRow The final row to move up
|
1452
|
+
* @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
1396
1453
|
*
|
1454
|
+
* @related Document.insertLines
|
1397
1455
|
*
|
1398
1456
|
**/
|
1399
1457
|
this.moveLinesUp = function(firstRow, lastRow) {
|
@@ -1404,14 +1462,15 @@ var EditSession = function(text, mode) {
|
|
1404
1462
|
return -1;
|
1405
1463
|
};
|
1406
1464
|
|
1407
|
-
/**
|
1408
|
-
*
|
1409
|
-
*
|
1410
|
-
*
|
1411
|
-
*
|
1465
|
+
/**
|
1466
|
+
* Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`.
|
1467
|
+
* @param {Number} firstRow The starting row to move down
|
1468
|
+
* @param {Number} lastRow The final row to move down
|
1469
|
+
* @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
1412
1470
|
*
|
1413
1471
|
*
|
1414
1472
|
*
|
1473
|
+
* @related Document.insertLines
|
1415
1474
|
**/
|
1416
1475
|
this.moveLinesDown = function(firstRow, lastRow) {
|
1417
1476
|
if (lastRow >= this.doc.getLength()-1) return 0;
|
@@ -1422,13 +1481,10 @@ var EditSession = function(text, mode) {
|
|
1422
1481
|
};
|
1423
1482
|
|
1424
1483
|
/**
|
1425
|
-
* EditSession.duplicateLines(firstRow, lastRow) -> Number
|
1426
|
-
* - firstRow (Number): The starting row to duplicate
|
1427
|
-
* - lastRow (Number): The final row to duplicate
|
1428
|
-
* + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`.
|
1429
|
-
*
|
1430
1484
|
* Duplicates all the text between `firstRow` and `lastRow`.
|
1431
|
-
*
|
1485
|
+
* @param {Number} firstRow The starting row to duplicate
|
1486
|
+
* @param {Number} lastRow The final row to duplicate
|
1487
|
+
* @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`.
|
1432
1488
|
*
|
1433
1489
|
*
|
1434
1490
|
**/
|
@@ -1480,7 +1536,7 @@ var EditSession = function(text, mode) {
|
|
1480
1536
|
this.$clipRangeToDocument = function(range) {
|
1481
1537
|
if (range.start.row < 0) {
|
1482
1538
|
range.start.row = 0;
|
1483
|
-
range.start.column = 0
|
1539
|
+
range.start.column = 0;
|
1484
1540
|
} else {
|
1485
1541
|
range.start.column = this.$clipColumnToRow(
|
1486
1542
|
range.start.row,
|
@@ -1510,10 +1566,10 @@ var EditSession = function(text, mode) {
|
|
1510
1566
|
};
|
1511
1567
|
|
1512
1568
|
/**
|
1513
|
-
|
1514
|
-
|
1569
|
+
* Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted.
|
1570
|
+
* @param {Boolean} useWrapMode Enable (or disable) wrap mode
|
1571
|
+
*
|
1515
1572
|
*
|
1516
|
-
* Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted.
|
1517
1573
|
**/
|
1518
1574
|
this.setUseWrapMode = function(useWrapMode) {
|
1519
1575
|
if (useWrapMode != this.$useWrapMode) {
|
@@ -1536,9 +1592,8 @@ var EditSession = function(text, mode) {
|
|
1536
1592
|
};
|
1537
1593
|
|
1538
1594
|
/**
|
1539
|
-
* EditSession.getUseWrapMode() -> Boolean
|
1540
|
-
*
|
1541
1595
|
* Returns `true` if wrap mode is being used; `false` otherwise.
|
1596
|
+
* @returns {Boolean}
|
1542
1597
|
**/
|
1543
1598
|
this.getUseWrapMode = function() {
|
1544
1599
|
return this.$useWrapMode;
|
@@ -1549,11 +1604,11 @@ var EditSession = function(text, mode) {
|
|
1549
1604
|
// in that direction. Or set both parameters to the same number to pin
|
1550
1605
|
// the limit to that value.
|
1551
1606
|
/**
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1607
|
+
* Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event.
|
1608
|
+
* @param {Number} min The minimum wrap value (the left side wrap)
|
1609
|
+
* @param {Number} max The maximum wrap value (the right side wrap)
|
1610
|
+
*
|
1555
1611
|
*
|
1556
|
-
* Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event.
|
1557
1612
|
**/
|
1558
1613
|
this.setWrapLimitRange = function(min, max) {
|
1559
1614
|
if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
|
@@ -1565,11 +1620,13 @@ var EditSession = function(text, mode) {
|
|
1565
1620
|
}
|
1566
1621
|
};
|
1567
1622
|
|
1568
|
-
/**
|
1569
|
-
* EditSession.adjustWrapLimit(desiredLimit) -> Boolean
|
1570
|
-
* - desiredLimit (Number): The new wrap limit
|
1571
|
-
*
|
1623
|
+
/**
|
1572
1624
|
* This should generally only be called by the renderer when a resize is detected.
|
1625
|
+
* @param {Number} desiredLimit The new wrap limit
|
1626
|
+
* @returns {Boolean}
|
1627
|
+
*
|
1628
|
+
*
|
1629
|
+
* @private
|
1573
1630
|
**/
|
1574
1631
|
this.adjustWrapLimit = function(desiredLimit) {
|
1575
1632
|
var wrapLimit = this.$constrainWrapLimit(desiredLimit);
|
@@ -1578,7 +1635,7 @@ var EditSession = function(text, mode) {
|
|
1578
1635
|
this.$modified = true;
|
1579
1636
|
if (this.$useWrapMode) {
|
1580
1637
|
this.$updateWrapData(0, this.getLength() - 1);
|
1581
|
-
this.$resetRowCache(0)
|
1638
|
+
this.$resetRowCache(0);
|
1582
1639
|
this._emit("changeWrapLimit");
|
1583
1640
|
}
|
1584
1641
|
return true;
|
@@ -1586,11 +1643,6 @@ var EditSession = function(text, mode) {
|
|
1586
1643
|
return false;
|
1587
1644
|
};
|
1588
1645
|
|
1589
|
-
/** internal, hide
|
1590
|
-
* EditSession.$constrainWrapLimit(wrapLimit)
|
1591
|
-
*
|
1592
|
-
*
|
1593
|
-
**/
|
1594
1646
|
this.$constrainWrapLimit = function(wrapLimit) {
|
1595
1647
|
var min = this.$wrapLimitRange.min;
|
1596
1648
|
if (min)
|
@@ -1605,8 +1657,6 @@ var EditSession = function(text, mode) {
|
|
1605
1657
|
};
|
1606
1658
|
|
1607
1659
|
/**
|
1608
|
-
* EditSession.getWrapLimit() -> Number
|
1609
|
-
*
|
1610
1660
|
* Returns the value of wrap limit.
|
1611
1661
|
**/
|
1612
1662
|
this.getWrapLimit = function() {
|
@@ -1614,12 +1664,11 @@ var EditSession = function(text, mode) {
|
|
1614
1664
|
};
|
1615
1665
|
|
1616
1666
|
/**
|
1617
|
-
* EditSession.getWrapLimitRange() -> Object
|
1618
|
-
*
|
1619
1667
|
* Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:
|
1620
1668
|
*
|
1621
1669
|
* { min: wrapLimitRange_min, max: wrapLimitRange_max }
|
1622
1670
|
*
|
1671
|
+
* @returns {Object}
|
1623
1672
|
**/
|
1624
1673
|
this.getWrapLimitRange = function() {
|
1625
1674
|
// Avoid unexpected mutation by returning a copy
|
@@ -1629,11 +1678,6 @@ var EditSession = function(text, mode) {
|
|
1629
1678
|
};
|
1630
1679
|
};
|
1631
1680
|
|
1632
|
-
/** internal, hide
|
1633
|
-
* EditSession.$updateInternalDataOnChange()
|
1634
|
-
*
|
1635
|
-
*
|
1636
|
-
**/
|
1637
1681
|
this.$updateInternalDataOnChange = function(e) {
|
1638
1682
|
var useWrapMode = this.$useWrapMode;
|
1639
1683
|
var len;
|
@@ -1757,16 +1801,10 @@ var EditSession = function(text, mode) {
|
|
1757
1801
|
};
|
1758
1802
|
|
1759
1803
|
this.$updateRowLengthCache = function(firstRow, lastRow, b) {
|
1760
|
-
//console.log(firstRow, lastRow, b)
|
1761
1804
|
this.$rowLengthCache[firstRow] = null;
|
1762
1805
|
this.$rowLengthCache[lastRow] = null;
|
1763
|
-
//console.log(this.$rowLengthCache)
|
1764
1806
|
};
|
1765
1807
|
|
1766
|
-
/** internal, hide
|
1767
|
-
* EditSession.$updateWrapData(firstRow, lastRow)
|
1768
|
-
*
|
1769
|
-
**/
|
1770
1808
|
this.$updateWrapData = function(firstRow, lastRow) {
|
1771
1809
|
var lines = this.doc.getAllLines();
|
1772
1810
|
var tabSize = this.getTabSize();
|
@@ -1785,10 +1823,9 @@ var EditSession = function(text, mode) {
|
|
1785
1823
|
row ++;
|
1786
1824
|
} else {
|
1787
1825
|
tokens = [];
|
1788
|
-
foldLine.walk(
|
1789
|
-
function(placeholder, row, column, lastColumn) {
|
1826
|
+
foldLine.walk(function(placeholder, row, column, lastColumn) {
|
1790
1827
|
var walkTokens;
|
1791
|
-
if (placeholder) {
|
1828
|
+
if (placeholder != null) {
|
1792
1829
|
walkTokens = this.$getDisplayTokens(
|
1793
1830
|
placeholder, tokens.length);
|
1794
1831
|
walkTokens[0] = PLACEHOLDER_START;
|
@@ -1826,11 +1863,7 @@ var EditSession = function(text, mode) {
|
|
1826
1863
|
TAB = 11,
|
1827
1864
|
TAB_SPACE = 12;
|
1828
1865
|
|
1829
|
-
|
1830
|
-
* EditSession.$computeWrapSplits(tokens, wrapLimit) -> Array
|
1831
|
-
*
|
1832
|
-
*
|
1833
|
-
**/
|
1866
|
+
|
1834
1867
|
this.$computeWrapSplits = function(tokens, wrapLimit) {
|
1835
1868
|
if (tokens.length == 0) {
|
1836
1869
|
return [];
|
@@ -1945,14 +1978,14 @@ var EditSession = function(text, mode) {
|
|
1945
1978
|
addSplit(split);
|
1946
1979
|
}
|
1947
1980
|
return splits;
|
1948
|
-
}
|
1981
|
+
};
|
1949
1982
|
|
1950
|
-
/**
|
1951
|
-
* EditSession.$getDisplayTokens(str, offset) -> Array
|
1952
|
-
* - str (String): The string to check
|
1953
|
-
* - offset (Number): The value to start at
|
1954
|
-
*
|
1983
|
+
/**
|
1955
1984
|
* Given a string, returns an array of the display characters, including tabs and spaces.
|
1985
|
+
* @param {String} str The string to check
|
1986
|
+
* @param {Number} offset The value to start at
|
1987
|
+
*
|
1988
|
+
*
|
1956
1989
|
**/
|
1957
1990
|
this.$getDisplayTokens = function(str, offset) {
|
1958
1991
|
var arr = [];
|
@@ -1983,18 +2016,18 @@ var EditSession = function(text, mode) {
|
|
1983
2016
|
}
|
1984
2017
|
}
|
1985
2018
|
return arr;
|
1986
|
-
}
|
2019
|
+
};
|
1987
2020
|
|
1988
|
-
/**
|
1989
|
-
|
1990
|
-
*
|
1991
|
-
*
|
1992
|
-
*
|
1993
|
-
*
|
2021
|
+
/**
|
2022
|
+
* Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen.
|
2023
|
+
* @param {String} str The string to calculate the screen width of
|
2024
|
+
* @param {Number} maxScreenColumn
|
2025
|
+
* @param {Number} screenColumn
|
2026
|
+
* @returns {[Number]} Returns an `int[]` array with two elements:<br/>
|
1994
2027
|
* The first position indicates the number of columns for `str` on screen.<br/>
|
1995
2028
|
* The second value contains the position of the document column that this function read until.
|
1996
2029
|
*
|
1997
|
-
*
|
2030
|
+
*
|
1998
2031
|
*
|
1999
2032
|
*
|
2000
2033
|
**/
|
@@ -2019,19 +2052,18 @@ var EditSession = function(text, mode) {
|
|
2019
2052
|
screenColumn += 1;
|
2020
2053
|
}
|
2021
2054
|
if (screenColumn > maxScreenColumn) {
|
2022
|
-
break
|
2055
|
+
break;
|
2023
2056
|
}
|
2024
2057
|
}
|
2025
2058
|
|
2026
2059
|
return [screenColumn, column];
|
2027
|
-
}
|
2060
|
+
};
|
2028
2061
|
|
2029
2062
|
/**
|
2030
|
-
*
|
2031
|
-
*
|
2032
|
-
*
|
2063
|
+
* Returns number of screenrows in a wrapped line.
|
2064
|
+
* @param {Number} row The row number to check
|
2033
2065
|
*
|
2034
|
-
*
|
2066
|
+
* @returns {Number}
|
2035
2067
|
**/
|
2036
2068
|
this.getRowLength = function(row) {
|
2037
2069
|
if (!this.$useWrapMode || !this.$wrapData[row]) {
|
@@ -2039,44 +2071,36 @@ var EditSession = function(text, mode) {
|
|
2039
2071
|
} else {
|
2040
2072
|
return this.$wrapData[row].length + 1;
|
2041
2073
|
}
|
2042
|
-
}
|
2074
|
+
};
|
2043
2075
|
|
2044
|
-
/**
|
2045
|
-
|
2046
|
-
|
2047
|
-
* - row (Number): The row number to check
|
2076
|
+
/**
|
2077
|
+
* Returns the position (on screen) for the last character in the provided screen row.
|
2078
|
+
* @param {Number} screenRow The screen row to check
|
2048
2079
|
*
|
2049
|
-
* Returns the height of the indicated row. This is mostly relevant for situations where wrapping occurs, and a single line spans across multiple rows.
|
2050
|
-
*
|
2051
|
-
**/
|
2052
|
-
this.getRowHeight = function(config, row) {
|
2053
|
-
return this.getRowLength(row) * config.lineHeight;
|
2054
|
-
}
|
2055
|
-
|
2056
|
-
/** internal, hide, related to: EditSession.documentToScreenColumn
|
2057
|
-
* EditSession.getScreenLastRowColumn(screenRow) -> Number
|
2058
|
-
* - screenRow (Number): The screen row to check
|
2059
2080
|
*
|
2060
|
-
|
2081
|
+
* @related EditSession.documentToScreenColumn
|
2061
2082
|
**/
|
2062
2083
|
this.getScreenLastRowColumn = function(screenRow) {
|
2063
|
-
var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE)
|
2084
|
+
var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
|
2064
2085
|
return this.documentToScreenColumn(pos.row, pos.column);
|
2065
2086
|
};
|
2066
2087
|
|
2067
|
-
/**
|
2068
|
-
*
|
2069
|
-
*
|
2070
|
-
* - docColumn (Number):
|
2088
|
+
/**
|
2089
|
+
* For the given document row and column, this returns the column position of the last screen row.
|
2090
|
+
* @param {Number} docRow
|
2071
2091
|
*
|
2092
|
+
* @param {Number} docColumn
|
2072
2093
|
**/
|
2073
2094
|
this.getDocumentLastRowColumn = function(docRow, docColumn) {
|
2074
2095
|
var screenRow = this.documentToScreenRow(docRow, docColumn);
|
2075
2096
|
return this.getScreenLastRowColumn(screenRow);
|
2076
2097
|
};
|
2077
2098
|
|
2078
|
-
/**
|
2079
|
-
*
|
2099
|
+
/**
|
2100
|
+
* For the given document row and column, this returns the document position of the last row.
|
2101
|
+
* @param {Number} docRow
|
2102
|
+
* @param {Number} docColumn
|
2103
|
+
*
|
2080
2104
|
*
|
2081
2105
|
**/
|
2082
2106
|
this.getDocumentLastRowColumnPosition = function(docRow, docColumn) {
|
@@ -2084,9 +2108,9 @@ var EditSession = function(text, mode) {
|
|
2084
2108
|
return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);
|
2085
2109
|
};
|
2086
2110
|
|
2087
|
-
/**
|
2088
|
-
*
|
2089
|
-
*
|
2111
|
+
/**
|
2112
|
+
* For the given row, this returns the split data.
|
2113
|
+
* @returns {String}
|
2090
2114
|
**/
|
2091
2115
|
this.getRowSplitData = function(row) {
|
2092
2116
|
if (!this.$useWrapMode) {
|
@@ -2097,41 +2121,34 @@ var EditSession = function(text, mode) {
|
|
2097
2121
|
};
|
2098
2122
|
|
2099
2123
|
/**
|
2100
|
-
* EditSession.getScreenTabSize(screenColumn) -> Number
|
2101
|
-
* - screenColumn (Number): The screen column to check
|
2102
|
-
*
|
2103
2124
|
* The distance to the next tab stop at the specified screen column.
|
2125
|
+
* @param {Number} screenColumn The screen column to check
|
2126
|
+
*
|
2127
|
+
*
|
2128
|
+
* @returns {Number}
|
2104
2129
|
**/
|
2105
2130
|
this.getScreenTabSize = function(screenColumn) {
|
2106
2131
|
return this.$tabSize - screenColumn % this.$tabSize;
|
2107
2132
|
};
|
2108
2133
|
|
2109
|
-
|
2110
|
-
* EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number
|
2111
|
-
*
|
2112
|
-
*
|
2113
|
-
**/
|
2134
|
+
|
2114
2135
|
this.screenToDocumentRow = function(screenRow, screenColumn) {
|
2115
2136
|
return this.screenToDocumentPosition(screenRow, screenColumn).row;
|
2116
2137
|
};
|
2117
2138
|
|
2118
|
-
|
2119
|
-
* EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number
|
2120
|
-
*
|
2121
|
-
*
|
2122
|
-
**/
|
2139
|
+
|
2123
2140
|
this.screenToDocumentColumn = function(screenRow, screenColumn) {
|
2124
2141
|
return this.screenToDocumentPosition(screenRow, screenColumn).column;
|
2125
2142
|
};
|
2126
2143
|
|
2127
|
-
/**
|
2128
|
-
* EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object
|
2129
|
-
* - screenRow (Number): The screen row to check
|
2130
|
-
* - screenColumn (Number): The screen column to check
|
2131
|
-
* + (Object): The object returned has two properties: `row` and `column`.
|
2132
|
-
*
|
2144
|
+
/**
|
2133
2145
|
* Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations}
|
2146
|
+
* @param {Number} screenRow The screen row to check
|
2147
|
+
* @param {Number} screenColumn The screen column to check
|
2148
|
+
* @returns {Object} The object returned has two properties: `row` and `column`.
|
2149
|
+
*
|
2134
2150
|
*
|
2151
|
+
* @related EditSession.documentToScreenPosition
|
2135
2152
|
*
|
2136
2153
|
**/
|
2137
2154
|
this.screenToDocumentPosition = function(screenRow, screenColumn) {
|
@@ -2147,14 +2164,12 @@ var EditSession = function(text, mode) {
|
|
2147
2164
|
|
2148
2165
|
var rowCache = this.$screenRowCache;
|
2149
2166
|
var i = this.$getRowCacheIndex(rowCache, screenRow);
|
2150
|
-
var row1 = rowCache[i];
|
2151
|
-
var docRow1 = this.$docRowCache[i];
|
2152
2167
|
if (0 < i && i < rowCache.length) {
|
2153
2168
|
var row = rowCache[i];
|
2154
2169
|
var docRow = this.$docRowCache[i];
|
2155
2170
|
var doCache = screenRow > row || (screenRow == row && i == rowCache.length - 1);
|
2156
2171
|
} else {
|
2157
|
-
var doCache =
|
2172
|
+
var doCache = i != 0 || !rowCache.length;
|
2158
2173
|
}
|
2159
2174
|
|
2160
2175
|
var maxRow = this.getLength() - 1;
|
@@ -2218,15 +2233,14 @@ var EditSession = function(text, mode) {
|
|
2218
2233
|
return {row: docRow, column: docColumn};
|
2219
2234
|
};
|
2220
2235
|
|
2221
|
-
/**
|
2222
|
-
* EditSession.documentToScreenPosition(docRow, docColumn) -> Object
|
2223
|
-
* - docRow (Number): The document row to check
|
2224
|
-
* - docColumn (Number): The document column to check
|
2225
|
-
* + (Object): The object returned by this method has two properties: `row` and `column`.
|
2226
|
-
*
|
2236
|
+
/**
|
2227
2237
|
* Converts document coordinates to screen coordinates. {:conversionConsiderations}
|
2238
|
+
* @param {Number} docRow The document row to check
|
2239
|
+
* @param {Number} docColumn The document column to check
|
2240
|
+
* @returns {Object} The object returned by this method has two properties: `row` and `column`.
|
2228
2241
|
*
|
2229
2242
|
*
|
2243
|
+
* @related EditSession.screenToDocumentPosition
|
2230
2244
|
*
|
2231
2245
|
**/
|
2232
2246
|
this.documentToScreenPosition = function(docRow, docColumn) {
|
@@ -2260,7 +2274,7 @@ var EditSession = function(text, mode) {
|
|
2260
2274
|
var screenRow = this.$screenRowCache[i];
|
2261
2275
|
var doCache = docRow > row || (docRow == row && i == rowCache.length - 1);
|
2262
2276
|
} else {
|
2263
|
-
var doCache =
|
2277
|
+
var doCache = i != 0 || !rowCache.length;
|
2264
2278
|
}
|
2265
2279
|
|
2266
2280
|
var foldLine = this.getNextFoldLine(row);
|
@@ -2316,8 +2330,10 @@ var EditSession = function(text, mode) {
|
|
2316
2330
|
};
|
2317
2331
|
};
|
2318
2332
|
|
2319
|
-
/**
|
2320
|
-
*
|
2333
|
+
/**
|
2334
|
+
* For the given document row and column, returns the screen column.
|
2335
|
+
* @param {Number} row
|
2336
|
+
* @param {Number} docColumn
|
2321
2337
|
*
|
2322
2338
|
*
|
2323
2339
|
**/
|
@@ -2325,8 +2341,10 @@ var EditSession = function(text, mode) {
|
|
2325
2341
|
return this.documentToScreenPosition(row, docColumn).column;
|
2326
2342
|
};
|
2327
2343
|
|
2328
|
-
/**
|
2329
|
-
*
|
2344
|
+
/**
|
2345
|
+
* For the given document row and column, returns the screen row.
|
2346
|
+
* @param {Number} docRow
|
2347
|
+
* @param {Number} docColumn
|
2330
2348
|
*
|
2331
2349
|
*
|
2332
2350
|
**/
|
@@ -2335,9 +2353,8 @@ var EditSession = function(text, mode) {
|
|
2335
2353
|
};
|
2336
2354
|
|
2337
2355
|
/**
|
2338
|
-
* EditSession.getScreenLength() -> Number
|
2339
|
-
*
|
2340
2356
|
* Returns the length of the screen.
|
2357
|
+
* @returns {Number}
|
2341
2358
|
**/
|
2342
2359
|
this.getScreenLength = function() {
|
2343
2360
|
var screenRows = 0;
|