inc_gollum 4.1.2c
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CONTRIBUTING.md +91 -0
- data/Gemfile +4 -0
- data/HISTORY.md +138 -0
- data/LICENSE +21 -0
- data/README.md +177 -0
- data/Rakefile +179 -0
- data/bin/inc_gollum +295 -0
- data/config.rb +11 -0
- data/config.ru +12 -0
- data/contrib/openrc/conf.d/gollum +3 -0
- data/contrib/openrc/init.d/gollum +36 -0
- data/contrib/systemd/gollum@.service +12 -0
- data/contrib/sysv-debian/init.d/gollum +79 -0
- data/gollum.gemspec +1089 -0
- data/lib/gollum.rb +41 -0
- data/lib/gollum/app.rb +652 -0
- data/lib/gollum/helpers.rb +68 -0
- data/lib/gollum/public/gollum/css/_styles.css +143 -0
- data/lib/gollum/public/gollum/css/dialog.css +253 -0
- data/lib/gollum/public/gollum/css/editor.css +697 -0
- data/lib/gollum/public/gollum/css/gollum.css +857 -0
- data/lib/gollum/public/gollum/css/ie7.css +75 -0
- data/lib/gollum/public/gollum/css/print.css +14 -0
- data/lib/gollum/public/gollum/css/template.css +882 -0
- data/lib/gollum/public/gollum/fonts/FontAwesome.otf +0 -0
- data/lib/gollum/public/gollum/fonts/fontawesome-webfont.eot +0 -0
- data/lib/gollum/public/gollum/fonts/fontawesome-webfont.svg +414 -0
- data/lib/gollum/public/gollum/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/gollum/public/gollum/fonts/fontawesome-webfont.woff +0 -0
- data/lib/gollum/public/gollum/images/dirty-shade.png +0 -0
- data/lib/gollum/public/gollum/images/fileview/document.png +0 -0
- data/lib/gollum/public/gollum/images/fileview/folder-horizontal.png +0 -0
- data/lib/gollum/public/gollum/images/fileview/toggle-small-expand.png +0 -0
- data/lib/gollum/public/gollum/images/fileview/toggle-small.png +0 -0
- data/lib/gollum/public/gollum/images/fileview/trashcan.png +0 -0
- data/lib/gollum/public/gollum/images/icon-sprite.png +0 -0
- data/lib/gollum/public/gollum/images/man_24.png +0 -0
- data/lib/gollum/public/gollum/images/para.png +0 -0
- data/lib/gollum/public/gollum/images/pin-16.png +0 -0
- data/lib/gollum/public/gollum/images/pin-20.png +0 -0
- data/lib/gollum/public/gollum/images/pin-24.png +0 -0
- data/lib/gollum/public/gollum/images/pin-32.png +0 -0
- data/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +1193 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/asciidoc.js +183 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/creole.js +105 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/markdown.js +228 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/org.js +174 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/pod.js +112 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/rdoc.js +74 -0
- data/lib/gollum/public/gollum/javascript/editor/langs/textile.js +176 -0
- data/lib/gollum/public/gollum/javascript/gollum.dialog.js +319 -0
- data/lib/gollum/public/gollum/javascript/gollum.js +333 -0
- data/lib/gollum/public/gollum/javascript/gollum.placeholder.js +54 -0
- data/lib/gollum/public/gollum/javascript/identicon_canvas.js +111 -0
- data/lib/gollum/public/gollum/javascript/jquery-1.7.2.min.js +4 -0
- data/lib/gollum/public/gollum/javascript/jquery.color.js +123 -0
- data/lib/gollum/public/gollum/javascript/mousetrap.min.js +8 -0
- data/lib/gollum/public/gollum/livepreview/css/custom.css +132 -0
- data/lib/gollum/public/gollum/livepreview/images/cancel_24.png +0 -0
- data/lib/gollum/public/gollum/livepreview/images/globe_24.png +0 -0
- data/lib/gollum/public/gollum/livepreview/images/lr_24.png +0 -0
- data/lib/gollum/public/gollum/livepreview/images/save_24.png +0 -0
- data/lib/gollum/public/gollum/livepreview/images/savecomment_24.png +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js +129 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js +245 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +223 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete.js +497 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/popup.js +341 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/text_completer.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/util.js +74 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +250 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +85 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +118 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +199 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +721 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/incremental_search_commands.js +232 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/occur_commands.js +110 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js +202 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config_test.js +135 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +422 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js +645 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document_test.js +306 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +2551 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +221 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +140 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +269 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +859 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +1075 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js +2693 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +188 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +223 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +164 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +557 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify/php_rules.js +366 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/chromevox.js +980 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/elastic_tabstops_lite.js +319 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/emmet.js +434 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/error_marker.js +214 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/keybinding_menu.js +86 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/language_tools.js +226 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/linking.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/add_editor_menu_options.js +109 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/element_generator.js +148 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/generate_settings_menu.js +264 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js +91 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_set_functions.js +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/overlay_page.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/settings_menu.css +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/modelist.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie_test.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.css +153 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.js +308 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/settings_menu.js +76 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/spellcheck.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/split.js +40 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +31 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +190 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +96 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/statusbar.js +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +521 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/themelist.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace.js +213 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace_test.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search.js +317 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search_test.js +213 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +652 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs_test.js +151 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +231 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +145 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding_test.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +249 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textarea.js +82 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +509 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +6016 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim_test.js +3866 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +240 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/font_metrics.js +176 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +287 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +218 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +575 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +126 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/app_config.js +157 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +284 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +1062 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +367 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +155 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +65 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +19 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +163 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +221 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/line_widgets.js +297 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/Readme.md +9 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/highlight_rules_test.js +210 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json +8 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_asciidoc.txt +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_coffee.txt +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_curly.txt +9 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_html.txt +10 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +86 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_livescript.txt +1 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_lucene.txt +16 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_markdown.txt +22 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_php.txt +24 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_ruby.txt +34 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_xml.txt +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abap.json +189 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abc.json +2207 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_actionscript.json +263 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ada.json +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_asciidoc.json +422 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_assembly_x86.json +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_autohotkey.json +261 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_batchfile.json +70 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +190 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cirru.json +267 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +162 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cobol.json +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +545 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +26 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +31 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +148 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_curly.json +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_d.json +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dart.json +368 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +262 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dot.json +2254 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_eiffel.json +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ejs.json +296 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elixir.json +196 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elm.json +198 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_erlang.json +166 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_forth.json +219 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ftl.json +341 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gcode.json +296 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gherkin.json +142 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gitignore.json +33 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +127 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +256 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +410 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haml.json +174 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_handlebars.json +81 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haskell.json +156 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +143 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +63 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html_ruby.json +257 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ini.json +23 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_io.json +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jack.json +1786 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jade.json +188 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +95 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +593 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +412 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsoniq.json +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsp.json +435 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_julia.json +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +127 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +204 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +551 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lisp.json +248 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_livescript.json +6 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_logiql.json +190 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lsl.json +503 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +348 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +633 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lucene.json +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mask.json +302 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_matlab.json +90 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mel.json +257 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mushcode.json +790 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mysql.json +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_nix.json +360 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_objectivec.json +793 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +200 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pascal.json +297 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +227 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +889 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +171 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +184 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_prolog.json +245 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_properties.json +68 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_protobuf.json +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +152 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_r.json +235 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rdoc.json +441 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rhtml.json +106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +242 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rust.json +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sass.json +229 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +194 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +542 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scheme.json +216 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +123 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +334 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sjs.json +276 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_smarty.json +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_snippets.json +159 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_soy_template.json +286 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_space.json +322 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_stylus.json +271 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +684 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +385 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tex.json +130 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +29 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_toml.json +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_twig.json +288 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_typescript.json +559 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vala.json +158 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vbscript.json +205 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_velocity.json +285 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_verilog.json +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vhdl.json +271 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +43 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +44 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +150 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +134 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc_highlight_rules.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript_highlight_rules.js +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada.js +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada_highlight_rules.js +93 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf_highlight_rules.js +231 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript_highlight_rules.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +64 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +234 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86_highlight_rules.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey_highlight_rules.js +107 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile_highlight_rules.js +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +90 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/behaviour_test.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/css.js +108 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +392 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +46 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +202 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +182 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +101 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +196 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru_highlight_rules.js +125 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +128 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +200 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol.js +53 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol_highlight_rules.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +135 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +271 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +935 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +3106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +724 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +88 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +516 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +174 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +233 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +73 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +93 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +9628 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +179 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +68 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/curly.js +63 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/curly_highlight_rules.js +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/d.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/d_highlight_rules.js +334 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +186 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +108 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/django.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +79 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dockerfile.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dockerfile_highlight_rules.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dot.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dot_highlight_rules.js +126 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/eiffel.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/eiffel_highlight_rules.js +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ejs.js +109 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elixir.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elixir_highlight_rules.js +433 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elm.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elm_highlight_rules.js +162 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/erlang.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/erlang_highlight_rules.js +876 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js +142 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +83 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +101 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/csharp.js +137 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +186 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +109 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +186 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/ini.js +80 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +162 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +163 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js +125 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +83 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/velocity.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +278 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +110 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/forth.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/forth_highlight_rules.js +164 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ftl.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ftl_highlight_rules.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gcode.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gcode_highlight_rules.js +94 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gherkin.js +80 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gherkin_highlight_rules.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gitignore.js +20 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gitignore_highlight_rules.js +31 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js +81 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +108 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +24 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +173 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +132 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/handlebars.js +29 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/handlebars_highlight_rules.js +72 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haskell.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haskell_highlight_rules.js +246 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html/saxparser.js +10430 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_completions.js +305 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_ruby.js +59 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_ruby_highlight_rules.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_worker.js +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ini.js +53 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ini_highlight_rules.js +112 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/io.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/io_highlight_rules.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jack.js +79 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jack_highlight_rules.js +142 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +341 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +24 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +128 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +10846 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +405 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +213 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +185 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/js_regex_highlight_rules.js +94 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +93 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +346 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +102 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsoniq.js +203 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +91 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/julia.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/julia_highlight_rules.js +170 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +26 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +73 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +271 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +82 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +124 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/livescript.js +246 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql_highlight_rules.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql_test.js +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lsl.js +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lsl_highlight_rules.js +123 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +168 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua/luaparse.js +1989 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +193 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_worker.js +70 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +24 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +19 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +75 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +76 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +228 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mask.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mask_highlight_rules.js +309 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +74 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matlab.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matlab_highlight_rules.js +262 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mel.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mel_highlight_rules.js +133 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mushcode.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mushcode_highlight_rules.js +569 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mysql.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mysql_highlight_rules.js +122 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/nix.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/nix_highlight_rules.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +331 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +337 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pascal.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pascal_highlight_rules.js +127 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +90 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +165 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +59 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +619 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +161 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php/php.js +5031 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +1085 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_test.js +65 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_worker.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/plain_text.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/plain_text_test.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +145 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/praat.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/praat_highlight_rules.js +262 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/prolog.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/prolog_highlight_rules.js +238 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/properties.js +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/properties_highlight_rules.js +86 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/protobuf.js +63 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/protobuf_highlight_rules.js +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +191 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +79 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r.js +154 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +208 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +87 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +326 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_test.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rust.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rust_highlight_rules.js +158 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sass.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sass_highlight_rules.js +79 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +99 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +142 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +25 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +160 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scheme.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scheme_highlight_rules.js +123 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +296 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +203 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sjs.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sjs_highlight_rules.js +233 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/smarty.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/smarty_highlight_rules.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/snippets.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/soy_template.js +60 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/soy_template_highlight_rules.js +356 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/space.js +21 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/space_highlight_rules.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +53 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +99 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +165 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +172 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js +68 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +127 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +386 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +234 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +64 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +93 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/toml.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/toml_highlight_rules.js +103 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/twig.js +81 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/twig_highlight_rules.js +166 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vala.js +105 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vala_highlight_rules.js +457 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vbscript.js +60 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vbscript_highlight_rules.js +246 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/velocity.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/velocity_highlight_rules.js +177 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/verilog.js +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/verilog_highlight_rules.js +101 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vhdl.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vhdl_highlight_rules.js +115 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +75 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/dom-parser.js +260 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/dom.js +1138 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/sax.js +592 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +242 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +75 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_worker.js +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +216 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +1 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/jsoniq_lexer.js +4453 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xqlint.js +78911 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery_lexer.js +4422 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +181 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +279 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop_handler.js +428 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +93 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +129 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +205 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler_test.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +211 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +970 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +269 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/occur.js +193 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/occur_test.js +154 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +274 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +157 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range.js +549 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list.js +240 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +182 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_test.js +191 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +75 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text_build.js +60 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +270 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search.js +403 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +82 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_test.js +494 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection.js +955 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +480 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets.js +949 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_.snippets +240 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_all_modes.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_all_modes.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abap.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abap.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abc.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abc.snippets +31 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/actionscript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/actionscript.snippets +157 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ada.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ada.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/all_modes.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/all_modes.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache.snippets +35 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache_conf.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache_conf.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/applescript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/applescript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/asciidoc.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/asciidoc.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/assembly_x86.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/assembly_x86.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autohotkey.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autohotkey.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autoit.snippets +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/batchfile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/batchfile.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c.snippets +235 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c9search.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c9search.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c_cpp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c_cpp.snippets +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/chef.snippets +204 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cirru.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cirru.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/clojure.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/clojure.snippets +90 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cmake.snippets +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cobol.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cobol.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coffee.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coffee.snippets +95 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coldfusion.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coldfusion.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cs.snippets +374 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/csharp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/csharp.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/css.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/css.snippets +967 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/curly.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/curly.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/d.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/d.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dart.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dart.snippets +83 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/diff.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/diff.snippets +11 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/django.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/django.snippets +108 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dockerfile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dockerfile.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dot.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dot.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dummy.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dummy_syntax.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eiffel.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eiffel.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ejs.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ejs.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elixir.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elixir.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elm.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elm.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/erlang.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/erlang.snippets +160 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eruby.snippets +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/falcon.snippets +71 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/forth.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/forth.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ftl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ftl.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gcode.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gcode.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gherkin.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gherkin.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gitignore.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gitignore.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/glsl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/glsl.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/go.snippets +201 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/golang.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/golang.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/groovy.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/groovy.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haml.snippets +20 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/handlebars.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/handlebars.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haskell.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haskell.snippets +82 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haxe.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haxe.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html.snippets +828 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html_ruby.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html_ruby.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/htmldjango.snippets +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/htmltornado.snippets +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ini.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ini.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/io.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/io.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jack.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jack.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jade.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jade.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/java.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/java.snippets +240 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript-jquery.snippets +589 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript.snippets +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/json.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/json.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsoniq.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsoniq.snippets +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsp.snippets +99 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ledger.snippets +5 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.snippets +1066 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.snippets +21 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.snippets +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mako.snippets +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.snippets +88 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objc.snippets +247 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.snippets +347 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.snippets +377 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.snippets +158 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.snippets +121 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rst.snippets +22 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.snippets +928 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.snippets +83 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.snippets +9 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.snippets +26 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.snippets +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.snippets +191 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.snippets +30 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tmsnippet.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.js +8 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.snippets +28 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.snippets +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xslt.snippets +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets_test.js +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js +373 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all.js +35 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +150 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +313 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +529 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +13 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +65 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +10 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +208 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +46 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +221 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js +33 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.css +154 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.js +33 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +154 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +112 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +134 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +143 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +127 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +176 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +38 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +41 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.css +140 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +124 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.css +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +110 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +126 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +122 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +129 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +101 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.css +132 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +155 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +40 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +125 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +125 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +122 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +125 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +128 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +110 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +103 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +150 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +212 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +362 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +183 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_test.js +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tooltip.js +138 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +168 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/unicode.js +107 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +1764 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +86 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +193 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +255 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_test.js +125 -0
- data/lib/gollum/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +2 -0
- data/lib/gollum/public/gollum/livepreview/js/livepreview.js +530 -0
- data/lib/gollum/public/gollum/livepreview/js/md_sundown.js +22 -0
- data/lib/gollum/public/gollum/livepreview/js/requirejs.min.js +35 -0
- data/lib/gollum/public/gollum/livepreview/js/sundown.js +1 -0
- data/lib/gollum/public/gollum/livepreview/licenses/ace/LICENSE.txt +24 -0
- data/lib/gollum/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +9 -0
- data/lib/gollum/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +22 -0
- data/lib/gollum/public/gollum/livepreview/licenses/gollum/LICENSE.txt +21 -0
- data/lib/gollum/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +20 -0
- data/lib/gollum/public/gollum/livepreview/licenses/licenses.txt +69 -0
- data/lib/gollum/public/gollum/livepreview/licenses/notepages/LICENSE.txt +19 -0
- data/lib/gollum/public/gollum/livepreview/licenses/requirejs/LICENSE.txt +58 -0
- data/lib/gollum/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +359 -0
- data/lib/gollum/public/gollum/livepreview/licenses/sizzle/LICENSE.txt +148 -0
- data/lib/gollum/public/gollum/livepreview/licenses/sundown/sundown.txt +4 -0
- data/lib/gollum/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt +40 -0
- data/lib/gollum/public/gollum/livepreview/readme.md +44 -0
- data/lib/gollum/templates/compare.mustache +69 -0
- data/lib/gollum/templates/create.mustache +14 -0
- data/lib/gollum/templates/edit.mustache +12 -0
- data/lib/gollum/templates/editor.mustache +136 -0
- data/lib/gollum/templates/error.mustache +8 -0
- data/lib/gollum/templates/file_view.mustache +34 -0
- data/lib/gollum/templates/history.mustache +60 -0
- data/lib/gollum/templates/history_authors/gravatar.mustache +5 -0
- data/lib/gollum/templates/history_authors/identicon.mustache +5 -0
- data/lib/gollum/templates/history_authors/none.mustache +3 -0
- data/lib/gollum/templates/latest_changes.mustache +39 -0
- data/lib/gollum/templates/layout.mustache +67 -0
- data/lib/gollum/templates/livepreview.mustache +66 -0
- data/lib/gollum/templates/page.mustache +100 -0
- data/lib/gollum/templates/pages.mustache +42 -0
- data/lib/gollum/templates/search.mustache +38 -0
- data/lib/gollum/templates/searchbar.mustache +10 -0
- data/lib/gollum/uri_encode_component.rb +212 -0
- data/lib/gollum/views/compare.rb +94 -0
- data/lib/gollum/views/create.rb +61 -0
- data/lib/gollum/views/edit.rb +77 -0
- data/lib/gollum/views/editable.rb +13 -0
- data/lib/gollum/views/error.rb +7 -0
- data/lib/gollum/views/file_view.rb +19 -0
- data/lib/gollum/views/has_page.rb +15 -0
- data/lib/gollum/views/history.rb +88 -0
- data/lib/gollum/views/latest_changes.rb +90 -0
- data/lib/gollum/views/layout.rb +45 -0
- data/lib/gollum/views/livepreview.rb +13 -0
- data/lib/gollum/views/page.rb +193 -0
- data/lib/gollum/views/pages.rb +78 -0
- data/lib/gollum/views/search.rb +20 -0
- data/licenses/css_tree_menu_thecssninja/license.txt +50 -0
- data/licenses/licenses.txt +52 -0
- data/licenses/unity_asset_pool/COPYRIGHT +286 -0
- metadata +1284 -0
@@ -0,0 +1,306 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
*
|
29
|
+
* ***** END LICENSE BLOCK ***** */
|
30
|
+
|
31
|
+
if (typeof process !== "undefined") {
|
32
|
+
require("amd-loader");
|
33
|
+
require("./test/mockdom");
|
34
|
+
}
|
35
|
+
|
36
|
+
define(function(require, exports, module) {
|
37
|
+
"use strict";
|
38
|
+
|
39
|
+
var Document = require("./document").Document;
|
40
|
+
var Range = require("./range").Range;
|
41
|
+
var assert = require("./test/assertions");
|
42
|
+
|
43
|
+
module.exports = {
|
44
|
+
|
45
|
+
"test: insert text in line" : function() {
|
46
|
+
var doc = new Document(["12", "34"]);
|
47
|
+
|
48
|
+
var deltas = [];
|
49
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
50
|
+
|
51
|
+
doc.insert({row: 0, column: 1}, "juhu");
|
52
|
+
assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n"));
|
53
|
+
|
54
|
+
var d = deltas.concat();
|
55
|
+
doc.revertDeltas(d);
|
56
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
57
|
+
|
58
|
+
doc.applyDeltas(d);
|
59
|
+
assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n"));
|
60
|
+
},
|
61
|
+
|
62
|
+
"test: insert new line" : function() {
|
63
|
+
var doc = new Document(["12", "34"]);
|
64
|
+
|
65
|
+
var deltas = [];
|
66
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
67
|
+
|
68
|
+
doc.insertNewLine({row: 0, column: 1});
|
69
|
+
assert.equal(doc.getValue(), ["1", "2", "34"].join("\n"));
|
70
|
+
|
71
|
+
var d = deltas.concat();
|
72
|
+
doc.revertDeltas(d);
|
73
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
74
|
+
|
75
|
+
doc.applyDeltas(d);
|
76
|
+
assert.equal(doc.getValue(), ["1", "2", "34"].join("\n"));
|
77
|
+
},
|
78
|
+
|
79
|
+
"test: insert lines at the beginning" : function() {
|
80
|
+
var doc = new Document(["12", "34"]);
|
81
|
+
|
82
|
+
var deltas = [];
|
83
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
84
|
+
|
85
|
+
doc.insertLines(0, ["aa", "bb"]);
|
86
|
+
assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n"));
|
87
|
+
|
88
|
+
var d = deltas.concat();
|
89
|
+
doc.revertDeltas(d);
|
90
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
91
|
+
|
92
|
+
doc.applyDeltas(d);
|
93
|
+
assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n"));
|
94
|
+
},
|
95
|
+
|
96
|
+
"test: insert lines at the end" : function() {
|
97
|
+
var doc = new Document(["12", "34"]);
|
98
|
+
|
99
|
+
var deltas = [];
|
100
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
101
|
+
|
102
|
+
doc.insertLines(2, ["aa", "bb"]);
|
103
|
+
assert.equal(doc.getValue(), ["12", "34", "aa", "bb"].join("\n"));
|
104
|
+
},
|
105
|
+
|
106
|
+
"test: insert lines in the middle" : function() {
|
107
|
+
var doc = new Document(["12", "34"]);
|
108
|
+
|
109
|
+
var deltas = [];
|
110
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
111
|
+
|
112
|
+
doc.insertLines(1, ["aa", "bb"]);
|
113
|
+
assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n"));
|
114
|
+
|
115
|
+
var d = deltas.concat();
|
116
|
+
doc.revertDeltas(d);
|
117
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
118
|
+
|
119
|
+
doc.applyDeltas(d);
|
120
|
+
assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n"));
|
121
|
+
},
|
122
|
+
|
123
|
+
"test: insert multi line string at the start" : function() {
|
124
|
+
var doc = new Document(["12", "34"]);
|
125
|
+
|
126
|
+
var deltas = [];
|
127
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
128
|
+
|
129
|
+
doc.insert({row: 0, column: 0}, "aa\nbb\ncc");
|
130
|
+
assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n"));
|
131
|
+
|
132
|
+
var d = deltas.concat();
|
133
|
+
doc.revertDeltas(d);
|
134
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
135
|
+
|
136
|
+
doc.applyDeltas(d);
|
137
|
+
assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n"));
|
138
|
+
},
|
139
|
+
|
140
|
+
"test: insert multi line string at the end" : function() {
|
141
|
+
var doc = new Document(["12", "34"]);
|
142
|
+
|
143
|
+
var deltas = [];
|
144
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
145
|
+
|
146
|
+
doc.insert({row: 2, column: 0}, "aa\nbb\ncc");
|
147
|
+
assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n"));
|
148
|
+
|
149
|
+
var d = deltas.concat();
|
150
|
+
doc.revertDeltas(d);
|
151
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
152
|
+
|
153
|
+
doc.applyDeltas(d);
|
154
|
+
assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n"));
|
155
|
+
},
|
156
|
+
|
157
|
+
"test: insert multi line string in the middle" : function() {
|
158
|
+
var doc = new Document(["12", "34"]);
|
159
|
+
|
160
|
+
var deltas = [];
|
161
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
162
|
+
|
163
|
+
doc.insert({row: 0, column: 1}, "aa\nbb\ncc");
|
164
|
+
assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n"));
|
165
|
+
|
166
|
+
var d = deltas.concat();
|
167
|
+
doc.revertDeltas(d);
|
168
|
+
assert.equal(doc.getValue(), ["12", "34"].join("\n"));
|
169
|
+
|
170
|
+
doc.applyDeltas(d);
|
171
|
+
assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n"));
|
172
|
+
},
|
173
|
+
|
174
|
+
"test: delete in line" : function() {
|
175
|
+
var doc = new Document(["1234", "5678"]);
|
176
|
+
|
177
|
+
var deltas = [];
|
178
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
179
|
+
|
180
|
+
doc.remove(new Range(0, 1, 0, 3));
|
181
|
+
assert.equal(doc.getValue(), ["14", "5678"].join("\n"));
|
182
|
+
|
183
|
+
var d = deltas.concat();
|
184
|
+
doc.revertDeltas(d);
|
185
|
+
assert.equal(doc.getValue(), ["1234", "5678"].join("\n"));
|
186
|
+
|
187
|
+
doc.applyDeltas(d);
|
188
|
+
assert.equal(doc.getValue(), ["14", "5678"].join("\n"));
|
189
|
+
},
|
190
|
+
|
191
|
+
"test: delete new line" : function() {
|
192
|
+
var doc = new Document(["1234", "5678"]);
|
193
|
+
|
194
|
+
var deltas = [];
|
195
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
196
|
+
|
197
|
+
doc.remove(new Range(0, 4, 1, 0));
|
198
|
+
assert.equal(doc.getValue(), ["12345678"].join("\n"));
|
199
|
+
|
200
|
+
var d = deltas.concat();
|
201
|
+
doc.revertDeltas(d);
|
202
|
+
assert.equal(doc.getValue(), ["1234", "5678"].join("\n"));
|
203
|
+
|
204
|
+
doc.applyDeltas(d);
|
205
|
+
assert.equal(doc.getValue(), ["12345678"].join("\n"));
|
206
|
+
},
|
207
|
+
|
208
|
+
"test: delete multi line range line" : function() {
|
209
|
+
var doc = new Document(["1234", "5678", "abcd"]);
|
210
|
+
|
211
|
+
var deltas = [];
|
212
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
213
|
+
|
214
|
+
doc.remove(new Range(0, 2, 2, 2));
|
215
|
+
assert.equal(doc.getValue(), ["12cd"].join("\n"));
|
216
|
+
|
217
|
+
var d = deltas.concat();
|
218
|
+
doc.revertDeltas(d);
|
219
|
+
assert.equal(doc.getValue(), ["1234", "5678", "abcd"].join("\n"));
|
220
|
+
|
221
|
+
doc.applyDeltas(d);
|
222
|
+
assert.equal(doc.getValue(), ["12cd"].join("\n"));
|
223
|
+
},
|
224
|
+
|
225
|
+
"test: delete full lines" : function() {
|
226
|
+
var doc = new Document(["1234", "5678", "abcd"]);
|
227
|
+
|
228
|
+
var deltas = [];
|
229
|
+
doc.on("change", function(e) { deltas.push(e.data); });
|
230
|
+
|
231
|
+
doc.remove(new Range(1, 0, 3, 0));
|
232
|
+
assert.equal(doc.getValue(), ["1234", ""].join("\n"));
|
233
|
+
},
|
234
|
+
|
235
|
+
"test: remove lines should return the removed lines" : function() {
|
236
|
+
var doc = new Document(["1234", "5678", "abcd"]);
|
237
|
+
|
238
|
+
var removed = doc.removeLines(1, 2);
|
239
|
+
assert.equal(removed.join("\n"), ["5678", "abcd"].join("\n"));
|
240
|
+
},
|
241
|
+
|
242
|
+
"test: should handle unix style new lines" : function() {
|
243
|
+
var doc = new Document(["1", "2", "3"]);
|
244
|
+
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
245
|
+
},
|
246
|
+
|
247
|
+
"test: should handle windows style new lines" : function() {
|
248
|
+
var doc = new Document(["1", "2", "3"].join("\r\n"));
|
249
|
+
|
250
|
+
doc.setNewLineMode("unix");
|
251
|
+
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
252
|
+
},
|
253
|
+
|
254
|
+
"test: set new line mode to 'windows' should use '\\r\\n' as new lines": function() {
|
255
|
+
var doc = new Document(["1", "2", "3"].join("\n"));
|
256
|
+
doc.setNewLineMode("windows");
|
257
|
+
assert.equal(doc.getValue(), ["1", "2", "3"].join("\r\n"));
|
258
|
+
},
|
259
|
+
|
260
|
+
"test: set new line mode to 'unix' should use '\\n' as new lines": function() {
|
261
|
+
var doc = new Document(["1", "2", "3"].join("\r\n"));
|
262
|
+
|
263
|
+
doc.setNewLineMode("unix");
|
264
|
+
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
265
|
+
},
|
266
|
+
|
267
|
+
"test: set new line mode to 'auto' should detect the incoming nl type": function() {
|
268
|
+
var doc = new Document(["1", "2", "3"].join("\n"));
|
269
|
+
|
270
|
+
doc.setNewLineMode("auto");
|
271
|
+
assert.equal(doc.getValue(), ["1", "2", "3"].join("\n"));
|
272
|
+
|
273
|
+
var doc = new Document(["1", "2", "3"].join("\r\n"));
|
274
|
+
|
275
|
+
doc.setNewLineMode("auto");
|
276
|
+
assert.equal(doc.getValue(), ["1", "2", "3"].join("\r\n"));
|
277
|
+
|
278
|
+
doc.replace(new Range(0, 0, 2, 1), ["4", "5", "6"].join("\n"));
|
279
|
+
assert.equal(["4", "5", "6"].join("\n"), doc.getValue());
|
280
|
+
},
|
281
|
+
|
282
|
+
"test: set value": function() {
|
283
|
+
var doc = new Document("1");
|
284
|
+
assert.equal("1", doc.getValue());
|
285
|
+
|
286
|
+
doc.setValue(doc.getValue());
|
287
|
+
assert.equal("1", doc.getValue());
|
288
|
+
|
289
|
+
var doc = new Document("1\n2");
|
290
|
+
assert.equal("1\n2", doc.getValue());
|
291
|
+
|
292
|
+
doc.setValue(doc.getValue());
|
293
|
+
assert.equal("1\n2", doc.getValue());
|
294
|
+
},
|
295
|
+
|
296
|
+
"test: empty document has to contain one line": function() {
|
297
|
+
var doc = new Document("");
|
298
|
+
assert.equal(doc.$lines.length, 1);
|
299
|
+
}
|
300
|
+
};
|
301
|
+
|
302
|
+
});
|
303
|
+
|
304
|
+
if (typeof module !== "undefined" && module === require.main) {
|
305
|
+
require("asyncjs").test.testcase(module.exports).exec()
|
306
|
+
}
|
@@ -0,0 +1,2551 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
*
|
29
|
+
* ***** END LICENSE BLOCK ***** */
|
30
|
+
|
31
|
+
define(function(require, exports, module) {
|
32
|
+
"use strict";
|
33
|
+
|
34
|
+
var oop = require("./lib/oop");
|
35
|
+
var lang = require("./lib/lang");
|
36
|
+
var config = require("./config");
|
37
|
+
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
38
|
+
var Selection = require("./selection").Selection;
|
39
|
+
var TextMode = require("./mode/text").Mode;
|
40
|
+
var Range = require("./range").Range;
|
41
|
+
var Document = require("./document").Document;
|
42
|
+
var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer;
|
43
|
+
var SearchHighlight = require("./search_highlight").SearchHighlight;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state.
|
47
|
+
*
|
48
|
+
* `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s.
|
49
|
+
* @class EditSession
|
50
|
+
**/
|
51
|
+
|
52
|
+
//{ events
|
53
|
+
/**
|
54
|
+
*
|
55
|
+
* Emitted when the document changes.
|
56
|
+
* @event change
|
57
|
+
* @param {Object} e An object containing a `delta` of information about the change.
|
58
|
+
**/
|
59
|
+
/**
|
60
|
+
* Emitted when the tab size changes, via [[EditSession.setTabSize]].
|
61
|
+
*
|
62
|
+
* @event changeTabSize
|
63
|
+
**/
|
64
|
+
/**
|
65
|
+
* Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]].
|
66
|
+
*
|
67
|
+
* @event changeOverwrite
|
68
|
+
**/
|
69
|
+
/**
|
70
|
+
* Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.
|
71
|
+
*
|
72
|
+
* @event changeBreakpoint
|
73
|
+
**/
|
74
|
+
/**
|
75
|
+
* Emitted when a front marker changes.
|
76
|
+
*
|
77
|
+
* @event changeFrontMarker
|
78
|
+
**/
|
79
|
+
/**
|
80
|
+
* Emitted when a back marker changes.
|
81
|
+
*
|
82
|
+
* @event changeBackMarker
|
83
|
+
**/
|
84
|
+
/**
|
85
|
+
* Emitted when an annotation changes, like through [[EditSession.setAnnotations]].
|
86
|
+
*
|
87
|
+
* @event changeAnnotation
|
88
|
+
**/
|
89
|
+
/**
|
90
|
+
* Emitted when a background tokenizer asynchronously processes new rows.
|
91
|
+
* @event tokenizerUpdate
|
92
|
+
*
|
93
|
+
* @param {Object} e An object containing one property, `"data"`, that contains information about the changing rows
|
94
|
+
*
|
95
|
+
**/
|
96
|
+
/**
|
97
|
+
* Emitted when the current mode changes.
|
98
|
+
*
|
99
|
+
* @event changeMode
|
100
|
+
*
|
101
|
+
**/
|
102
|
+
/**
|
103
|
+
* Emitted when the wrap mode changes.
|
104
|
+
*
|
105
|
+
* @event changeWrapMode
|
106
|
+
*
|
107
|
+
**/
|
108
|
+
/**
|
109
|
+
* Emitted when the wrapping limit changes.
|
110
|
+
*
|
111
|
+
* @event changeWrapLimit
|
112
|
+
*
|
113
|
+
**/
|
114
|
+
/**
|
115
|
+
* Emitted when a code fold is added or removed.
|
116
|
+
*
|
117
|
+
* @event changeFold
|
118
|
+
*
|
119
|
+
**/
|
120
|
+
/**
|
121
|
+
* Emitted when the scroll top changes.
|
122
|
+
* @event changeScrollTop
|
123
|
+
*
|
124
|
+
* @param {Number} scrollTop The new scroll top value
|
125
|
+
**/
|
126
|
+
/**
|
127
|
+
* Emitted when the scroll left changes.
|
128
|
+
* @event changeScrollLeft
|
129
|
+
*
|
130
|
+
* @param {Number} scrollLeft The new scroll left value
|
131
|
+
**/
|
132
|
+
//}
|
133
|
+
|
134
|
+
/**
|
135
|
+
*
|
136
|
+
* Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`.
|
137
|
+
* @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]{: #textParam}
|
138
|
+
* @param {TextMode} mode [The inital language mode to use for the document]{: #modeParam}
|
139
|
+
*
|
140
|
+
* @constructor
|
141
|
+
**/
|
142
|
+
|
143
|
+
var EditSession = function(text, mode) {
|
144
|
+
this.$breakpoints = [];
|
145
|
+
this.$decorations = [];
|
146
|
+
this.$frontMarkers = {};
|
147
|
+
this.$backMarkers = {};
|
148
|
+
this.$markerId = 1;
|
149
|
+
this.$undoSelect = true;
|
150
|
+
|
151
|
+
this.$foldData = [];
|
152
|
+
this.$foldData.toString = function() {
|
153
|
+
return this.join("\n");
|
154
|
+
}
|
155
|
+
this.on("changeFold", this.onChangeFold.bind(this));
|
156
|
+
this.$onChange = this.onChange.bind(this);
|
157
|
+
|
158
|
+
if (typeof text != "object" || !text.getLine)
|
159
|
+
text = new Document(text);
|
160
|
+
|
161
|
+
this.setDocument(text);
|
162
|
+
this.selection = new Selection(this);
|
163
|
+
|
164
|
+
config.resetOptions(this);
|
165
|
+
this.setMode(mode);
|
166
|
+
config._signal("session", this);
|
167
|
+
};
|
168
|
+
|
169
|
+
|
170
|
+
(function() {
|
171
|
+
|
172
|
+
oop.implement(this, EventEmitter);
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`.
|
176
|
+
*
|
177
|
+
* @param {Document} doc The new `Document` to use
|
178
|
+
*
|
179
|
+
**/
|
180
|
+
this.setDocument = function(doc) {
|
181
|
+
if (this.doc)
|
182
|
+
this.doc.removeListener("change", this.$onChange);
|
183
|
+
|
184
|
+
this.doc = doc;
|
185
|
+
doc.on("change", this.$onChange);
|
186
|
+
|
187
|
+
if (this.bgTokenizer)
|
188
|
+
this.bgTokenizer.setDocument(this.getDocument());
|
189
|
+
|
190
|
+
this.resetCaches();
|
191
|
+
};
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Returns the `Document` associated with this session.
|
195
|
+
* @return {Document}
|
196
|
+
**/
|
197
|
+
this.getDocument = function() {
|
198
|
+
return this.doc;
|
199
|
+
};
|
200
|
+
|
201
|
+
/**
|
202
|
+
* @param {Number} row The row to work with
|
203
|
+
*
|
204
|
+
**/
|
205
|
+
this.$resetRowCache = function(docRow) {
|
206
|
+
if (!docRow) {
|
207
|
+
this.$docRowCache = [];
|
208
|
+
this.$screenRowCache = [];
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
var l = this.$docRowCache.length;
|
212
|
+
var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
|
213
|
+
if (l > i) {
|
214
|
+
this.$docRowCache.splice(i, l);
|
215
|
+
this.$screenRowCache.splice(i, l);
|
216
|
+
}
|
217
|
+
};
|
218
|
+
|
219
|
+
this.$getRowCacheIndex = function(cacheArray, val) {
|
220
|
+
var low = 0;
|
221
|
+
var hi = cacheArray.length - 1;
|
222
|
+
|
223
|
+
while (low <= hi) {
|
224
|
+
var mid = (low + hi) >> 1;
|
225
|
+
var c = cacheArray[mid];
|
226
|
+
|
227
|
+
if (val > c)
|
228
|
+
low = mid + 1;
|
229
|
+
else if (val < c)
|
230
|
+
hi = mid - 1;
|
231
|
+
else
|
232
|
+
return mid;
|
233
|
+
}
|
234
|
+
|
235
|
+
return low -1;
|
236
|
+
};
|
237
|
+
|
238
|
+
this.resetCaches = function() {
|
239
|
+
this.$modified = true;
|
240
|
+
this.$wrapData = [];
|
241
|
+
this.$rowLengthCache = [];
|
242
|
+
this.$resetRowCache(0);
|
243
|
+
if (this.bgTokenizer)
|
244
|
+
this.bgTokenizer.start(0);
|
245
|
+
};
|
246
|
+
|
247
|
+
this.onChangeFold = function(e) {
|
248
|
+
var fold = e.data;
|
249
|
+
this.$resetRowCache(fold.start.row);
|
250
|
+
};
|
251
|
+
|
252
|
+
this.onChange = function(e) {
|
253
|
+
var delta = e.data;
|
254
|
+
this.$modified = true;
|
255
|
+
|
256
|
+
this.$resetRowCache(delta.range.start.row);
|
257
|
+
|
258
|
+
var removedFolds = this.$updateInternalDataOnChange(e);
|
259
|
+
if (!this.$fromUndo && this.$undoManager && !delta.ignore) {
|
260
|
+
this.$deltasDoc.push(delta);
|
261
|
+
if (removedFolds && removedFolds.length != 0) {
|
262
|
+
this.$deltasFold.push({
|
263
|
+
action: "removeFolds",
|
264
|
+
folds: removedFolds
|
265
|
+
});
|
266
|
+
}
|
267
|
+
|
268
|
+
this.$informUndoManager.schedule();
|
269
|
+
}
|
270
|
+
|
271
|
+
this.bgTokenizer && this.bgTokenizer.$updateOnChange(delta);
|
272
|
+
this._signal("change", e);
|
273
|
+
};
|
274
|
+
|
275
|
+
/**
|
276
|
+
* Sets the session text.
|
277
|
+
* @param {String} text The new text to place
|
278
|
+
*
|
279
|
+
**/
|
280
|
+
this.setValue = function(text) {
|
281
|
+
this.doc.setValue(text);
|
282
|
+
this.selection.moveTo(0, 0);
|
283
|
+
|
284
|
+
this.$resetRowCache(0);
|
285
|
+
this.$deltas = [];
|
286
|
+
this.$deltasDoc = [];
|
287
|
+
this.$deltasFold = [];
|
288
|
+
this.setUndoManager(this.$undoManager);
|
289
|
+
this.getUndoManager().reset();
|
290
|
+
};
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Returns the current [[Document `Document`]] as a string.
|
294
|
+
* @method toString
|
295
|
+
* @returns {String}
|
296
|
+
* @alias EditSession.getValue
|
297
|
+
*
|
298
|
+
**/
|
299
|
+
|
300
|
+
/**
|
301
|
+
* Returns the current [[Document `Document`]] as a string.
|
302
|
+
* @method getValue
|
303
|
+
* @returns {String}
|
304
|
+
* @alias EditSession.toString
|
305
|
+
**/
|
306
|
+
this.getValue =
|
307
|
+
this.toString = function() {
|
308
|
+
return this.doc.getValue();
|
309
|
+
};
|
310
|
+
|
311
|
+
/**
|
312
|
+
* Returns the string of the current selection.
|
313
|
+
**/
|
314
|
+
this.getSelection = function() {
|
315
|
+
return this.selection;
|
316
|
+
};
|
317
|
+
|
318
|
+
/**
|
319
|
+
* {:BackgroundTokenizer.getState}
|
320
|
+
* @param {Number} row The row to start at
|
321
|
+
*
|
322
|
+
* @related BackgroundTokenizer.getState
|
323
|
+
**/
|
324
|
+
this.getState = function(row) {
|
325
|
+
return this.bgTokenizer.getState(row);
|
326
|
+
};
|
327
|
+
|
328
|
+
/**
|
329
|
+
* Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.
|
330
|
+
* @param {Number} row The row to start at
|
331
|
+
*
|
332
|
+
*
|
333
|
+
*
|
334
|
+
**/
|
335
|
+
this.getTokens = function(row) {
|
336
|
+
return this.bgTokenizer.getTokens(row);
|
337
|
+
};
|
338
|
+
|
339
|
+
/**
|
340
|
+
* Returns an object indicating the token at the current row. The object has two properties: `index` and `start`.
|
341
|
+
* @param {Number} row The row number to retrieve from
|
342
|
+
* @param {Number} column The column number to retrieve from
|
343
|
+
*
|
344
|
+
*
|
345
|
+
**/
|
346
|
+
this.getTokenAt = function(row, column) {
|
347
|
+
var tokens = this.bgTokenizer.getTokens(row);
|
348
|
+
var token, c = 0;
|
349
|
+
if (column == null) {
|
350
|
+
i = tokens.length - 1;
|
351
|
+
c = this.getLine(row).length;
|
352
|
+
} else {
|
353
|
+
for (var i = 0; i < tokens.length; i++) {
|
354
|
+
c += tokens[i].value.length;
|
355
|
+
if (c >= column)
|
356
|
+
break;
|
357
|
+
}
|
358
|
+
}
|
359
|
+
token = tokens[i];
|
360
|
+
if (!token)
|
361
|
+
return null;
|
362
|
+
token.index = i;
|
363
|
+
token.start = c - token.value.length;
|
364
|
+
return token;
|
365
|
+
};
|
366
|
+
|
367
|
+
/**
|
368
|
+
* Sets the undo manager.
|
369
|
+
* @param {UndoManager} undoManager The new undo manager
|
370
|
+
*
|
371
|
+
*
|
372
|
+
**/
|
373
|
+
this.setUndoManager = function(undoManager) {
|
374
|
+
this.$undoManager = undoManager;
|
375
|
+
this.$deltas = [];
|
376
|
+
this.$deltasDoc = [];
|
377
|
+
this.$deltasFold = [];
|
378
|
+
|
379
|
+
if (this.$informUndoManager)
|
380
|
+
this.$informUndoManager.cancel();
|
381
|
+
|
382
|
+
if (undoManager) {
|
383
|
+
var self = this;
|
384
|
+
|
385
|
+
this.$syncInformUndoManager = function() {
|
386
|
+
self.$informUndoManager.cancel();
|
387
|
+
|
388
|
+
if (self.$deltasFold.length) {
|
389
|
+
self.$deltas.push({
|
390
|
+
group: "fold",
|
391
|
+
deltas: self.$deltasFold
|
392
|
+
});
|
393
|
+
self.$deltasFold = [];
|
394
|
+
}
|
395
|
+
|
396
|
+
if (self.$deltasDoc.length) {
|
397
|
+
self.$deltas.push({
|
398
|
+
group: "doc",
|
399
|
+
deltas: self.$deltasDoc
|
400
|
+
});
|
401
|
+
self.$deltasDoc = [];
|
402
|
+
}
|
403
|
+
|
404
|
+
if (self.$deltas.length > 0) {
|
405
|
+
undoManager.execute({
|
406
|
+
action: "aceupdate",
|
407
|
+
args: [self.$deltas, self],
|
408
|
+
merge: self.mergeUndoDeltas
|
409
|
+
});
|
410
|
+
}
|
411
|
+
self.mergeUndoDeltas = false;
|
412
|
+
self.$deltas = [];
|
413
|
+
};
|
414
|
+
this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
|
415
|
+
}
|
416
|
+
};
|
417
|
+
|
418
|
+
/**
|
419
|
+
* starts a new group in undo history
|
420
|
+
**/
|
421
|
+
this.markUndoGroup = function() {
|
422
|
+
if (this.$syncInformUndoManager)
|
423
|
+
this.$syncInformUndoManager();
|
424
|
+
};
|
425
|
+
|
426
|
+
this.$defaultUndoManager = {
|
427
|
+
undo: function() {},
|
428
|
+
redo: function() {},
|
429
|
+
reset: function() {}
|
430
|
+
};
|
431
|
+
|
432
|
+
/**
|
433
|
+
* Returns the current undo manager.
|
434
|
+
**/
|
435
|
+
this.getUndoManager = function() {
|
436
|
+
return this.$undoManager || this.$defaultUndoManager;
|
437
|
+
};
|
438
|
+
|
439
|
+
/**
|
440
|
+
* 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'`.
|
441
|
+
**/
|
442
|
+
this.getTabString = function() {
|
443
|
+
if (this.getUseSoftTabs()) {
|
444
|
+
return lang.stringRepeat(" ", this.getTabSize());
|
445
|
+
} else {
|
446
|
+
return "\t";
|
447
|
+
}
|
448
|
+
};
|
449
|
+
|
450
|
+
/**
|
451
|
+
/**
|
452
|
+
* Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`).
|
453
|
+
* @param {Boolean} useSoftTabs Value indicating whether or not to use soft tabs
|
454
|
+
**/
|
455
|
+
this.setUseSoftTabs = function(val) {
|
456
|
+
this.setOption("useSoftTabs", val);
|
457
|
+
};
|
458
|
+
/**
|
459
|
+
* Returns `true` if soft tabs are being used, `false` otherwise.
|
460
|
+
* @returns {Boolean}
|
461
|
+
**/
|
462
|
+
this.getUseSoftTabs = function() {
|
463
|
+
// todo might need more general way for changing settings from mode, but this is ok for now
|
464
|
+
return this.$useSoftTabs && !this.$mode.$indentWithTabs;
|
465
|
+
};
|
466
|
+
/**
|
467
|
+
* 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.
|
468
|
+
* @param {Number} tabSize The new tab size
|
469
|
+
**/
|
470
|
+
this.setTabSize = function(tabSize) {
|
471
|
+
this.setOption("tabSize", tabSize);
|
472
|
+
};
|
473
|
+
/**
|
474
|
+
* Returns the current tab size.
|
475
|
+
**/
|
476
|
+
this.getTabSize = function() {
|
477
|
+
return this.$tabSize;
|
478
|
+
};
|
479
|
+
|
480
|
+
/**
|
481
|
+
* Returns `true` if the character at the position is a soft tab.
|
482
|
+
* @param {Object} position The position to check
|
483
|
+
*
|
484
|
+
*
|
485
|
+
**/
|
486
|
+
this.isTabStop = function(position) {
|
487
|
+
return this.$useSoftTabs && (position.column % this.$tabSize === 0);
|
488
|
+
};
|
489
|
+
|
490
|
+
this.$overwrite = false;
|
491
|
+
/**
|
492
|
+
* Pass in `true` to enable overwrites in your session, or `false` to disable.
|
493
|
+
*
|
494
|
+
* 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.
|
495
|
+
*
|
496
|
+
* @param {Boolean} overwrite Defines wheter or not to set overwrites
|
497
|
+
*
|
498
|
+
*
|
499
|
+
**/
|
500
|
+
this.setOverwrite = function(overwrite) {
|
501
|
+
this.setOption("overwrite", overwrite);
|
502
|
+
};
|
503
|
+
|
504
|
+
/**
|
505
|
+
* Returns `true` if overwrites are enabled; `false` otherwise.
|
506
|
+
**/
|
507
|
+
this.getOverwrite = function() {
|
508
|
+
return this.$overwrite;
|
509
|
+
};
|
510
|
+
|
511
|
+
/**
|
512
|
+
* Sets the value of overwrite to the opposite of whatever it currently is.
|
513
|
+
**/
|
514
|
+
this.toggleOverwrite = function() {
|
515
|
+
this.setOverwrite(!this.$overwrite);
|
516
|
+
};
|
517
|
+
|
518
|
+
/**
|
519
|
+
* Adds `className` to the `row`, to be used for CSS stylings and whatnot.
|
520
|
+
* @param {Number} row The row number
|
521
|
+
* @param {String} className The class to add
|
522
|
+
*
|
523
|
+
*
|
524
|
+
**/
|
525
|
+
this.addGutterDecoration = function(row, className) {
|
526
|
+
if (!this.$decorations[row])
|
527
|
+
this.$decorations[row] = "";
|
528
|
+
this.$decorations[row] += " " + className;
|
529
|
+
this._signal("changeBreakpoint", {});
|
530
|
+
};
|
531
|
+
|
532
|
+
/**
|
533
|
+
* Removes `className` from the `row`.
|
534
|
+
* @param {Number} row The row number
|
535
|
+
* @param {String} className The class to add
|
536
|
+
*
|
537
|
+
*
|
538
|
+
**/
|
539
|
+
this.removeGutterDecoration = function(row, className) {
|
540
|
+
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
541
|
+
this._signal("changeBreakpoint", {});
|
542
|
+
};
|
543
|
+
|
544
|
+
/**
|
545
|
+
* Returns an array of numbers, indicating which rows have breakpoints.
|
546
|
+
* @returns {[Number]}
|
547
|
+
**/
|
548
|
+
this.getBreakpoints = function() {
|
549
|
+
return this.$breakpoints;
|
550
|
+
};
|
551
|
+
|
552
|
+
/**
|
553
|
+
* Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
|
554
|
+
* @param {Array} rows An array of row indices
|
555
|
+
*
|
556
|
+
*
|
557
|
+
*
|
558
|
+
**/
|
559
|
+
this.setBreakpoints = function(rows) {
|
560
|
+
this.$breakpoints = [];
|
561
|
+
for (var i=0; i<rows.length; i++) {
|
562
|
+
this.$breakpoints[rows[i]] = "ace_breakpoint";
|
563
|
+
}
|
564
|
+
this._signal("changeBreakpoint", {});
|
565
|
+
};
|
566
|
+
|
567
|
+
/**
|
568
|
+
* Removes all breakpoints on the rows. This function also emites the `'changeBreakpoint'` event.
|
569
|
+
**/
|
570
|
+
this.clearBreakpoints = function() {
|
571
|
+
this.$breakpoints = [];
|
572
|
+
this._signal("changeBreakpoint", {});
|
573
|
+
};
|
574
|
+
|
575
|
+
/**
|
576
|
+
* Sets a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
|
577
|
+
* @param {Number} row A row index
|
578
|
+
* @param {String} className Class of the breakpoint
|
579
|
+
*
|
580
|
+
*
|
581
|
+
**/
|
582
|
+
this.setBreakpoint = function(row, className) {
|
583
|
+
if (className === undefined)
|
584
|
+
className = "ace_breakpoint";
|
585
|
+
if (className)
|
586
|
+
this.$breakpoints[row] = className;
|
587
|
+
else
|
588
|
+
delete this.$breakpoints[row];
|
589
|
+
this._signal("changeBreakpoint", {});
|
590
|
+
};
|
591
|
+
|
592
|
+
/**
|
593
|
+
* Removes a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
|
594
|
+
* @param {Number} row A row index
|
595
|
+
*
|
596
|
+
*
|
597
|
+
**/
|
598
|
+
this.clearBreakpoint = function(row) {
|
599
|
+
delete this.$breakpoints[row];
|
600
|
+
this._signal("changeBreakpoint", {});
|
601
|
+
};
|
602
|
+
|
603
|
+
/**
|
604
|
+
* 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.
|
605
|
+
* @param {Range} range Define the range of the marker
|
606
|
+
* @param {String} clazz Set the CSS class for the marker
|
607
|
+
* @param {Function | String} type Identify the type of the marker
|
608
|
+
* @param {Boolean} inFront Set to `true` to establish a front marker
|
609
|
+
*
|
610
|
+
*
|
611
|
+
* @return {Number} The new marker id
|
612
|
+
**/
|
613
|
+
this.addMarker = function(range, clazz, type, inFront) {
|
614
|
+
var id = this.$markerId++;
|
615
|
+
|
616
|
+
var marker = {
|
617
|
+
range : range,
|
618
|
+
type : type || "line",
|
619
|
+
renderer: typeof type == "function" ? type : null,
|
620
|
+
clazz : clazz,
|
621
|
+
inFront: !!inFront,
|
622
|
+
id: id
|
623
|
+
};
|
624
|
+
|
625
|
+
if (inFront) {
|
626
|
+
this.$frontMarkers[id] = marker;
|
627
|
+
this._signal("changeFrontMarker");
|
628
|
+
} else {
|
629
|
+
this.$backMarkers[id] = marker;
|
630
|
+
this._signal("changeBackMarker");
|
631
|
+
}
|
632
|
+
|
633
|
+
return id;
|
634
|
+
};
|
635
|
+
|
636
|
+
/**
|
637
|
+
* Adds a dynamic marker to the session.
|
638
|
+
* @param {Object} marker object with update method
|
639
|
+
* @param {Boolean} inFront Set to `true` to establish a front marker
|
640
|
+
*
|
641
|
+
*
|
642
|
+
* @return {Object} The added marker
|
643
|
+
**/
|
644
|
+
this.addDynamicMarker = function(marker, inFront) {
|
645
|
+
if (!marker.update)
|
646
|
+
return;
|
647
|
+
var id = this.$markerId++;
|
648
|
+
marker.id = id;
|
649
|
+
marker.inFront = !!inFront;
|
650
|
+
|
651
|
+
if (inFront) {
|
652
|
+
this.$frontMarkers[id] = marker;
|
653
|
+
this._signal("changeFrontMarker");
|
654
|
+
} else {
|
655
|
+
this.$backMarkers[id] = marker;
|
656
|
+
this._signal("changeBackMarker");
|
657
|
+
}
|
658
|
+
|
659
|
+
return marker;
|
660
|
+
};
|
661
|
+
|
662
|
+
/**
|
663
|
+
* 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.
|
664
|
+
* @param {Number} markerId A number representing a marker
|
665
|
+
*
|
666
|
+
*
|
667
|
+
*
|
668
|
+
**/
|
669
|
+
this.removeMarker = function(markerId) {
|
670
|
+
var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];
|
671
|
+
if (!marker)
|
672
|
+
return;
|
673
|
+
|
674
|
+
var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
|
675
|
+
if (marker) {
|
676
|
+
delete (markers[markerId]);
|
677
|
+
this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
|
678
|
+
}
|
679
|
+
};
|
680
|
+
|
681
|
+
/**
|
682
|
+
* Returns an array containing the IDs of all the markers, either front or back.
|
683
|
+
* @param {Boolean} inFront If `true`, indicates you only want front markers; `false` indicates only back markers
|
684
|
+
*
|
685
|
+
* @returns {Array}
|
686
|
+
**/
|
687
|
+
this.getMarkers = function(inFront) {
|
688
|
+
return inFront ? this.$frontMarkers : this.$backMarkers;
|
689
|
+
};
|
690
|
+
|
691
|
+
this.highlight = function(re) {
|
692
|
+
if (!this.$searchHighlight) {
|
693
|
+
var highlight = new SearchHighlight(null, "ace_selected-word", "text");
|
694
|
+
this.$searchHighlight = this.addDynamicMarker(highlight);
|
695
|
+
}
|
696
|
+
this.$searchHighlight.setRegexp(re);
|
697
|
+
};
|
698
|
+
|
699
|
+
// experimental
|
700
|
+
this.highlightLines = function(startRow, endRow, clazz, inFront) {
|
701
|
+
if (typeof endRow != "number") {
|
702
|
+
clazz = endRow;
|
703
|
+
endRow = startRow;
|
704
|
+
}
|
705
|
+
if (!clazz)
|
706
|
+
clazz = "ace_step";
|
707
|
+
|
708
|
+
var range = new Range(startRow, 0, endRow, Infinity);
|
709
|
+
range.id = this.addMarker(range, clazz, "fullLine", inFront);
|
710
|
+
return range;
|
711
|
+
};
|
712
|
+
|
713
|
+
/*
|
714
|
+
* Error:
|
715
|
+
* {
|
716
|
+
* row: 12,
|
717
|
+
* column: 2, //can be undefined
|
718
|
+
* text: "Missing argument",
|
719
|
+
* type: "error" // or "warning" or "info"
|
720
|
+
* }
|
721
|
+
*/
|
722
|
+
/**
|
723
|
+
* Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event.
|
724
|
+
* @param {Array} annotations A list of annotations
|
725
|
+
*
|
726
|
+
**/
|
727
|
+
this.setAnnotations = function(annotations) {
|
728
|
+
this.$annotations = annotations;
|
729
|
+
this._signal("changeAnnotation", {});
|
730
|
+
};
|
731
|
+
|
732
|
+
/**
|
733
|
+
* Returns the annotations for the `EditSession`.
|
734
|
+
* @returns {Array}
|
735
|
+
**/
|
736
|
+
this.getAnnotations = function() {
|
737
|
+
return this.$annotations || [];
|
738
|
+
};
|
739
|
+
|
740
|
+
/**
|
741
|
+
* Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event.
|
742
|
+
**/
|
743
|
+
this.clearAnnotations = function() {
|
744
|
+
this.setAnnotations([]);
|
745
|
+
};
|
746
|
+
|
747
|
+
/**
|
748
|
+
* If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value.
|
749
|
+
* @param {String} text A block of text
|
750
|
+
*
|
751
|
+
*
|
752
|
+
**/
|
753
|
+
this.$detectNewLine = function(text) {
|
754
|
+
var match = text.match(/^.*?(\r?\n)/m);
|
755
|
+
if (match) {
|
756
|
+
this.$autoNewLine = match[1];
|
757
|
+
} else {
|
758
|
+
this.$autoNewLine = "\n";
|
759
|
+
}
|
760
|
+
};
|
761
|
+
|
762
|
+
/**
|
763
|
+
* Given a starting row and column, this method returns the `Range` of the first word boundary it finds.
|
764
|
+
* @param {Number} row The row to start at
|
765
|
+
* @param {Number} column The column to start at
|
766
|
+
*
|
767
|
+
* @returns {Range}
|
768
|
+
**/
|
769
|
+
this.getWordRange = function(row, column) {
|
770
|
+
var line = this.getLine(row);
|
771
|
+
|
772
|
+
var inToken = false;
|
773
|
+
if (column > 0)
|
774
|
+
inToken = !!line.charAt(column - 1).match(this.tokenRe);
|
775
|
+
|
776
|
+
if (!inToken)
|
777
|
+
inToken = !!line.charAt(column).match(this.tokenRe);
|
778
|
+
|
779
|
+
if (inToken)
|
780
|
+
var re = this.tokenRe;
|
781
|
+
else if (/^\s+$/.test(line.slice(column-1, column+1)))
|
782
|
+
var re = /\s/;
|
783
|
+
else
|
784
|
+
var re = this.nonTokenRe;
|
785
|
+
|
786
|
+
var start = column;
|
787
|
+
if (start > 0) {
|
788
|
+
do {
|
789
|
+
start--;
|
790
|
+
}
|
791
|
+
while (start >= 0 && line.charAt(start).match(re));
|
792
|
+
start++;
|
793
|
+
}
|
794
|
+
|
795
|
+
var end = column;
|
796
|
+
while (end < line.length && line.charAt(end).match(re)) {
|
797
|
+
end++;
|
798
|
+
}
|
799
|
+
|
800
|
+
return new Range(row, start, row, end);
|
801
|
+
};
|
802
|
+
|
803
|
+
/**
|
804
|
+
* Gets the range of a word, including its right whitespace.
|
805
|
+
* @param {Number} row The row number to start from
|
806
|
+
* @param {Number} column The column number to start from
|
807
|
+
*
|
808
|
+
* @return {Range}
|
809
|
+
**/
|
810
|
+
this.getAWordRange = function(row, column) {
|
811
|
+
var wordRange = this.getWordRange(row, column);
|
812
|
+
var line = this.getLine(wordRange.end.row);
|
813
|
+
|
814
|
+
while (line.charAt(wordRange.end.column).match(/[ \t]/)) {
|
815
|
+
wordRange.end.column += 1;
|
816
|
+
}
|
817
|
+
return wordRange;
|
818
|
+
};
|
819
|
+
|
820
|
+
/**
|
821
|
+
* {:Document.setNewLineMode.desc}
|
822
|
+
* @param {String} newLineMode {:Document.setNewLineMode.param}
|
823
|
+
*
|
824
|
+
*
|
825
|
+
* @related Document.setNewLineMode
|
826
|
+
**/
|
827
|
+
this.setNewLineMode = function(newLineMode) {
|
828
|
+
this.doc.setNewLineMode(newLineMode);
|
829
|
+
};
|
830
|
+
|
831
|
+
/**
|
832
|
+
*
|
833
|
+
* Returns the current new line mode.
|
834
|
+
* @returns {String}
|
835
|
+
* @related Document.getNewLineMode
|
836
|
+
**/
|
837
|
+
this.getNewLineMode = function() {
|
838
|
+
return this.doc.getNewLineMode();
|
839
|
+
};
|
840
|
+
|
841
|
+
/**
|
842
|
+
* Identifies if you want to use a worker for the `EditSession`.
|
843
|
+
* @param {Boolean} useWorker Set to `true` to use a worker
|
844
|
+
*
|
845
|
+
**/
|
846
|
+
this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); };
|
847
|
+
|
848
|
+
/**
|
849
|
+
* Returns `true` if workers are being used.
|
850
|
+
**/
|
851
|
+
this.getUseWorker = function() { return this.$useWorker; };
|
852
|
+
|
853
|
+
/**
|
854
|
+
* 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.
|
855
|
+
**/
|
856
|
+
this.onReloadTokenizer = function(e) {
|
857
|
+
var rows = e.data;
|
858
|
+
this.bgTokenizer.start(rows.first);
|
859
|
+
this._signal("tokenizerUpdate", e);
|
860
|
+
};
|
861
|
+
|
862
|
+
this.$modes = {};
|
863
|
+
|
864
|
+
/**
|
865
|
+
* 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.
|
866
|
+
* @param {TextMode} mode Set a new text mode
|
867
|
+
* @param {cb} optional callback
|
868
|
+
*
|
869
|
+
**/
|
870
|
+
this.$mode = null;
|
871
|
+
this.$modeId = null;
|
872
|
+
this.setMode = function(mode, cb) {
|
873
|
+
if (mode && typeof mode === "object") {
|
874
|
+
if (mode.getTokenizer)
|
875
|
+
return this.$onChangeMode(mode);
|
876
|
+
var options = mode;
|
877
|
+
var path = options.path;
|
878
|
+
} else {
|
879
|
+
path = mode || "ace/mode/text";
|
880
|
+
}
|
881
|
+
|
882
|
+
// this is needed if ace isn't on require path (e.g tests in node)
|
883
|
+
if (!this.$modes["ace/mode/text"])
|
884
|
+
this.$modes["ace/mode/text"] = new TextMode();
|
885
|
+
|
886
|
+
if (this.$modes[path] && !options) {
|
887
|
+
this.$onChangeMode(this.$modes[path]);
|
888
|
+
cb && cb();
|
889
|
+
return;
|
890
|
+
}
|
891
|
+
// load on demand
|
892
|
+
this.$modeId = path;
|
893
|
+
config.loadModule(["mode", path], function(m) {
|
894
|
+
if (this.$modeId !== path)
|
895
|
+
return cb && cb();
|
896
|
+
if (this.$modes[path] && !options) {
|
897
|
+
this.$onChangeMode(this.$modes[path]);
|
898
|
+
} else if (m && m.Mode) {
|
899
|
+
m = new m.Mode(options);
|
900
|
+
if (!options) {
|
901
|
+
this.$modes[path] = m;
|
902
|
+
m.$id = path;
|
903
|
+
}
|
904
|
+
this.$onChangeMode(m);
|
905
|
+
}
|
906
|
+
cb && cb();
|
907
|
+
}.bind(this));
|
908
|
+
|
909
|
+
// set mode to text until loading is finished
|
910
|
+
if (!this.$mode)
|
911
|
+
this.$onChangeMode(this.$modes["ace/mode/text"], true);
|
912
|
+
};
|
913
|
+
|
914
|
+
this.$onChangeMode = function(mode, $isPlaceholder) {
|
915
|
+
if (!$isPlaceholder)
|
916
|
+
this.$modeId = mode.$id;
|
917
|
+
if (this.$mode === mode)
|
918
|
+
return;
|
919
|
+
|
920
|
+
this.$mode = mode;
|
921
|
+
|
922
|
+
this.$stopWorker();
|
923
|
+
|
924
|
+
if (this.$useWorker)
|
925
|
+
this.$startWorker();
|
926
|
+
|
927
|
+
var tokenizer = mode.getTokenizer();
|
928
|
+
|
929
|
+
if(tokenizer.addEventListener !== undefined) {
|
930
|
+
var onReloadTokenizer = this.onReloadTokenizer.bind(this);
|
931
|
+
tokenizer.addEventListener("update", onReloadTokenizer);
|
932
|
+
}
|
933
|
+
|
934
|
+
if (!this.bgTokenizer) {
|
935
|
+
this.bgTokenizer = new BackgroundTokenizer(tokenizer);
|
936
|
+
var _self = this;
|
937
|
+
this.bgTokenizer.addEventListener("update", function(e) {
|
938
|
+
_self._signal("tokenizerUpdate", e);
|
939
|
+
});
|
940
|
+
} else {
|
941
|
+
this.bgTokenizer.setTokenizer(tokenizer);
|
942
|
+
}
|
943
|
+
|
944
|
+
this.bgTokenizer.setDocument(this.getDocument());
|
945
|
+
|
946
|
+
this.tokenRe = mode.tokenRe;
|
947
|
+
this.nonTokenRe = mode.nonTokenRe;
|
948
|
+
|
949
|
+
|
950
|
+
if (!$isPlaceholder) {
|
951
|
+
// experimental method, used by c9 findiniles
|
952
|
+
if (mode.attachToSession)
|
953
|
+
mode.attachToSession(this);
|
954
|
+
this.$options.wrapMethod.set.call(this, this.$wrapMethod);
|
955
|
+
this.$setFolding(mode.foldingRules);
|
956
|
+
this.bgTokenizer.start(0);
|
957
|
+
this._emit("changeMode");
|
958
|
+
}
|
959
|
+
};
|
960
|
+
|
961
|
+
this.$stopWorker = function() {
|
962
|
+
if (this.$worker) {
|
963
|
+
this.$worker.terminate();
|
964
|
+
this.$worker = null;
|
965
|
+
}
|
966
|
+
};
|
967
|
+
|
968
|
+
this.$startWorker = function() {
|
969
|
+
try {
|
970
|
+
this.$worker = this.$mode.createWorker(this);
|
971
|
+
} catch (e) {
|
972
|
+
config.warn("Could not load worker", e);
|
973
|
+
this.$worker = null;
|
974
|
+
}
|
975
|
+
};
|
976
|
+
|
977
|
+
/**
|
978
|
+
* Returns the current text mode.
|
979
|
+
* @returns {TextMode} The current text mode
|
980
|
+
**/
|
981
|
+
this.getMode = function() {
|
982
|
+
return this.$mode;
|
983
|
+
};
|
984
|
+
|
985
|
+
this.$scrollTop = 0;
|
986
|
+
/**
|
987
|
+
* This function sets the scroll top value. It also emits the `'changeScrollTop'` event.
|
988
|
+
* @param {Number} scrollTop The new scroll top value
|
989
|
+
*
|
990
|
+
**/
|
991
|
+
this.setScrollTop = function(scrollTop) {
|
992
|
+
// TODO: should we force integer lineheight instead? scrollTop = Math.round(scrollTop);
|
993
|
+
if (this.$scrollTop === scrollTop || isNaN(scrollTop))
|
994
|
+
return;
|
995
|
+
|
996
|
+
this.$scrollTop = scrollTop;
|
997
|
+
this._signal("changeScrollTop", scrollTop);
|
998
|
+
};
|
999
|
+
|
1000
|
+
/**
|
1001
|
+
* [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop}
|
1002
|
+
* @returns {Number}
|
1003
|
+
**/
|
1004
|
+
this.getScrollTop = function() {
|
1005
|
+
return this.$scrollTop;
|
1006
|
+
};
|
1007
|
+
|
1008
|
+
this.$scrollLeft = 0;
|
1009
|
+
/**
|
1010
|
+
* [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
|
1011
|
+
**/
|
1012
|
+
this.setScrollLeft = function(scrollLeft) {
|
1013
|
+
// scrollLeft = Math.round(scrollLeft);
|
1014
|
+
if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))
|
1015
|
+
return;
|
1016
|
+
|
1017
|
+
this.$scrollLeft = scrollLeft;
|
1018
|
+
this._signal("changeScrollLeft", scrollLeft);
|
1019
|
+
};
|
1020
|
+
|
1021
|
+
/**
|
1022
|
+
* [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
|
1023
|
+
* @returns {Number}
|
1024
|
+
**/
|
1025
|
+
this.getScrollLeft = function() {
|
1026
|
+
return this.$scrollLeft;
|
1027
|
+
};
|
1028
|
+
|
1029
|
+
/**
|
1030
|
+
* Returns the width of the screen.
|
1031
|
+
* @returns {Number}
|
1032
|
+
**/
|
1033
|
+
this.getScreenWidth = function() {
|
1034
|
+
this.$computeWidth();
|
1035
|
+
if (this.lineWidgets)
|
1036
|
+
return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);
|
1037
|
+
return this.screenWidth;
|
1038
|
+
};
|
1039
|
+
|
1040
|
+
this.getLineWidgetMaxWidth = function() {
|
1041
|
+
if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth;
|
1042
|
+
var width = 0;
|
1043
|
+
this.lineWidgets.forEach(function(w) {
|
1044
|
+
if (w && w.screenWidth > width)
|
1045
|
+
width = w.screenWidth;
|
1046
|
+
});
|
1047
|
+
return this.lineWidgetWidth = width;
|
1048
|
+
};
|
1049
|
+
|
1050
|
+
this.$computeWidth = function(force) {
|
1051
|
+
if (this.$modified || force) {
|
1052
|
+
this.$modified = false;
|
1053
|
+
|
1054
|
+
if (this.$useWrapMode)
|
1055
|
+
return this.screenWidth = this.$wrapLimit;
|
1056
|
+
|
1057
|
+
var lines = this.doc.getAllLines();
|
1058
|
+
var cache = this.$rowLengthCache;
|
1059
|
+
var longestScreenLine = 0;
|
1060
|
+
var foldIndex = 0;
|
1061
|
+
var foldLine = this.$foldData[foldIndex];
|
1062
|
+
var foldStart = foldLine ? foldLine.start.row : Infinity;
|
1063
|
+
var len = lines.length;
|
1064
|
+
|
1065
|
+
for (var i = 0; i < len; i++) {
|
1066
|
+
if (i > foldStart) {
|
1067
|
+
i = foldLine.end.row + 1;
|
1068
|
+
if (i >= len)
|
1069
|
+
break;
|
1070
|
+
foldLine = this.$foldData[foldIndex++];
|
1071
|
+
foldStart = foldLine ? foldLine.start.row : Infinity;
|
1072
|
+
}
|
1073
|
+
|
1074
|
+
if (cache[i] == null)
|
1075
|
+
cache[i] = this.$getStringScreenWidth(lines[i])[0];
|
1076
|
+
|
1077
|
+
if (cache[i] > longestScreenLine)
|
1078
|
+
longestScreenLine = cache[i];
|
1079
|
+
}
|
1080
|
+
this.screenWidth = longestScreenLine;
|
1081
|
+
}
|
1082
|
+
};
|
1083
|
+
|
1084
|
+
/**
|
1085
|
+
* Returns a verbatim copy of the given line as it is in the document
|
1086
|
+
* @param {Number} row The row to retrieve from
|
1087
|
+
*
|
1088
|
+
*
|
1089
|
+
* @returns {String}
|
1090
|
+
*
|
1091
|
+
**/
|
1092
|
+
this.getLine = function(row) {
|
1093
|
+
return this.doc.getLine(row);
|
1094
|
+
};
|
1095
|
+
|
1096
|
+
/**
|
1097
|
+
* Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`.
|
1098
|
+
* @param {Number} firstRow The first row index to retrieve
|
1099
|
+
* @param {Number} lastRow The final row index to retrieve
|
1100
|
+
*
|
1101
|
+
* @returns {[String]}
|
1102
|
+
*
|
1103
|
+
**/
|
1104
|
+
this.getLines = function(firstRow, lastRow) {
|
1105
|
+
return this.doc.getLines(firstRow, lastRow);
|
1106
|
+
};
|
1107
|
+
|
1108
|
+
/**
|
1109
|
+
* Returns the number of rows in the document.
|
1110
|
+
* @returns {Number}
|
1111
|
+
**/
|
1112
|
+
this.getLength = function() {
|
1113
|
+
return this.doc.getLength();
|
1114
|
+
};
|
1115
|
+
|
1116
|
+
/**
|
1117
|
+
* {:Document.getTextRange.desc}
|
1118
|
+
* @param {Range} range The range to work with
|
1119
|
+
*
|
1120
|
+
* @returns {String}
|
1121
|
+
**/
|
1122
|
+
this.getTextRange = function(range) {
|
1123
|
+
return this.doc.getTextRange(range || this.selection.getRange());
|
1124
|
+
};
|
1125
|
+
|
1126
|
+
/**
|
1127
|
+
* Inserts a block of `text` and the indicated `position`.
|
1128
|
+
* @param {Object} position The position {row, column} to start inserting at
|
1129
|
+
* @param {String} text A chunk of text to insert
|
1130
|
+
* @returns {Object} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`.
|
1131
|
+
*
|
1132
|
+
*
|
1133
|
+
**/
|
1134
|
+
this.insert = function(position, text) {
|
1135
|
+
return this.doc.insert(position, text);
|
1136
|
+
};
|
1137
|
+
|
1138
|
+
/**
|
1139
|
+
* Removes the `range` from the document.
|
1140
|
+
* @param {Range} range A specified Range to remove
|
1141
|
+
* @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`.
|
1142
|
+
*
|
1143
|
+
* @related Document.remove
|
1144
|
+
*
|
1145
|
+
**/
|
1146
|
+
this.remove = function(range) {
|
1147
|
+
return this.doc.remove(range);
|
1148
|
+
};
|
1149
|
+
|
1150
|
+
/**
|
1151
|
+
* Reverts previous changes to your document.
|
1152
|
+
* @param {Array} deltas An array of previous changes
|
1153
|
+
* @param {Boolean} dontSelect [If `true`, doesn't select the range of where the change occured]{: #dontSelect}
|
1154
|
+
*
|
1155
|
+
*
|
1156
|
+
* @returns {Range}
|
1157
|
+
**/
|
1158
|
+
this.undoChanges = function(deltas, dontSelect) {
|
1159
|
+
if (!deltas.length)
|
1160
|
+
return;
|
1161
|
+
|
1162
|
+
this.$fromUndo = true;
|
1163
|
+
var lastUndoRange = null;
|
1164
|
+
for (var i = deltas.length - 1; i != -1; i--) {
|
1165
|
+
var delta = deltas[i];
|
1166
|
+
if (delta.group == "doc") {
|
1167
|
+
this.doc.revertDeltas(delta.deltas);
|
1168
|
+
lastUndoRange =
|
1169
|
+
this.$getUndoSelection(delta.deltas, true, lastUndoRange);
|
1170
|
+
} else {
|
1171
|
+
delta.deltas.forEach(function(foldDelta) {
|
1172
|
+
this.addFolds(foldDelta.folds);
|
1173
|
+
}, this);
|
1174
|
+
}
|
1175
|
+
}
|
1176
|
+
this.$fromUndo = false;
|
1177
|
+
lastUndoRange &&
|
1178
|
+
this.$undoSelect &&
|
1179
|
+
!dontSelect &&
|
1180
|
+
this.selection.setSelectionRange(lastUndoRange);
|
1181
|
+
return lastUndoRange;
|
1182
|
+
};
|
1183
|
+
|
1184
|
+
/**
|
1185
|
+
* Re-implements a previously undone change to your document.
|
1186
|
+
* @param {Array} deltas An array of previous changes
|
1187
|
+
* @param {Boolean} dontSelect {:dontSelect}
|
1188
|
+
*
|
1189
|
+
*
|
1190
|
+
* @returns {Range}
|
1191
|
+
**/
|
1192
|
+
this.redoChanges = function(deltas, dontSelect) {
|
1193
|
+
if (!deltas.length)
|
1194
|
+
return;
|
1195
|
+
|
1196
|
+
this.$fromUndo = true;
|
1197
|
+
var lastUndoRange = null;
|
1198
|
+
for (var i = 0; i < deltas.length; i++) {
|
1199
|
+
var delta = deltas[i];
|
1200
|
+
if (delta.group == "doc") {
|
1201
|
+
this.doc.applyDeltas(delta.deltas);
|
1202
|
+
lastUndoRange =
|
1203
|
+
this.$getUndoSelection(delta.deltas, false, lastUndoRange);
|
1204
|
+
}
|
1205
|
+
}
|
1206
|
+
this.$fromUndo = false;
|
1207
|
+
lastUndoRange &&
|
1208
|
+
this.$undoSelect &&
|
1209
|
+
!dontSelect &&
|
1210
|
+
this.selection.setSelectionRange(lastUndoRange);
|
1211
|
+
return lastUndoRange;
|
1212
|
+
};
|
1213
|
+
|
1214
|
+
/**
|
1215
|
+
* Enables or disables highlighting of the range where an undo occured.
|
1216
|
+
* @param {Boolean} enable If `true`, selects the range of the reinserted change
|
1217
|
+
*
|
1218
|
+
**/
|
1219
|
+
this.setUndoSelect = function(enable) {
|
1220
|
+
this.$undoSelect = enable;
|
1221
|
+
};
|
1222
|
+
|
1223
|
+
this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) {
|
1224
|
+
function isInsert(delta) {
|
1225
|
+
var insert =
|
1226
|
+
delta.action === "insertText" || delta.action === "insertLines";
|
1227
|
+
return isUndo ? !insert : insert;
|
1228
|
+
}
|
1229
|
+
|
1230
|
+
var delta = deltas[0];
|
1231
|
+
var range, point;
|
1232
|
+
var lastDeltaIsInsert = false;
|
1233
|
+
if (isInsert(delta)) {
|
1234
|
+
range = Range.fromPoints(delta.range.start, delta.range.end);
|
1235
|
+
lastDeltaIsInsert = true;
|
1236
|
+
} else {
|
1237
|
+
range = Range.fromPoints(delta.range.start, delta.range.start);
|
1238
|
+
lastDeltaIsInsert = false;
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
for (var i = 1; i < deltas.length; i++) {
|
1242
|
+
delta = deltas[i];
|
1243
|
+
if (isInsert(delta)) {
|
1244
|
+
point = delta.range.start;
|
1245
|
+
if (range.compare(point.row, point.column) == -1) {
|
1246
|
+
range.setStart(delta.range.start);
|
1247
|
+
}
|
1248
|
+
point = delta.range.end;
|
1249
|
+
if (range.compare(point.row, point.column) == 1) {
|
1250
|
+
range.setEnd(delta.range.end);
|
1251
|
+
}
|
1252
|
+
lastDeltaIsInsert = true;
|
1253
|
+
} else {
|
1254
|
+
point = delta.range.start;
|
1255
|
+
if (range.compare(point.row, point.column) == -1) {
|
1256
|
+
range =
|
1257
|
+
Range.fromPoints(delta.range.start, delta.range.start);
|
1258
|
+
}
|
1259
|
+
lastDeltaIsInsert = false;
|
1260
|
+
}
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
// Check if this range and the last undo range has something in common.
|
1264
|
+
// If true, merge the ranges.
|
1265
|
+
if (lastUndoRange != null) {
|
1266
|
+
if (Range.comparePoints(lastUndoRange.start, range.start) === 0) {
|
1267
|
+
lastUndoRange.start.column += range.end.column - range.start.column;
|
1268
|
+
lastUndoRange.end.column += range.end.column - range.start.column;
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
var cmp = lastUndoRange.compareRange(range);
|
1272
|
+
if (cmp == 1) {
|
1273
|
+
range.setStart(lastUndoRange.start);
|
1274
|
+
} else if (cmp == -1) {
|
1275
|
+
range.setEnd(lastUndoRange.end);
|
1276
|
+
}
|
1277
|
+
}
|
1278
|
+
|
1279
|
+
return range;
|
1280
|
+
};
|
1281
|
+
|
1282
|
+
/**
|
1283
|
+
* Replaces a range in the document with the new `text`.
|
1284
|
+
*
|
1285
|
+
* @param {Range} range A specified Range to replace
|
1286
|
+
* @param {String} text The new text to use as a replacement
|
1287
|
+
* @returns {Object} An object containing the final row and column, like this:
|
1288
|
+
* ```
|
1289
|
+
* {row: endRow, column: 0}
|
1290
|
+
* ```
|
1291
|
+
* If the text and range are empty, this function returns an object containing the current `range.start` value.
|
1292
|
+
* If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value.
|
1293
|
+
*
|
1294
|
+
*
|
1295
|
+
*
|
1296
|
+
* @related Document.replace
|
1297
|
+
*
|
1298
|
+
*
|
1299
|
+
**/
|
1300
|
+
this.replace = function(range, text) {
|
1301
|
+
return this.doc.replace(range, text);
|
1302
|
+
};
|
1303
|
+
|
1304
|
+
/**
|
1305
|
+
* Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this:
|
1306
|
+
* ```json
|
1307
|
+
* { row: newRowLocation, column: newColumnLocation }
|
1308
|
+
* ```
|
1309
|
+
* @param {Range} fromRange The range of text you want moved within the document
|
1310
|
+
* @param {Object} toPosition The location (row and column) where you want to move the text to
|
1311
|
+
* @returns {Range} The new range where the text was moved to.
|
1312
|
+
*
|
1313
|
+
*
|
1314
|
+
*
|
1315
|
+
**/
|
1316
|
+
this.moveText = function(fromRange, toPosition, copy) {
|
1317
|
+
var text = this.getTextRange(fromRange);
|
1318
|
+
var folds = this.getFoldsInRange(fromRange);
|
1319
|
+
|
1320
|
+
var toRange = Range.fromPoints(toPosition, toPosition);
|
1321
|
+
if (!copy) {
|
1322
|
+
this.remove(fromRange);
|
1323
|
+
var rowDiff = fromRange.start.row - fromRange.end.row;
|
1324
|
+
var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;
|
1325
|
+
if (collDiff) {
|
1326
|
+
if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)
|
1327
|
+
toRange.start.column += collDiff;
|
1328
|
+
if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)
|
1329
|
+
toRange.end.column += collDiff;
|
1330
|
+
}
|
1331
|
+
if (rowDiff && toRange.start.row >= fromRange.end.row) {
|
1332
|
+
toRange.start.row += rowDiff;
|
1333
|
+
toRange.end.row += rowDiff;
|
1334
|
+
}
|
1335
|
+
}
|
1336
|
+
|
1337
|
+
toRange.end = this.insert(toRange.start, text);
|
1338
|
+
if (folds.length) {
|
1339
|
+
var oldStart = fromRange.start;
|
1340
|
+
var newStart = toRange.start;
|
1341
|
+
var rowDiff = newStart.row - oldStart.row;
|
1342
|
+
var collDiff = newStart.column - oldStart.column;
|
1343
|
+
this.addFolds(folds.map(function(x) {
|
1344
|
+
x = x.clone();
|
1345
|
+
if (x.start.row == oldStart.row)
|
1346
|
+
x.start.column += collDiff;
|
1347
|
+
if (x.end.row == oldStart.row)
|
1348
|
+
x.end.column += collDiff;
|
1349
|
+
x.start.row += rowDiff;
|
1350
|
+
x.end.row += rowDiff;
|
1351
|
+
return x;
|
1352
|
+
}));
|
1353
|
+
}
|
1354
|
+
|
1355
|
+
return toRange;
|
1356
|
+
};
|
1357
|
+
|
1358
|
+
/**
|
1359
|
+
* Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`.
|
1360
|
+
*
|
1361
|
+
* If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]].
|
1362
|
+
* @param {Number} startRow Starting row
|
1363
|
+
* @param {Number} endRow Ending row
|
1364
|
+
* @param {String} indentString The indent token
|
1365
|
+
*
|
1366
|
+
*
|
1367
|
+
**/
|
1368
|
+
this.indentRows = function(startRow, endRow, indentString) {
|
1369
|
+
indentString = indentString.replace(/\t/g, this.getTabString());
|
1370
|
+
for (var row=startRow; row<=endRow; row++)
|
1371
|
+
this.insert({row: row, column:0}, indentString);
|
1372
|
+
};
|
1373
|
+
|
1374
|
+
/**
|
1375
|
+
* Outdents all the rows defined by the `start` and `end` properties of `range`.
|
1376
|
+
* @param {Range} range A range of rows
|
1377
|
+
*
|
1378
|
+
*
|
1379
|
+
**/
|
1380
|
+
this.outdentRows = function (range) {
|
1381
|
+
var rowRange = range.collapseRows();
|
1382
|
+
var deleteRange = new Range(0, 0, 0, 0);
|
1383
|
+
var size = this.getTabSize();
|
1384
|
+
|
1385
|
+
for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {
|
1386
|
+
var line = this.getLine(i);
|
1387
|
+
|
1388
|
+
deleteRange.start.row = i;
|
1389
|
+
deleteRange.end.row = i;
|
1390
|
+
for (var j = 0; j < size; ++j)
|
1391
|
+
if (line.charAt(j) != ' ')
|
1392
|
+
break;
|
1393
|
+
if (j < size && line.charAt(j) == '\t') {
|
1394
|
+
deleteRange.start.column = j;
|
1395
|
+
deleteRange.end.column = j + 1;
|
1396
|
+
} else {
|
1397
|
+
deleteRange.start.column = 0;
|
1398
|
+
deleteRange.end.column = j;
|
1399
|
+
}
|
1400
|
+
this.remove(deleteRange);
|
1401
|
+
}
|
1402
|
+
};
|
1403
|
+
|
1404
|
+
this.$moveLines = function(firstRow, lastRow, dir) {
|
1405
|
+
firstRow = this.getRowFoldStart(firstRow);
|
1406
|
+
lastRow = this.getRowFoldEnd(lastRow);
|
1407
|
+
if (dir < 0) {
|
1408
|
+
var row = this.getRowFoldStart(firstRow + dir);
|
1409
|
+
if (row < 0) return 0;
|
1410
|
+
var diff = row-firstRow;
|
1411
|
+
} else if (dir > 0) {
|
1412
|
+
var row = this.getRowFoldEnd(lastRow + dir);
|
1413
|
+
if (row > this.doc.getLength()-1) return 0;
|
1414
|
+
var diff = row-lastRow;
|
1415
|
+
} else {
|
1416
|
+
firstRow = this.$clipRowToDocument(firstRow);
|
1417
|
+
lastRow = this.$clipRowToDocument(lastRow);
|
1418
|
+
var diff = lastRow - firstRow + 1;
|
1419
|
+
}
|
1420
|
+
|
1421
|
+
var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE);
|
1422
|
+
var folds = this.getFoldsInRange(range).map(function(x){
|
1423
|
+
x = x.clone();
|
1424
|
+
x.start.row += diff;
|
1425
|
+
x.end.row += diff;
|
1426
|
+
return x;
|
1427
|
+
});
|
1428
|
+
|
1429
|
+
var lines = dir == 0
|
1430
|
+
? this.doc.getLines(firstRow, lastRow)
|
1431
|
+
: this.doc.removeLines(firstRow, lastRow);
|
1432
|
+
this.doc.insertLines(firstRow+diff, lines);
|
1433
|
+
folds.length && this.addFolds(folds);
|
1434
|
+
return diff;
|
1435
|
+
};
|
1436
|
+
/**
|
1437
|
+
* Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`.
|
1438
|
+
* @param {Number} firstRow The starting row to move up
|
1439
|
+
* @param {Number} lastRow The final row to move up
|
1440
|
+
* @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
1441
|
+
*
|
1442
|
+
* @related Document.insertLines
|
1443
|
+
*
|
1444
|
+
**/
|
1445
|
+
this.moveLinesUp = function(firstRow, lastRow) {
|
1446
|
+
return this.$moveLines(firstRow, lastRow, -1);
|
1447
|
+
};
|
1448
|
+
|
1449
|
+
/**
|
1450
|
+
* Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`.
|
1451
|
+
* @param {Number} firstRow The starting row to move down
|
1452
|
+
* @param {Number} lastRow The final row to move down
|
1453
|
+
* @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
1454
|
+
*
|
1455
|
+
* @related Document.insertLines
|
1456
|
+
**/
|
1457
|
+
this.moveLinesDown = function(firstRow, lastRow) {
|
1458
|
+
return this.$moveLines(firstRow, lastRow, 1);
|
1459
|
+
};
|
1460
|
+
|
1461
|
+
/**
|
1462
|
+
* Duplicates all the text between `firstRow` and `lastRow`.
|
1463
|
+
* @param {Number} firstRow The starting row to duplicate
|
1464
|
+
* @param {Number} lastRow The final row to duplicate
|
1465
|
+
* @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`.
|
1466
|
+
*
|
1467
|
+
*
|
1468
|
+
**/
|
1469
|
+
this.duplicateLines = function(firstRow, lastRow) {
|
1470
|
+
return this.$moveLines(firstRow, lastRow, 0);
|
1471
|
+
};
|
1472
|
+
|
1473
|
+
|
1474
|
+
this.$clipRowToDocument = function(row) {
|
1475
|
+
return Math.max(0, Math.min(row, this.doc.getLength()-1));
|
1476
|
+
};
|
1477
|
+
|
1478
|
+
this.$clipColumnToRow = function(row, column) {
|
1479
|
+
if (column < 0)
|
1480
|
+
return 0;
|
1481
|
+
return Math.min(this.doc.getLine(row).length, column);
|
1482
|
+
};
|
1483
|
+
|
1484
|
+
|
1485
|
+
this.$clipPositionToDocument = function(row, column) {
|
1486
|
+
column = Math.max(0, column);
|
1487
|
+
|
1488
|
+
if (row < 0) {
|
1489
|
+
row = 0;
|
1490
|
+
column = 0;
|
1491
|
+
} else {
|
1492
|
+
var len = this.doc.getLength();
|
1493
|
+
if (row >= len) {
|
1494
|
+
row = len - 1;
|
1495
|
+
column = this.doc.getLine(len-1).length;
|
1496
|
+
} else {
|
1497
|
+
column = Math.min(this.doc.getLine(row).length, column);
|
1498
|
+
}
|
1499
|
+
}
|
1500
|
+
|
1501
|
+
return {
|
1502
|
+
row: row,
|
1503
|
+
column: column
|
1504
|
+
};
|
1505
|
+
};
|
1506
|
+
|
1507
|
+
this.$clipRangeToDocument = function(range) {
|
1508
|
+
if (range.start.row < 0) {
|
1509
|
+
range.start.row = 0;
|
1510
|
+
range.start.column = 0;
|
1511
|
+
} else {
|
1512
|
+
range.start.column = this.$clipColumnToRow(
|
1513
|
+
range.start.row,
|
1514
|
+
range.start.column
|
1515
|
+
);
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
var len = this.doc.getLength() - 1;
|
1519
|
+
if (range.end.row > len) {
|
1520
|
+
range.end.row = len;
|
1521
|
+
range.end.column = this.doc.getLine(len).length;
|
1522
|
+
} else {
|
1523
|
+
range.end.column = this.$clipColumnToRow(
|
1524
|
+
range.end.row,
|
1525
|
+
range.end.column
|
1526
|
+
);
|
1527
|
+
}
|
1528
|
+
return range;
|
1529
|
+
};
|
1530
|
+
|
1531
|
+
// WRAPMODE
|
1532
|
+
this.$wrapLimit = 80;
|
1533
|
+
this.$useWrapMode = false;
|
1534
|
+
this.$wrapLimitRange = {
|
1535
|
+
min : null,
|
1536
|
+
max : null
|
1537
|
+
};
|
1538
|
+
|
1539
|
+
/**
|
1540
|
+
* Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted.
|
1541
|
+
* @param {Boolean} useWrapMode Enable (or disable) wrap mode
|
1542
|
+
*
|
1543
|
+
*
|
1544
|
+
**/
|
1545
|
+
this.setUseWrapMode = function(useWrapMode) {
|
1546
|
+
if (useWrapMode != this.$useWrapMode) {
|
1547
|
+
this.$useWrapMode = useWrapMode;
|
1548
|
+
this.$modified = true;
|
1549
|
+
this.$resetRowCache(0);
|
1550
|
+
|
1551
|
+
// If wrapMode is activaed, the wrapData array has to be initialized.
|
1552
|
+
if (useWrapMode) {
|
1553
|
+
var len = this.getLength();
|
1554
|
+
this.$wrapData = Array(len);
|
1555
|
+
this.$updateWrapData(0, len - 1);
|
1556
|
+
}
|
1557
|
+
|
1558
|
+
this._signal("changeWrapMode");
|
1559
|
+
}
|
1560
|
+
};
|
1561
|
+
|
1562
|
+
/**
|
1563
|
+
* Returns `true` if wrap mode is being used; `false` otherwise.
|
1564
|
+
* @returns {Boolean}
|
1565
|
+
**/
|
1566
|
+
this.getUseWrapMode = function() {
|
1567
|
+
return this.$useWrapMode;
|
1568
|
+
};
|
1569
|
+
|
1570
|
+
// Allow the wrap limit to move freely between min and max. Either
|
1571
|
+
// parameter can be null to allow the wrap limit to be unconstrained
|
1572
|
+
// in that direction. Or set both parameters to the same number to pin
|
1573
|
+
// the limit to that value.
|
1574
|
+
/**
|
1575
|
+
* 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.
|
1576
|
+
* @param {Number} min The minimum wrap value (the left side wrap)
|
1577
|
+
* @param {Number} max The maximum wrap value (the right side wrap)
|
1578
|
+
*
|
1579
|
+
*
|
1580
|
+
**/
|
1581
|
+
this.setWrapLimitRange = function(min, max) {
|
1582
|
+
if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
|
1583
|
+
this.$wrapLimitRange = {
|
1584
|
+
min: min,
|
1585
|
+
max: max
|
1586
|
+
};
|
1587
|
+
this.$modified = true;
|
1588
|
+
// This will force a recalculation of the wrap limit
|
1589
|
+
this._signal("changeWrapMode");
|
1590
|
+
}
|
1591
|
+
};
|
1592
|
+
|
1593
|
+
/**
|
1594
|
+
* This should generally only be called by the renderer when a resize is detected.
|
1595
|
+
* @param {Number} desiredLimit The new wrap limit
|
1596
|
+
* @returns {Boolean}
|
1597
|
+
*
|
1598
|
+
* @private
|
1599
|
+
**/
|
1600
|
+
this.adjustWrapLimit = function(desiredLimit, $printMargin) {
|
1601
|
+
var limits = this.$wrapLimitRange;
|
1602
|
+
if (limits.max < 0)
|
1603
|
+
limits = {min: $printMargin, max: $printMargin};
|
1604
|
+
var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);
|
1605
|
+
if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {
|
1606
|
+
this.$wrapLimit = wrapLimit;
|
1607
|
+
this.$modified = true;
|
1608
|
+
if (this.$useWrapMode) {
|
1609
|
+
this.$updateWrapData(0, this.getLength() - 1);
|
1610
|
+
this.$resetRowCache(0);
|
1611
|
+
this._signal("changeWrapLimit");
|
1612
|
+
}
|
1613
|
+
return true;
|
1614
|
+
}
|
1615
|
+
return false;
|
1616
|
+
};
|
1617
|
+
|
1618
|
+
this.$constrainWrapLimit = function(wrapLimit, min, max) {
|
1619
|
+
if (min)
|
1620
|
+
wrapLimit = Math.max(min, wrapLimit);
|
1621
|
+
|
1622
|
+
if (max)
|
1623
|
+
wrapLimit = Math.min(max, wrapLimit);
|
1624
|
+
|
1625
|
+
return wrapLimit;
|
1626
|
+
};
|
1627
|
+
|
1628
|
+
/**
|
1629
|
+
* Returns the value of wrap limit.
|
1630
|
+
* @returns {Number} The wrap limit.
|
1631
|
+
**/
|
1632
|
+
this.getWrapLimit = function() {
|
1633
|
+
return this.$wrapLimit;
|
1634
|
+
};
|
1635
|
+
|
1636
|
+
/**
|
1637
|
+
* Sets the line length for soft wrap in the editor. Lines will break
|
1638
|
+
* at a minimum of the given length minus 20 chars and at a maximum
|
1639
|
+
* of the given number of chars.
|
1640
|
+
* @param {number} limit The maximum line length in chars, for soft wrapping lines.
|
1641
|
+
*/
|
1642
|
+
this.setWrapLimit = function (limit) {
|
1643
|
+
this.setWrapLimitRange(limit, limit);
|
1644
|
+
};
|
1645
|
+
|
1646
|
+
/**
|
1647
|
+
* Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:
|
1648
|
+
*
|
1649
|
+
* { min: wrapLimitRange_min, max: wrapLimitRange_max }
|
1650
|
+
*
|
1651
|
+
* @returns {Object}
|
1652
|
+
**/
|
1653
|
+
this.getWrapLimitRange = function() {
|
1654
|
+
// Avoid unexpected mutation by returning a copy
|
1655
|
+
return {
|
1656
|
+
min : this.$wrapLimitRange.min,
|
1657
|
+
max : this.$wrapLimitRange.max
|
1658
|
+
};
|
1659
|
+
};
|
1660
|
+
|
1661
|
+
this.$updateInternalDataOnChange = function(e) {
|
1662
|
+
var useWrapMode = this.$useWrapMode;
|
1663
|
+
var len;
|
1664
|
+
var action = e.data.action;
|
1665
|
+
var firstRow = e.data.range.start.row;
|
1666
|
+
var lastRow = e.data.range.end.row;
|
1667
|
+
var start = e.data.range.start;
|
1668
|
+
var end = e.data.range.end;
|
1669
|
+
var removedFolds = null;
|
1670
|
+
|
1671
|
+
if (action.indexOf("Lines") != -1) {
|
1672
|
+
if (action == "insertLines") {
|
1673
|
+
lastRow = firstRow + (e.data.lines.length);
|
1674
|
+
} else {
|
1675
|
+
lastRow = firstRow;
|
1676
|
+
}
|
1677
|
+
len = e.data.lines ? e.data.lines.length : lastRow - firstRow;
|
1678
|
+
} else {
|
1679
|
+
len = lastRow - firstRow;
|
1680
|
+
}
|
1681
|
+
|
1682
|
+
this.$updating = true;
|
1683
|
+
if (len != 0) {
|
1684
|
+
if (action.indexOf("remove") != -1) {
|
1685
|
+
this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len);
|
1686
|
+
|
1687
|
+
var foldLines = this.$foldData;
|
1688
|
+
removedFolds = this.getFoldsInRange(e.data.range);
|
1689
|
+
this.removeFolds(removedFolds);
|
1690
|
+
|
1691
|
+
var foldLine = this.getFoldLine(end.row);
|
1692
|
+
var idx = 0;
|
1693
|
+
if (foldLine) {
|
1694
|
+
foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
|
1695
|
+
foldLine.shiftRow(-len);
|
1696
|
+
|
1697
|
+
var foldLineBefore = this.getFoldLine(firstRow);
|
1698
|
+
if (foldLineBefore && foldLineBefore !== foldLine) {
|
1699
|
+
foldLineBefore.merge(foldLine);
|
1700
|
+
foldLine = foldLineBefore;
|
1701
|
+
}
|
1702
|
+
idx = foldLines.indexOf(foldLine) + 1;
|
1703
|
+
}
|
1704
|
+
|
1705
|
+
for (idx; idx < foldLines.length; idx++) {
|
1706
|
+
var foldLine = foldLines[idx];
|
1707
|
+
if (foldLine.start.row >= end.row) {
|
1708
|
+
foldLine.shiftRow(-len);
|
1709
|
+
}
|
1710
|
+
}
|
1711
|
+
|
1712
|
+
lastRow = firstRow;
|
1713
|
+
} else {
|
1714
|
+
var args = Array(len);
|
1715
|
+
args.unshift(firstRow, 0);
|
1716
|
+
var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache
|
1717
|
+
arr.splice.apply(arr, args);
|
1718
|
+
|
1719
|
+
// If some new line is added inside of a foldLine, then split
|
1720
|
+
// the fold line up.
|
1721
|
+
var foldLines = this.$foldData;
|
1722
|
+
var foldLine = this.getFoldLine(firstRow);
|
1723
|
+
var idx = 0;
|
1724
|
+
if (foldLine) {
|
1725
|
+
var cmp = foldLine.range.compareInside(start.row, start.column);
|
1726
|
+
// Inside of the foldLine range. Need to split stuff up.
|
1727
|
+
if (cmp == 0) {
|
1728
|
+
foldLine = foldLine.split(start.row, start.column);
|
1729
|
+
if (foldLine) {
|
1730
|
+
foldLine.shiftRow(len);
|
1731
|
+
foldLine.addRemoveChars(lastRow, 0, end.column - start.column);
|
1732
|
+
}
|
1733
|
+
} else
|
1734
|
+
// Infront of the foldLine but same row. Need to shift column.
|
1735
|
+
if (cmp == -1) {
|
1736
|
+
foldLine.addRemoveChars(firstRow, 0, end.column - start.column);
|
1737
|
+
foldLine.shiftRow(len);
|
1738
|
+
}
|
1739
|
+
// Nothing to do if the insert is after the foldLine.
|
1740
|
+
idx = foldLines.indexOf(foldLine) + 1;
|
1741
|
+
}
|
1742
|
+
|
1743
|
+
for (idx; idx < foldLines.length; idx++) {
|
1744
|
+
var foldLine = foldLines[idx];
|
1745
|
+
if (foldLine.start.row >= firstRow) {
|
1746
|
+
foldLine.shiftRow(len);
|
1747
|
+
}
|
1748
|
+
}
|
1749
|
+
}
|
1750
|
+
} else {
|
1751
|
+
// Realign folds. E.g. if you add some new chars before a fold, the
|
1752
|
+
// fold should "move" to the right.
|
1753
|
+
len = Math.abs(e.data.range.start.column - e.data.range.end.column);
|
1754
|
+
if (action.indexOf("remove") != -1) {
|
1755
|
+
// Get all the folds in the change range and remove them.
|
1756
|
+
removedFolds = this.getFoldsInRange(e.data.range);
|
1757
|
+
this.removeFolds(removedFolds);
|
1758
|
+
|
1759
|
+
len = -len;
|
1760
|
+
}
|
1761
|
+
var foldLine = this.getFoldLine(firstRow);
|
1762
|
+
if (foldLine) {
|
1763
|
+
foldLine.addRemoveChars(firstRow, start.column, len);
|
1764
|
+
}
|
1765
|
+
}
|
1766
|
+
|
1767
|
+
if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {
|
1768
|
+
console.error("doc.getLength() and $wrapData.length have to be the same!");
|
1769
|
+
}
|
1770
|
+
this.$updating = false;
|
1771
|
+
|
1772
|
+
if (useWrapMode)
|
1773
|
+
this.$updateWrapData(firstRow, lastRow);
|
1774
|
+
else
|
1775
|
+
this.$updateRowLengthCache(firstRow, lastRow);
|
1776
|
+
|
1777
|
+
return removedFolds;
|
1778
|
+
};
|
1779
|
+
|
1780
|
+
this.$updateRowLengthCache = function(firstRow, lastRow, b) {
|
1781
|
+
this.$rowLengthCache[firstRow] = null;
|
1782
|
+
this.$rowLengthCache[lastRow] = null;
|
1783
|
+
};
|
1784
|
+
|
1785
|
+
this.$updateWrapData = function(firstRow, lastRow) {
|
1786
|
+
var lines = this.doc.getAllLines();
|
1787
|
+
var tabSize = this.getTabSize();
|
1788
|
+
var wrapData = this.$wrapData;
|
1789
|
+
var wrapLimit = this.$wrapLimit;
|
1790
|
+
var tokens;
|
1791
|
+
var foldLine;
|
1792
|
+
|
1793
|
+
var row = firstRow;
|
1794
|
+
lastRow = Math.min(lastRow, lines.length - 1);
|
1795
|
+
while (row <= lastRow) {
|
1796
|
+
foldLine = this.getFoldLine(row, foldLine);
|
1797
|
+
if (!foldLine) {
|
1798
|
+
tokens = this.$getDisplayTokens(lines[row]);
|
1799
|
+
wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
1800
|
+
row ++;
|
1801
|
+
} else {
|
1802
|
+
tokens = [];
|
1803
|
+
foldLine.walk(function(placeholder, row, column, lastColumn) {
|
1804
|
+
var walkTokens;
|
1805
|
+
if (placeholder != null) {
|
1806
|
+
walkTokens = this.$getDisplayTokens(
|
1807
|
+
placeholder, tokens.length);
|
1808
|
+
walkTokens[0] = PLACEHOLDER_START;
|
1809
|
+
for (var i = 1; i < walkTokens.length; i++) {
|
1810
|
+
walkTokens[i] = PLACEHOLDER_BODY;
|
1811
|
+
}
|
1812
|
+
} else {
|
1813
|
+
walkTokens = this.$getDisplayTokens(
|
1814
|
+
lines[row].substring(lastColumn, column),
|
1815
|
+
tokens.length);
|
1816
|
+
}
|
1817
|
+
tokens = tokens.concat(walkTokens);
|
1818
|
+
}.bind(this),
|
1819
|
+
foldLine.end.row,
|
1820
|
+
lines[foldLine.end.row].length + 1
|
1821
|
+
);
|
1822
|
+
|
1823
|
+
wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
1824
|
+
row = foldLine.end.row + 1;
|
1825
|
+
}
|
1826
|
+
}
|
1827
|
+
};
|
1828
|
+
|
1829
|
+
// "Tokens"
|
1830
|
+
var CHAR = 1,
|
1831
|
+
CHAR_EXT = 2,
|
1832
|
+
PLACEHOLDER_START = 3,
|
1833
|
+
PLACEHOLDER_BODY = 4,
|
1834
|
+
PUNCTUATION = 9,
|
1835
|
+
SPACE = 10,
|
1836
|
+
TAB = 11,
|
1837
|
+
TAB_SPACE = 12;
|
1838
|
+
|
1839
|
+
|
1840
|
+
this.$computeWrapSplits = function(tokens, wrapLimit) {
|
1841
|
+
if (tokens.length == 0) {
|
1842
|
+
return [];
|
1843
|
+
}
|
1844
|
+
|
1845
|
+
var splits = [];
|
1846
|
+
var displayLength = tokens.length;
|
1847
|
+
var lastSplit = 0, lastDocSplit = 0;
|
1848
|
+
|
1849
|
+
var isCode = this.$wrapAsCode;
|
1850
|
+
|
1851
|
+
function addSplit(screenPos) {
|
1852
|
+
var displayed = tokens.slice(lastSplit, screenPos);
|
1853
|
+
|
1854
|
+
// The document size is the current size - the extra width for tabs
|
1855
|
+
// and multipleWidth characters.
|
1856
|
+
var len = displayed.length;
|
1857
|
+
displayed.join("").
|
1858
|
+
// Get all the TAB_SPACEs.
|
1859
|
+
replace(/12/g, function() {
|
1860
|
+
len -= 1;
|
1861
|
+
}).
|
1862
|
+
// Get all the CHAR_EXT/multipleWidth characters.
|
1863
|
+
replace(/2/g, function() {
|
1864
|
+
len -= 1;
|
1865
|
+
});
|
1866
|
+
|
1867
|
+
lastDocSplit += len;
|
1868
|
+
splits.push(lastDocSplit);
|
1869
|
+
lastSplit = screenPos;
|
1870
|
+
}
|
1871
|
+
|
1872
|
+
while (displayLength - lastSplit > wrapLimit) {
|
1873
|
+
// This is, where the split should be.
|
1874
|
+
var split = lastSplit + wrapLimit;
|
1875
|
+
|
1876
|
+
// If there is a space or tab at this split position, then making
|
1877
|
+
// a split is simple.
|
1878
|
+
if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {
|
1879
|
+
/* disabled see https://github.com/ajaxorg/ace/issues/1186
|
1880
|
+
// Include all following spaces + tabs in this split as well.
|
1881
|
+
while (tokens[split] >= SPACE) {
|
1882
|
+
split ++;
|
1883
|
+
} */
|
1884
|
+
addSplit(split);
|
1885
|
+
continue;
|
1886
|
+
}
|
1887
|
+
|
1888
|
+
// === ELSE ===
|
1889
|
+
// Check if split is inside of a placeholder. Placeholder are
|
1890
|
+
// not splitable. Therefore, seek the beginning of the placeholder
|
1891
|
+
// and try to place the split beofre the placeholder's start.
|
1892
|
+
if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {
|
1893
|
+
// Seek the start of the placeholder and do the split
|
1894
|
+
// before the placeholder. By definition there always
|
1895
|
+
// a PLACEHOLDER_START between split and lastSplit.
|
1896
|
+
for (split; split != lastSplit - 1; split--) {
|
1897
|
+
if (tokens[split] == PLACEHOLDER_START) {
|
1898
|
+
// split++; << No incremental here as we want to
|
1899
|
+
// have the position before the Placeholder.
|
1900
|
+
break;
|
1901
|
+
}
|
1902
|
+
}
|
1903
|
+
|
1904
|
+
// If the PLACEHOLDER_START is not the index of the
|
1905
|
+
// last split, then we can do the split
|
1906
|
+
if (split > lastSplit) {
|
1907
|
+
addSplit(split);
|
1908
|
+
continue;
|
1909
|
+
}
|
1910
|
+
|
1911
|
+
// If the PLACEHOLDER_START IS the index of the last
|
1912
|
+
// split, then we have to place the split after the
|
1913
|
+
// placeholder. So, let's seek for the end of the placeholder.
|
1914
|
+
split = lastSplit + wrapLimit;
|
1915
|
+
for (split; split < tokens.length; split++) {
|
1916
|
+
if (tokens[split] != PLACEHOLDER_BODY) {
|
1917
|
+
break;
|
1918
|
+
}
|
1919
|
+
}
|
1920
|
+
|
1921
|
+
// If spilt == tokens.length, then the placeholder is the last
|
1922
|
+
// thing in the line and adding a new split doesn't make sense.
|
1923
|
+
if (split == tokens.length) {
|
1924
|
+
break; // Breaks the while-loop.
|
1925
|
+
}
|
1926
|
+
|
1927
|
+
// Finally, add the split...
|
1928
|
+
addSplit(split);
|
1929
|
+
continue;
|
1930
|
+
}
|
1931
|
+
|
1932
|
+
// === ELSE ===
|
1933
|
+
// Search for the first non space/tab/placeholder/punctuation token backwards.
|
1934
|
+
var minSplit = Math.max(split - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1);
|
1935
|
+
while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
|
1936
|
+
split --;
|
1937
|
+
}
|
1938
|
+
if (isCode) {
|
1939
|
+
while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
|
1940
|
+
split --;
|
1941
|
+
}
|
1942
|
+
while (split > minSplit && tokens[split] == PUNCTUATION) {
|
1943
|
+
split --;
|
1944
|
+
}
|
1945
|
+
} else {
|
1946
|
+
while (split > minSplit && tokens[split] < SPACE) {
|
1947
|
+
split --;
|
1948
|
+
}
|
1949
|
+
}
|
1950
|
+
// If we found one, then add the split.
|
1951
|
+
if (split > minSplit) {
|
1952
|
+
addSplit(++split);
|
1953
|
+
continue;
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
// === ELSE ===
|
1957
|
+
split = lastSplit + wrapLimit;
|
1958
|
+
// The split is inside of a CHAR or CHAR_EXT token and no space
|
1959
|
+
// around -> force a split.
|
1960
|
+
if (tokens[split] == CHAR_EXT)
|
1961
|
+
split--;
|
1962
|
+
addSplit(split);
|
1963
|
+
}
|
1964
|
+
return splits;
|
1965
|
+
};
|
1966
|
+
|
1967
|
+
/**
|
1968
|
+
* Given a string, returns an array of the display characters, including tabs and spaces.
|
1969
|
+
* @param {String} str The string to check
|
1970
|
+
* @param {Number} offset The value to start at
|
1971
|
+
*
|
1972
|
+
*
|
1973
|
+
**/
|
1974
|
+
this.$getDisplayTokens = function(str, offset) {
|
1975
|
+
var arr = [];
|
1976
|
+
var tabSize;
|
1977
|
+
offset = offset || 0;
|
1978
|
+
|
1979
|
+
for (var i = 0; i < str.length; i++) {
|
1980
|
+
var c = str.charCodeAt(i);
|
1981
|
+
// Tab
|
1982
|
+
if (c == 9) {
|
1983
|
+
tabSize = this.getScreenTabSize(arr.length + offset);
|
1984
|
+
arr.push(TAB);
|
1985
|
+
for (var n = 1; n < tabSize; n++) {
|
1986
|
+
arr.push(TAB_SPACE);
|
1987
|
+
}
|
1988
|
+
}
|
1989
|
+
// Space
|
1990
|
+
else if (c == 32) {
|
1991
|
+
arr.push(SPACE);
|
1992
|
+
} else if((c > 39 && c < 48) || (c > 57 && c < 64)) {
|
1993
|
+
arr.push(PUNCTUATION);
|
1994
|
+
}
|
1995
|
+
// full width characters
|
1996
|
+
else if (c >= 0x1100 && isFullWidth(c)) {
|
1997
|
+
arr.push(CHAR, CHAR_EXT);
|
1998
|
+
} else {
|
1999
|
+
arr.push(CHAR);
|
2000
|
+
}
|
2001
|
+
}
|
2002
|
+
return arr;
|
2003
|
+
};
|
2004
|
+
|
2005
|
+
/**
|
2006
|
+
* Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen.
|
2007
|
+
* @param {String} str The string to calculate the screen width of
|
2008
|
+
* @param {Number} maxScreenColumn
|
2009
|
+
* @param {Number} screenColumn
|
2010
|
+
* @returns {[Number]} Returns an `int[]` array with two elements:<br/>
|
2011
|
+
* The first position indicates the number of columns for `str` on screen.<br/>
|
2012
|
+
* The second value contains the position of the document column that this function read until.
|
2013
|
+
*
|
2014
|
+
**/
|
2015
|
+
this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) {
|
2016
|
+
if (maxScreenColumn == 0)
|
2017
|
+
return [0, 0];
|
2018
|
+
if (maxScreenColumn == null)
|
2019
|
+
maxScreenColumn = Infinity;
|
2020
|
+
screenColumn = screenColumn || 0;
|
2021
|
+
|
2022
|
+
var c, column;
|
2023
|
+
for (column = 0; column < str.length; column++) {
|
2024
|
+
c = str.charCodeAt(column);
|
2025
|
+
// tab
|
2026
|
+
if (c == 9) {
|
2027
|
+
screenColumn += this.getScreenTabSize(screenColumn);
|
2028
|
+
}
|
2029
|
+
// full width characters
|
2030
|
+
else if (c >= 0x1100 && isFullWidth(c)) {
|
2031
|
+
screenColumn += 2;
|
2032
|
+
} else {
|
2033
|
+
screenColumn += 1;
|
2034
|
+
}
|
2035
|
+
if (screenColumn > maxScreenColumn) {
|
2036
|
+
break;
|
2037
|
+
}
|
2038
|
+
}
|
2039
|
+
|
2040
|
+
return [screenColumn, column];
|
2041
|
+
};
|
2042
|
+
|
2043
|
+
this.lineWidgets = null;
|
2044
|
+
/**
|
2045
|
+
* Returns number of screenrows in a wrapped line.
|
2046
|
+
* @param {Number} row The row number to check
|
2047
|
+
*
|
2048
|
+
* @returns {Number}
|
2049
|
+
**/
|
2050
|
+
this.getRowLength = function(row) {
|
2051
|
+
if (this.lineWidgets)
|
2052
|
+
var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
|
2053
|
+
else
|
2054
|
+
h = 0
|
2055
|
+
if (!this.$useWrapMode || !this.$wrapData[row]) {
|
2056
|
+
return 1 + h;
|
2057
|
+
} else {
|
2058
|
+
return this.$wrapData[row].length + 1 + h;
|
2059
|
+
}
|
2060
|
+
};
|
2061
|
+
this.getRowLineCount = function(row) {
|
2062
|
+
if (!this.$useWrapMode || !this.$wrapData[row]) {
|
2063
|
+
return 1;
|
2064
|
+
} else {
|
2065
|
+
return this.$wrapData[row].length + 1;
|
2066
|
+
}
|
2067
|
+
};
|
2068
|
+
|
2069
|
+
/**
|
2070
|
+
* Returns the position (on screen) for the last character in the provided screen row.
|
2071
|
+
* @param {Number} screenRow The screen row to check
|
2072
|
+
* @returns {Number}
|
2073
|
+
*
|
2074
|
+
* @related EditSession.documentToScreenColumn
|
2075
|
+
**/
|
2076
|
+
this.getScreenLastRowColumn = function(screenRow) {
|
2077
|
+
var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
|
2078
|
+
return this.documentToScreenColumn(pos.row, pos.column);
|
2079
|
+
};
|
2080
|
+
|
2081
|
+
/**
|
2082
|
+
* For the given document row and column, this returns the column position of the last screen row.
|
2083
|
+
* @param {Number} docRow
|
2084
|
+
*
|
2085
|
+
* @param {Number} docColumn
|
2086
|
+
**/
|
2087
|
+
this.getDocumentLastRowColumn = function(docRow, docColumn) {
|
2088
|
+
var screenRow = this.documentToScreenRow(docRow, docColumn);
|
2089
|
+
return this.getScreenLastRowColumn(screenRow);
|
2090
|
+
};
|
2091
|
+
|
2092
|
+
/**
|
2093
|
+
* For the given document row and column, this returns the document position of the last row.
|
2094
|
+
* @param {Number} docRow
|
2095
|
+
* @param {Number} docColumn
|
2096
|
+
*
|
2097
|
+
*
|
2098
|
+
**/
|
2099
|
+
this.getDocumentLastRowColumnPosition = function(docRow, docColumn) {
|
2100
|
+
var screenRow = this.documentToScreenRow(docRow, docColumn);
|
2101
|
+
return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);
|
2102
|
+
};
|
2103
|
+
|
2104
|
+
/**
|
2105
|
+
* For the given row, this returns the split data.
|
2106
|
+
* @returns {String}
|
2107
|
+
**/
|
2108
|
+
this.getRowSplitData = function(row) {
|
2109
|
+
if (!this.$useWrapMode) {
|
2110
|
+
return undefined;
|
2111
|
+
} else {
|
2112
|
+
return this.$wrapData[row];
|
2113
|
+
}
|
2114
|
+
};
|
2115
|
+
|
2116
|
+
/**
|
2117
|
+
* The distance to the next tab stop at the specified screen column.
|
2118
|
+
* @param {Number} screenColumn The screen column to check
|
2119
|
+
*
|
2120
|
+
*
|
2121
|
+
* @returns {Number}
|
2122
|
+
**/
|
2123
|
+
this.getScreenTabSize = function(screenColumn) {
|
2124
|
+
return this.$tabSize - screenColumn % this.$tabSize;
|
2125
|
+
};
|
2126
|
+
|
2127
|
+
|
2128
|
+
this.screenToDocumentRow = function(screenRow, screenColumn) {
|
2129
|
+
return this.screenToDocumentPosition(screenRow, screenColumn).row;
|
2130
|
+
};
|
2131
|
+
|
2132
|
+
|
2133
|
+
this.screenToDocumentColumn = function(screenRow, screenColumn) {
|
2134
|
+
return this.screenToDocumentPosition(screenRow, screenColumn).column;
|
2135
|
+
};
|
2136
|
+
|
2137
|
+
/**
|
2138
|
+
* 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}
|
2139
|
+
* @param {Number} screenRow The screen row to check
|
2140
|
+
* @param {Number} screenColumn The screen column to check
|
2141
|
+
* @returns {Object} The object returned has two properties: `row` and `column`.
|
2142
|
+
*
|
2143
|
+
*
|
2144
|
+
* @related EditSession.documentToScreenPosition
|
2145
|
+
*
|
2146
|
+
**/
|
2147
|
+
this.screenToDocumentPosition = function(screenRow, screenColumn) {
|
2148
|
+
if (screenRow < 0)
|
2149
|
+
return {row: 0, column: 0};
|
2150
|
+
|
2151
|
+
var line;
|
2152
|
+
var docRow = 0;
|
2153
|
+
var docColumn = 0;
|
2154
|
+
var column;
|
2155
|
+
var row = 0;
|
2156
|
+
var rowLength = 0;
|
2157
|
+
|
2158
|
+
var rowCache = this.$screenRowCache;
|
2159
|
+
var i = this.$getRowCacheIndex(rowCache, screenRow);
|
2160
|
+
var l = rowCache.length;
|
2161
|
+
if (l && i >= 0) {
|
2162
|
+
var row = rowCache[i];
|
2163
|
+
var docRow = this.$docRowCache[i];
|
2164
|
+
var doCache = screenRow > rowCache[l - 1];
|
2165
|
+
} else {
|
2166
|
+
var doCache = !l;
|
2167
|
+
}
|
2168
|
+
|
2169
|
+
var maxRow = this.getLength() - 1;
|
2170
|
+
var foldLine = this.getNextFoldLine(docRow);
|
2171
|
+
var foldStart = foldLine ? foldLine.start.row : Infinity;
|
2172
|
+
|
2173
|
+
while (row <= screenRow) {
|
2174
|
+
rowLength = this.getRowLength(docRow);
|
2175
|
+
if (row + rowLength > screenRow || docRow >= maxRow) {
|
2176
|
+
break;
|
2177
|
+
} else {
|
2178
|
+
row += rowLength;
|
2179
|
+
docRow++;
|
2180
|
+
if (docRow > foldStart) {
|
2181
|
+
docRow = foldLine.end.row+1;
|
2182
|
+
foldLine = this.getNextFoldLine(docRow, foldLine);
|
2183
|
+
foldStart = foldLine ? foldLine.start.row : Infinity;
|
2184
|
+
}
|
2185
|
+
}
|
2186
|
+
|
2187
|
+
if (doCache) {
|
2188
|
+
this.$docRowCache.push(docRow);
|
2189
|
+
this.$screenRowCache.push(row);
|
2190
|
+
}
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
if (foldLine && foldLine.start.row <= docRow) {
|
2194
|
+
line = this.getFoldDisplayLine(foldLine);
|
2195
|
+
docRow = foldLine.start.row;
|
2196
|
+
} else if (row + rowLength <= screenRow || docRow > maxRow) {
|
2197
|
+
// clip at the end of the document
|
2198
|
+
return {
|
2199
|
+
row: maxRow,
|
2200
|
+
column: this.getLine(maxRow).length
|
2201
|
+
};
|
2202
|
+
} else {
|
2203
|
+
line = this.getLine(docRow);
|
2204
|
+
foldLine = null;
|
2205
|
+
}
|
2206
|
+
|
2207
|
+
if (this.$useWrapMode) {
|
2208
|
+
var splits = this.$wrapData[docRow];
|
2209
|
+
if (splits) {
|
2210
|
+
var splitIndex = Math.floor(screenRow - row);
|
2211
|
+
column = splits[splitIndex];
|
2212
|
+
if(splitIndex > 0 && splits.length) {
|
2213
|
+
docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
|
2214
|
+
line = line.substring(docColumn);
|
2215
|
+
}
|
2216
|
+
}
|
2217
|
+
}
|
2218
|
+
|
2219
|
+
docColumn += this.$getStringScreenWidth(line, screenColumn)[1];
|
2220
|
+
|
2221
|
+
// We remove one character at the end so that the docColumn
|
2222
|
+
// position returned is not associated to the next row on the screen.
|
2223
|
+
if (this.$useWrapMode && docColumn >= column)
|
2224
|
+
docColumn = column - 1;
|
2225
|
+
|
2226
|
+
if (foldLine)
|
2227
|
+
return foldLine.idxToPosition(docColumn);
|
2228
|
+
|
2229
|
+
return {row: docRow, column: docColumn};
|
2230
|
+
};
|
2231
|
+
|
2232
|
+
/**
|
2233
|
+
* Converts document coordinates to screen coordinates. {:conversionConsiderations}
|
2234
|
+
* @param {Number} docRow The document row to check
|
2235
|
+
* @param {Number} docColumn The document column to check
|
2236
|
+
* @returns {Object} The object returned by this method has two properties: `row` and `column`.
|
2237
|
+
*
|
2238
|
+
*
|
2239
|
+
* @related EditSession.screenToDocumentPosition
|
2240
|
+
*
|
2241
|
+
**/
|
2242
|
+
this.documentToScreenPosition = function(docRow, docColumn) {
|
2243
|
+
// Normalize the passed in arguments.
|
2244
|
+
if (typeof docColumn === "undefined")
|
2245
|
+
var pos = this.$clipPositionToDocument(docRow.row, docRow.column);
|
2246
|
+
else
|
2247
|
+
pos = this.$clipPositionToDocument(docRow, docColumn);
|
2248
|
+
|
2249
|
+
docRow = pos.row;
|
2250
|
+
docColumn = pos.column;
|
2251
|
+
|
2252
|
+
var screenRow = 0;
|
2253
|
+
var foldStartRow = null;
|
2254
|
+
var fold = null;
|
2255
|
+
|
2256
|
+
// Clamp the docRow position in case it's inside of a folded block.
|
2257
|
+
fold = this.getFoldAt(docRow, docColumn, 1);
|
2258
|
+
if (fold) {
|
2259
|
+
docRow = fold.start.row;
|
2260
|
+
docColumn = fold.start.column;
|
2261
|
+
}
|
2262
|
+
|
2263
|
+
var rowEnd, row = 0;
|
2264
|
+
|
2265
|
+
|
2266
|
+
var rowCache = this.$docRowCache;
|
2267
|
+
var i = this.$getRowCacheIndex(rowCache, docRow);
|
2268
|
+
var l = rowCache.length;
|
2269
|
+
if (l && i >= 0) {
|
2270
|
+
var row = rowCache[i];
|
2271
|
+
var screenRow = this.$screenRowCache[i];
|
2272
|
+
var doCache = docRow > rowCache[l - 1];
|
2273
|
+
} else {
|
2274
|
+
var doCache = !l;
|
2275
|
+
}
|
2276
|
+
|
2277
|
+
var foldLine = this.getNextFoldLine(row);
|
2278
|
+
var foldStart = foldLine ?foldLine.start.row :Infinity;
|
2279
|
+
|
2280
|
+
while (row < docRow) {
|
2281
|
+
if (row >= foldStart) {
|
2282
|
+
rowEnd = foldLine.end.row + 1;
|
2283
|
+
if (rowEnd > docRow)
|
2284
|
+
break;
|
2285
|
+
foldLine = this.getNextFoldLine(rowEnd, foldLine);
|
2286
|
+
foldStart = foldLine ?foldLine.start.row :Infinity;
|
2287
|
+
}
|
2288
|
+
else {
|
2289
|
+
rowEnd = row + 1;
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
screenRow += this.getRowLength(row);
|
2293
|
+
row = rowEnd;
|
2294
|
+
|
2295
|
+
if (doCache) {
|
2296
|
+
this.$docRowCache.push(row);
|
2297
|
+
this.$screenRowCache.push(screenRow);
|
2298
|
+
}
|
2299
|
+
}
|
2300
|
+
|
2301
|
+
// Calculate the text line that is displayed in docRow on the screen.
|
2302
|
+
var textLine = "";
|
2303
|
+
// Check if the final row we want to reach is inside of a fold.
|
2304
|
+
if (foldLine && row >= foldStart) {
|
2305
|
+
textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);
|
2306
|
+
foldStartRow = foldLine.start.row;
|
2307
|
+
} else {
|
2308
|
+
textLine = this.getLine(docRow).substring(0, docColumn);
|
2309
|
+
foldStartRow = docRow;
|
2310
|
+
}
|
2311
|
+
// Clamp textLine if in wrapMode.
|
2312
|
+
if (this.$useWrapMode) {
|
2313
|
+
var wrapRow = this.$wrapData[foldStartRow];
|
2314
|
+
if (wrapRow) {
|
2315
|
+
var screenRowOffset = 0;
|
2316
|
+
while (textLine.length >= wrapRow[screenRowOffset]) {
|
2317
|
+
screenRow ++;
|
2318
|
+
screenRowOffset++;
|
2319
|
+
}
|
2320
|
+
textLine = textLine.substring(
|
2321
|
+
wrapRow[screenRowOffset - 1] || 0, textLine.length
|
2322
|
+
);
|
2323
|
+
}
|
2324
|
+
}
|
2325
|
+
|
2326
|
+
return {
|
2327
|
+
row: screenRow,
|
2328
|
+
column: this.$getStringScreenWidth(textLine)[0]
|
2329
|
+
};
|
2330
|
+
};
|
2331
|
+
|
2332
|
+
/**
|
2333
|
+
* For the given document row and column, returns the screen column.
|
2334
|
+
* @param {Number} row
|
2335
|
+
* @param {Number} docColumn
|
2336
|
+
* @returns {Number}
|
2337
|
+
*
|
2338
|
+
**/
|
2339
|
+
this.documentToScreenColumn = function(row, docColumn) {
|
2340
|
+
return this.documentToScreenPosition(row, docColumn).column;
|
2341
|
+
};
|
2342
|
+
|
2343
|
+
/**
|
2344
|
+
* For the given document row and column, returns the screen row.
|
2345
|
+
* @param {Number} docRow
|
2346
|
+
* @param {Number} docColumn
|
2347
|
+
*
|
2348
|
+
*
|
2349
|
+
**/
|
2350
|
+
this.documentToScreenRow = function(docRow, docColumn) {
|
2351
|
+
return this.documentToScreenPosition(docRow, docColumn).row;
|
2352
|
+
};
|
2353
|
+
|
2354
|
+
/**
|
2355
|
+
* Returns the length of the screen.
|
2356
|
+
* @returns {Number}
|
2357
|
+
**/
|
2358
|
+
this.getScreenLength = function() {
|
2359
|
+
var screenRows = 0;
|
2360
|
+
var fold = null;
|
2361
|
+
if (!this.$useWrapMode) {
|
2362
|
+
screenRows = this.getLength();
|
2363
|
+
|
2364
|
+
// Remove the folded lines again.
|
2365
|
+
var foldData = this.$foldData;
|
2366
|
+
for (var i = 0; i < foldData.length; i++) {
|
2367
|
+
fold = foldData[i];
|
2368
|
+
screenRows -= fold.end.row - fold.start.row;
|
2369
|
+
}
|
2370
|
+
} else {
|
2371
|
+
var lastRow = this.$wrapData.length;
|
2372
|
+
var row = 0, i = 0;
|
2373
|
+
var fold = this.$foldData[i++];
|
2374
|
+
var foldStart = fold ? fold.start.row :Infinity;
|
2375
|
+
|
2376
|
+
while (row < lastRow) {
|
2377
|
+
var splits = this.$wrapData[row];
|
2378
|
+
screenRows += splits ? splits.length + 1 : 1;
|
2379
|
+
row ++;
|
2380
|
+
if (row > foldStart) {
|
2381
|
+
row = fold.end.row+1;
|
2382
|
+
fold = this.$foldData[i++];
|
2383
|
+
foldStart = fold ?fold.start.row :Infinity;
|
2384
|
+
}
|
2385
|
+
}
|
2386
|
+
}
|
2387
|
+
|
2388
|
+
// todo
|
2389
|
+
if (this.lineWidgets)
|
2390
|
+
screenRows += this.$getWidgetScreenLength();
|
2391
|
+
|
2392
|
+
return screenRows;
|
2393
|
+
};
|
2394
|
+
|
2395
|
+
/**
|
2396
|
+
* @private
|
2397
|
+
*
|
2398
|
+
*/
|
2399
|
+
this.$setFontMetrics = function(fm) {
|
2400
|
+
// todo
|
2401
|
+
};
|
2402
|
+
|
2403
|
+
this.destroy = function() {
|
2404
|
+
if (this.bgTokenizer) {
|
2405
|
+
this.bgTokenizer.setDocument(null);
|
2406
|
+
this.bgTokenizer = null;
|
2407
|
+
}
|
2408
|
+
this.$stopWorker();
|
2409
|
+
};
|
2410
|
+
|
2411
|
+
// For every keystroke this gets called once per char in the whole doc!!
|
2412
|
+
// Wouldn't hurt to make it a bit faster for c >= 0x1100
|
2413
|
+
function isFullWidth(c) {
|
2414
|
+
if (c < 0x1100)
|
2415
|
+
return false;
|
2416
|
+
return c >= 0x1100 && c <= 0x115F ||
|
2417
|
+
c >= 0x11A3 && c <= 0x11A7 ||
|
2418
|
+
c >= 0x11FA && c <= 0x11FF ||
|
2419
|
+
c >= 0x2329 && c <= 0x232A ||
|
2420
|
+
c >= 0x2E80 && c <= 0x2E99 ||
|
2421
|
+
c >= 0x2E9B && c <= 0x2EF3 ||
|
2422
|
+
c >= 0x2F00 && c <= 0x2FD5 ||
|
2423
|
+
c >= 0x2FF0 && c <= 0x2FFB ||
|
2424
|
+
c >= 0x3000 && c <= 0x303E ||
|
2425
|
+
c >= 0x3041 && c <= 0x3096 ||
|
2426
|
+
c >= 0x3099 && c <= 0x30FF ||
|
2427
|
+
c >= 0x3105 && c <= 0x312D ||
|
2428
|
+
c >= 0x3131 && c <= 0x318E ||
|
2429
|
+
c >= 0x3190 && c <= 0x31BA ||
|
2430
|
+
c >= 0x31C0 && c <= 0x31E3 ||
|
2431
|
+
c >= 0x31F0 && c <= 0x321E ||
|
2432
|
+
c >= 0x3220 && c <= 0x3247 ||
|
2433
|
+
c >= 0x3250 && c <= 0x32FE ||
|
2434
|
+
c >= 0x3300 && c <= 0x4DBF ||
|
2435
|
+
c >= 0x4E00 && c <= 0xA48C ||
|
2436
|
+
c >= 0xA490 && c <= 0xA4C6 ||
|
2437
|
+
c >= 0xA960 && c <= 0xA97C ||
|
2438
|
+
c >= 0xAC00 && c <= 0xD7A3 ||
|
2439
|
+
c >= 0xD7B0 && c <= 0xD7C6 ||
|
2440
|
+
c >= 0xD7CB && c <= 0xD7FB ||
|
2441
|
+
c >= 0xF900 && c <= 0xFAFF ||
|
2442
|
+
c >= 0xFE10 && c <= 0xFE19 ||
|
2443
|
+
c >= 0xFE30 && c <= 0xFE52 ||
|
2444
|
+
c >= 0xFE54 && c <= 0xFE66 ||
|
2445
|
+
c >= 0xFE68 && c <= 0xFE6B ||
|
2446
|
+
c >= 0xFF01 && c <= 0xFF60 ||
|
2447
|
+
c >= 0xFFE0 && c <= 0xFFE6;
|
2448
|
+
};
|
2449
|
+
|
2450
|
+
}).call(EditSession.prototype);
|
2451
|
+
|
2452
|
+
require("./edit_session/folding").Folding.call(EditSession.prototype);
|
2453
|
+
require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);
|
2454
|
+
|
2455
|
+
|
2456
|
+
config.defineOptions(EditSession.prototype, "session", {
|
2457
|
+
wrap: {
|
2458
|
+
set: function(value) {
|
2459
|
+
if (!value || value == "off")
|
2460
|
+
value = false;
|
2461
|
+
else if (value == "free")
|
2462
|
+
value = true;
|
2463
|
+
else if (value == "printMargin")
|
2464
|
+
value = -1;
|
2465
|
+
else if (typeof value == "string")
|
2466
|
+
value = parseInt(value, 10) || false;
|
2467
|
+
|
2468
|
+
if (this.$wrap == value)
|
2469
|
+
return;
|
2470
|
+
if (!value) {
|
2471
|
+
this.setUseWrapMode(false);
|
2472
|
+
} else {
|
2473
|
+
var col = typeof value == "number" ? value : null;
|
2474
|
+
this.setWrapLimitRange(col, col);
|
2475
|
+
this.setUseWrapMode(true);
|
2476
|
+
}
|
2477
|
+
this.$wrap = value;
|
2478
|
+
},
|
2479
|
+
get: function() {
|
2480
|
+
if (this.getUseWrapMode()) {
|
2481
|
+
if (this.$wrap == -1)
|
2482
|
+
return "printMargin";
|
2483
|
+
if (!this.getWrapLimitRange().min)
|
2484
|
+
return "free";
|
2485
|
+
return this.$wrap;
|
2486
|
+
}
|
2487
|
+
return "off";
|
2488
|
+
},
|
2489
|
+
handlesSet: true
|
2490
|
+
},
|
2491
|
+
wrapMethod: {
|
2492
|
+
// code|text|auto
|
2493
|
+
set: function(val) {
|
2494
|
+
val = val == "auto"
|
2495
|
+
? this.$mode.type != "text"
|
2496
|
+
: val != "text";
|
2497
|
+
if (val != this.$wrapAsCode) {
|
2498
|
+
this.$wrapAsCode = val;
|
2499
|
+
if (this.$useWrapMode) {
|
2500
|
+
this.$modified = true;
|
2501
|
+
this.$resetRowCache(0);
|
2502
|
+
this.$updateWrapData(0, this.getLength() - 1);
|
2503
|
+
}
|
2504
|
+
}
|
2505
|
+
},
|
2506
|
+
initialValue: "auto"
|
2507
|
+
},
|
2508
|
+
firstLineNumber: {
|
2509
|
+
set: function() {this._signal("changeBreakpoint");},
|
2510
|
+
initialValue: 1
|
2511
|
+
},
|
2512
|
+
useWorker: {
|
2513
|
+
set: function(useWorker) {
|
2514
|
+
this.$useWorker = useWorker;
|
2515
|
+
|
2516
|
+
this.$stopWorker();
|
2517
|
+
if (useWorker)
|
2518
|
+
this.$startWorker();
|
2519
|
+
},
|
2520
|
+
initialValue: true
|
2521
|
+
},
|
2522
|
+
useSoftTabs: {initialValue: true},
|
2523
|
+
tabSize: {
|
2524
|
+
set: function(tabSize) {
|
2525
|
+
if (isNaN(tabSize) || this.$tabSize === tabSize) return;
|
2526
|
+
|
2527
|
+
this.$modified = true;
|
2528
|
+
this.$rowLengthCache = [];
|
2529
|
+
this.$tabSize = tabSize;
|
2530
|
+
this._signal("changeTabSize");
|
2531
|
+
},
|
2532
|
+
initialValue: 4,
|
2533
|
+
handlesSet: true
|
2534
|
+
},
|
2535
|
+
overwrite: {
|
2536
|
+
set: function(val) {this._signal("changeOverwrite");},
|
2537
|
+
initialValue: false
|
2538
|
+
},
|
2539
|
+
newLineMode: {
|
2540
|
+
set: function(val) {this.doc.setNewLineMode(val)},
|
2541
|
+
get: function() {return this.doc.getNewLineMode()},
|
2542
|
+
handlesSet: true
|
2543
|
+
},
|
2544
|
+
mode: {
|
2545
|
+
set: function(val) { this.setMode(val) },
|
2546
|
+
get: function() { return this.$modeId }
|
2547
|
+
}
|
2548
|
+
});
|
2549
|
+
|
2550
|
+
exports.EditSession = EditSession;
|
2551
|
+
});
|