From aab83cb39ddedd9f572b652dc6692b5bfcd84b48 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 4 Jul 2014 16:08:43 +0800 Subject: [PATCH] fix crazy mess in codemirror v3.24.0 --- .../{package => }/addon/comment/comment.js | 0 .../addon/comment/continuecomment.js | 0 .../{package => }/addon/dialog/dialog.css | 0 .../{package => }/addon/dialog/dialog.js | 0 .../addon/display/fullscreen.css | 0 .../{package => }/addon/display/fullscreen.js | 0 .../addon/display/placeholder.js | 0 .../{package => }/addon/display/rulers.js | 0 .../{package => }/addon/edit/closebrackets.js | 0 .../{package => }/addon/edit/closetag.js | 0 .../{package => }/addon/edit/continuelist.js | 0 .../{package => }/addon/edit/matchbrackets.js | 0 .../{package => }/addon/edit/matchtags.js | 0 .../{package => }/addon/edit/trailingspace.js | 0 .../{package => }/addon/fold/brace-fold.js | 0 .../{package => }/addon/fold/comment-fold.js | 0 .../{package => }/addon/fold/foldcode.js | 0 .../{package => }/addon/fold/foldgutter.css | 0 .../{package => }/addon/fold/foldgutter.js | 0 .../{package => }/addon/fold/indent-fold.js | 0 .../{package => }/addon/fold/markdown-fold.js | 0 .../{package => }/addon/fold/xml-fold.js | 0 .../{package => }/addon/hint/anyword-hint.js | 0 .../{package => }/addon/hint/css-hint.js | 0 .../{package => }/addon/hint/html-hint.js | 0 .../addon/hint/javascript-hint.js | 0 .../{package => }/addon/hint/python-hint.js | 0 .../{package => }/addon/hint/show-hint.css | 0 .../{package => }/addon/hint/show-hint.js | 0 .../{package => }/addon/hint/sql-hint.js | 0 .../{package => }/addon/hint/xml-hint.js | 0 .../addon/lint/coffeescript-lint.js | 0 .../{package => }/addon/lint/css-lint.js | 0 .../addon/lint/javascript-lint.js | 0 .../{package => }/addon/lint/json-lint.js | 0 .../3.24.0/{package => }/addon/lint/lint.css | 0 .../3.24.0/{package => }/addon/lint/lint.js | 0 .../{package => }/addon/lint/yaml-lint.js | 0 .../addon/merge/dep/diff_match_patch.js | 0 .../{package => }/addon/merge/merge.css | 0 .../3.24.0/{package => }/addon/merge/merge.js | 0 .../{package => }/addon/mode/loadmode.js | 0 .../{package => }/addon/mode/multiplex.js | 0 .../addon/mode/multiplex_test.js | 0 .../{package => }/addon/mode/overlay.js | 0 .../{package => }/addon/runmode/colorize.js | 0 .../addon/runmode/runmode-standalone.js | 0 .../{package => }/addon/runmode/runmode.js | 0 .../addon/runmode/runmode.node.js | 0 .../addon/scroll/scrollpastend.js | 0 .../addon/search/match-highlighter.js | 0 .../{package => }/addon/search/search.js | 0 .../addon/search/searchcursor.js | 0 .../addon/selection/active-line.js | 0 .../addon/selection/mark-selection.js | 0 .../3.24.0/{package => }/addon/tern/tern.css | 0 .../3.24.0/{package => }/addon/tern/tern.js | 0 .../3.24.0/{package => }/addon/tern/worker.js | 0 .../{package => }/addon/wrap/hardwrap.js | 0 .../libs/codemirror/3.24.0/codemirror.min.css | 1 + ajax/libs/codemirror/3.24.0/codemirror.min.js | 4 + .../3.24.0/{package => }/keymap/emacs.js | 0 .../3.24.0/{package => }/keymap/extra.js | 0 .../3.24.0/{package => }/keymap/vim.js | 0 .../3.24.0/{package => }/mode/apl/apl.js | 0 .../{package => }/mode/asterisk/asterisk.js | 0 .../3.24.0/{package => }/mode/clike/clike.js | 0 .../{package => }/mode/clojure/clojure.js | 0 .../3.24.0/{package => }/mode/cobol/cobol.js | 0 .../mode/coffeescript/coffeescript.js | 0 .../mode/commonlisp/commonlisp.js | 0 .../3.24.0/{package => }/mode/css/css.js | 0 .../{package => }/mode/css/less_test.js | 0 .../{package => }/mode/css/scss_test.js | 0 .../3.24.0/{package => }/mode/css/test.js | 0 .../3.24.0/{package => }/mode/d/d.js | 0 .../3.24.0/{package => }/mode/diff/diff.js | 0 .../{package => }/mode/django/django.js | 0 .../3.24.0/{package => }/mode/dtd/dtd.js | 0 .../3.24.0/{package => }/mode/dylan/dylan.js | 0 .../3.24.0/{package => }/mode/ecl/ecl.js | 0 .../{package => }/mode/eiffel/eiffel.js | 0 .../{package => }/mode/erlang/erlang.js | 0 .../{package => }/mode/fortran/fortran.js | 0 .../3.24.0/{package => }/mode/gas/gas.js | 0 .../3.24.0/{package => }/mode/gfm/gfm.js | 0 .../3.24.0/{package => }/mode/gfm/test.js | 0 .../{package => }/mode/gherkin/gherkin.js | 0 .../3.24.0/{package => }/mode/go/go.js | 0 .../{package => }/mode/groovy/groovy.js | 0 .../3.24.0/{package => }/mode/haml/haml.js | 0 .../3.24.0/{package => }/mode/haml/test.js | 0 .../{package => }/mode/haskell/haskell.js | 0 .../3.24.0/{package => }/mode/haxe/haxe.js | 0 .../mode/htmlembedded/htmlembedded.js | 0 .../{package => }/mode/htmlmixed/htmlmixed.js | 0 .../3.24.0/{package => }/mode/http/http.js | 0 .../3.24.0/{package => }/mode/jade/jade.js | 0 .../mode/javascript/javascript.js | 0 .../{package => }/mode/javascript/test.js | 0 .../{package => }/mode/jinja2/jinja2.js | 0 .../3.24.0/{package => }/mode/julia/julia.js | 0 .../3.24.0/{package => }/mode/less/less.js | 0 .../mode/livescript/livescript.js | 0 .../mode/livescript/livescript.ls | 0 .../3.24.0/{package => }/mode/lua/lua.js | 0 .../{package => }/mode/markdown/markdown.js | 0 .../{package => }/mode/markdown/test.js | 0 .../3.24.0/{package => }/mode/meta.js | 0 .../3.24.0/{package => }/mode/mirc/mirc.js | 0 .../{package => }/mode/mllike/mllike.js | 0 .../3.24.0/{package => }/mode/nginx/nginx.js | 0 .../{package => }/mode/ntriples/ntriples.js | 0 .../{package => }/mode/octave/octave.js | 0 .../{package => }/mode/pascal/pascal.js | 0 .../3.24.0/{package => }/mode/pegjs/pegjs.js | 0 .../3.24.0/{package => }/mode/perl/perl.js | 0 .../3.24.0/{package => }/mode/php/php.js | 0 .../3.24.0/{package => }/mode/php/test.js | 0 .../3.24.0/{package => }/mode/pig/pig.js | 0 .../mode/properties/properties.js | 0 .../{package => }/mode/puppet/puppet.js | 0 .../{package => }/mode/python/python.js | 0 .../3.24.0/{package => }/mode/q/q.js | 0 .../3.24.0/{package => }/mode/r/r.js | 0 .../{package => }/mode/rpm/changes/changes.js | 0 .../{package => }/mode/rpm/spec/spec.css | 0 .../{package => }/mode/rpm/spec/spec.js | 0 .../3.24.0/{package => }/mode/rst/rst.js | 0 .../3.24.0/{package => }/mode/ruby/ruby.js | 0 .../3.24.0/{package => }/mode/ruby/test.js | 0 .../3.24.0/{package => }/mode/rust/rust.js | 0 .../3.24.0/{package => }/mode/sass/sass.js | 0 .../{package => }/mode/scheme/scheme.js | 0 .../3.24.0/{package => }/mode/shell/shell.js | 0 .../3.24.0/{package => }/mode/sieve/sieve.js | 0 .../{package => }/mode/smalltalk/smalltalk.js | 0 .../{package => }/mode/smarty/smarty.js | 0 .../mode/smartymixed/smartymixed.js | 0 .../3.24.0/{package => }/mode/solr/solr.js | 0 .../{package => }/mode/sparql/sparql.js | 0 .../3.24.0/{package => }/mode/sql/sql.js | 0 .../3.24.0/{package => }/mode/stex/stex.js | 0 .../3.24.0/{package => }/mode/stex/test.js | 0 .../3.24.0/{package => }/mode/tcl/tcl.js | 0 .../mode/tiddlywiki/tiddlywiki.css | 0 .../mode/tiddlywiki/tiddlywiki.js | 0 .../3.24.0/{package => }/mode/tiki/tiki.css | 0 .../3.24.0/{package => }/mode/tiki/tiki.js | 0 .../3.24.0/{package => }/mode/toml/toml.js | 0 .../{package => }/mode/turtle/turtle.js | 0 .../3.24.0/{package => }/mode/vb/vb.js | 0 .../{package => }/mode/vbscript/vbscript.js | 0 .../{package => }/mode/velocity/velocity.js | 0 .../3.24.0/{package => }/mode/verilog/test.js | 0 .../{package => }/mode/verilog/verilog.js | 0 .../3.24.0/{package => }/mode/xml/test.js | 0 .../3.24.0/{package => }/mode/xml/xml.js | 0 .../3.24.0/{package => }/mode/xquery/test.js | 0 .../{package => }/mode/xquery/xquery.js | 0 .../3.24.0/{package => }/mode/yaml/yaml.js | 0 .../3.24.0/{package => }/mode/z80/z80.js | 0 ajax/libs/codemirror/3.24.0/package/AUTHORS | 341 -- .../codemirror/3.24.0/package/bin/authors.sh | 6 - .../codemirror/3.24.0/package/bin/compress | 92 - ajax/libs/codemirror/3.24.0/package/bin/lint | 16 - .../codemirror/3.24.0/package/bin/release | 44 - .../3.24.0/package/bin/source-highlight | 61 - .../libs/codemirror/3.24.0/package/bower.json | 15 - .../3.24.0/package/demo/activeline.html | 78 - .../3.24.0/package/demo/anywordhint.html | 79 - .../codemirror/3.24.0/package/demo/bidi.html | 74 - .../codemirror/3.24.0/package/demo/btree.html | 86 - .../3.24.0/package/demo/buffers.html | 109 - .../3.24.0/package/demo/changemode.html | 58 - .../3.24.0/package/demo/closebrackets.html | 63 - .../3.24.0/package/demo/closetag.html | 41 - .../3.24.0/package/demo/complete.html | 79 - .../codemirror/3.24.0/package/demo/emacs.html | 75 - .../3.24.0/package/demo/folding.html | 95 - .../3.24.0/package/demo/fullscreen.html | 83 - .../3.24.0/package/demo/hardwrap.html | 72 - .../3.24.0/package/demo/html5complete.html | 56 - .../3.24.0/package/demo/indentwrap.html | 59 - .../codemirror/3.24.0/package/demo/lint.html | 171 - .../3.24.0/package/demo/loadmode.html | 49 - .../3.24.0/package/demo/marker.html | 52 - .../3.24.0/package/demo/markselection.html | 45 - .../3.24.0/package/demo/matchhighlighter.html | 47 - .../3.24.0/package/demo/matchtags.html | 49 - .../codemirror/3.24.0/package/demo/merge.html | 81 - .../3.24.0/package/demo/multiplex.html | 75 - .../3.24.0/package/demo/mustache.html | 68 - .../3.24.0/package/demo/placeholder.html | 45 - .../3.24.0/package/demo/preview.html | 87 - .../3.24.0/package/demo/resize.html | 58 - .../3.24.0/package/demo/rulers.html | 54 - .../3.24.0/package/demo/runmode.html | 62 - .../3.24.0/package/demo/search.html | 87 - .../demo/spanaffectswrapping_shim.html | 85 - .../codemirror/3.24.0/package/demo/tern.html | 129 - .../codemirror/3.24.0/package/demo/theme.html | 125 - .../3.24.0/package/demo/trailingspace.html | 48 - .../3.24.0/package/demo/variableheight.html | 67 - .../codemirror/3.24.0/package/demo/vim.html | 77 - .../3.24.0/package/demo/visibletabs.html | 62 - .../3.24.0/package/demo/widget.html | 85 - .../3.24.0/package/demo/xmlcomplete.html | 120 - .../3.24.0/package/doc/activebookmark.js | 48 - .../3.24.0/package/doc/compress.html | 244 -- .../codemirror/3.24.0/package/doc/docs.css | 228 -- .../3.24.0/package/doc/internals.html | 503 --- .../codemirror/3.24.0/package/doc/logo.png | Bin 12003 -> 0 bytes .../codemirror/3.24.0/package/doc/logo.svg | 147 - .../codemirror/3.24.0/package/doc/manual.html | 2808 ---------------- .../3.24.0/package/doc/realworld.html | 145 - .../3.24.0/package/doc/reporting.html | 61 - .../3.24.0/package/doc/upgrade_v2.2.html | 96 - .../3.24.0/package/doc/upgrade_v3.html | 230 -- .../3.24.0/package/mode/apl/index.html | 72 - .../3.24.0/package/mode/asterisk/index.html | 154 - .../3.24.0/package/mode/clike/index.html | 200 -- .../3.24.0/package/mode/clike/scala.html | 767 ----- .../3.24.0/package/mode/clojure/index.html | 88 - .../3.24.0/package/mode/cobol/index.html | 210 -- .../3.24.0/package/mode/commonlisp/index.html | 177 - .../3.24.0/package/mode/css/index.html | 70 - .../3.24.0/package/mode/css/less.html | 152 - .../3.24.0/package/mode/css/scss.html | 157 - .../3.24.0/package/mode/diff/index.html | 117 - .../3.24.0/package/mode/django/index.html | 63 - .../3.24.0/package/mode/dtd/index.html | 89 - .../3.24.0/package/mode/ecl/index.html | 52 - .../3.24.0/package/mode/erlang/index.html | 76 - .../3.24.0/package/mode/fortran/index.html | 81 - .../3.24.0/package/mode/gas/index.html | 68 - .../3.24.0/package/mode/gfm/index.html | 82 - .../3.24.0/package/mode/gherkin/index.html | 48 - .../3.24.0/package/mode/go/index.html | 85 - .../3.24.0/package/mode/groovy/index.html | 84 - .../3.24.0/package/mode/haml/index.html | 79 - .../3.24.0/package/mode/haskell/index.html | 73 - .../3.24.0/package/mode/haxe/index.html | 103 - .../package/mode/htmlembedded/index.html | 58 - .../3.24.0/package/mode/htmlmixed/index.html | 85 - .../3.24.0/package/mode/http/index.html | 45 - .../codemirror/3.24.0/package/mode/index.html | 119 - .../3.24.0/package/mode/jade/index.html | 66 - .../3.24.0/package/mode/javascript/index.html | 109 - .../package/mode/javascript/json-ld.html | 72 - .../package/mode/javascript/typescript.html | 61 - .../3.24.0/package/mode/jinja2/index.html | 54 - .../3.24.0/package/mode/julia/index.html | 186 -- .../3.24.0/package/mode/less/index.html | 753 ----- .../3.24.0/package/mode/livescript/index.html | 459 --- .../3.24.0/package/mode/lua/index.html | 85 - .../3.24.0/package/mode/mirc/index.html | 160 - .../3.24.0/package/mode/mllike/index.html | 179 - .../3.24.0/package/mode/nginx/index.html | 181 - .../3.24.0/package/mode/ntriples/index.html | 45 - .../3.24.0/package/mode/octave/index.html | 83 - .../3.24.0/package/mode/pascal/index.html | 61 - .../3.24.0/package/mode/pegjs/index.html | 66 - .../3.24.0/package/mode/perl/index.html | 75 - .../3.24.0/package/mode/php/index.html | 64 - .../3.24.0/package/mode/pig/index.html | 55 - .../3.24.0/package/mode/properties/index.html | 53 - .../3.24.0/package/mode/python/index.html | 186 -- .../3.24.0/package/mode/q/index.html | 144 - .../3.24.0/package/mode/r/index.html | 85 - .../package/mode/rpm/changes/index.html | 66 - .../3.24.0/package/mode/rst/index.html | 535 --- .../3.24.0/package/mode/rust/index.html | 60 - .../3.24.0/package/mode/sass/index.html | 66 - .../3.24.0/package/mode/scheme/index.html | 77 - .../3.24.0/package/mode/shell/index.html | 66 - .../3.24.0/package/mode/sieve/index.html | 93 - .../3.24.0/package/mode/smalltalk/index.html | 68 - .../3.24.0/package/mode/smarty/index.html | 136 - .../package/mode/smartymixed/index.html | 114 - .../3.24.0/package/mode/solr/index.html | 57 - .../3.24.0/package/mode/sparql/index.html | 53 - .../3.24.0/package/mode/sql/index.html | 76 - .../3.24.0/package/mode/stex/index.html | 110 - .../3.24.0/package/mode/tcl/index.html | 142 - .../3.24.0/package/mode/tiddlywiki/index.html | 154 - .../3.24.0/package/mode/tiki/index.html | 95 - .../3.24.0/package/mode/toml/index.html | 73 - .../3.24.0/package/mode/turtle/index.html | 50 - .../3.24.0/package/mode/vb/index.html | 102 - .../3.24.0/package/mode/vbscript/index.html | 55 - .../3.24.0/package/mode/velocity/index.html | 118 - .../3.24.0/package/mode/verilog/index.html | 120 - .../3.24.0/package/mode/xml/index.html | 57 - .../3.24.0/package/mode/yaml/index.html | 80 - .../3.24.0/package/mode/z80/index.html | 52 - .../codemirror/3.24.0/package/package.json | 20 - .../3.24.0/package/test/comment_test.js | 63 - .../3.24.0/package/test/doc_test.js | 374 --- .../codemirror/3.24.0/package/test/driver.js | 131 - .../3.24.0/package/test/emacs_test.js | 138 - .../codemirror/3.24.0/package/test/index.html | 226 -- .../3.24.0/package/test/lint/acorn.js | 1593 --------- .../3.24.0/package/test/lint/lint.js | 139 - .../3.24.0/package/test/lint/walk.js | 216 -- .../3.24.0/package/test/mode_test.css | 10 - .../3.24.0/package/test/mode_test.js | 168 - .../3.24.0/package/test/phantom_driver.js | 31 - .../codemirror/3.24.0/package/test/run.js | 38 - .../3.24.0/package/test/search_test.js | 62 - .../codemirror/3.24.0/package/test/test.js | 1688 ---------- .../3.24.0/package/test/vim_test.js | 2932 ----------------- .../3.24.0/package/test/widget_test.js | 53 - .../3.24.0/{package => }/theme/3024-day.css | 0 .../3.24.0/{package => }/theme/3024-night.css | 0 .../{package => }/theme/ambiance-mobile.css | 0 .../3.24.0/{package => }/theme/ambiance.css | 0 .../{package => }/theme/base16-dark.css | 0 .../{package => }/theme/base16-light.css | 0 .../3.24.0/{package => }/theme/blackboard.css | 0 .../3.24.0/{package => }/theme/cobalt.css | 0 .../3.24.0/{package => }/theme/eclipse.css | 0 .../3.24.0/{package => }/theme/elegant.css | 0 .../{package => }/theme/erlang-dark.css | 0 .../{package => }/theme/lesser-dark.css | 0 .../3.24.0/{package => }/theme/mbo.css | 0 .../3.24.0/{package => }/theme/mdn-like.css | 0 .../3.24.0/{package => }/theme/midnight.css | 0 .../3.24.0/{package => }/theme/monokai.css | 0 .../3.24.0/{package => }/theme/neat.css | 0 .../3.24.0/{package => }/theme/night.css | 0 .../{package => }/theme/paraiso-dark.css | 0 .../{package => }/theme/paraiso-light.css | 0 .../{package => }/theme/pastel-on-dark.css | 0 .../3.24.0/{package => }/theme/rubyblue.css | 0 .../3.24.0/{package => }/theme/solarized.css | 0 .../3.24.0/{package => }/theme/the-matrix.css | 0 .../theme/tomorrow-night-eighties.css | 0 .../3.24.0/{package => }/theme/twilight.css | 0 .../{package => }/theme/vibrant-ink.css | 0 .../3.24.0/{package => }/theme/xq-dark.css | 0 .../3.24.0/{package => }/theme/xq-light.css | 0 342 files changed, 5 insertions(+), 25313 deletions(-) rename ajax/libs/codemirror/3.24.0/{package => }/addon/comment/comment.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/comment/continuecomment.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/dialog/dialog.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/dialog/dialog.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/display/fullscreen.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/display/fullscreen.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/display/placeholder.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/display/rulers.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/edit/closebrackets.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/edit/closetag.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/edit/continuelist.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/edit/matchbrackets.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/edit/matchtags.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/edit/trailingspace.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/brace-fold.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/comment-fold.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/foldcode.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/foldgutter.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/foldgutter.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/indent-fold.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/markdown-fold.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/fold/xml-fold.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/anyword-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/css-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/html-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/javascript-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/python-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/show-hint.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/show-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/sql-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/hint/xml-hint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/coffeescript-lint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/css-lint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/javascript-lint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/json-lint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/lint.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/lint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/lint/yaml-lint.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/merge/dep/diff_match_patch.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/merge/merge.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/merge/merge.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/mode/loadmode.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/mode/multiplex.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/mode/multiplex_test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/mode/overlay.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/runmode/colorize.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/runmode/runmode-standalone.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/runmode/runmode.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/runmode/runmode.node.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/scroll/scrollpastend.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/search/match-highlighter.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/search/search.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/search/searchcursor.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/selection/active-line.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/selection/mark-selection.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/tern/tern.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/tern/tern.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/tern/worker.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/addon/wrap/hardwrap.js (100%) create mode 100644 ajax/libs/codemirror/3.24.0/codemirror.min.css create mode 100644 ajax/libs/codemirror/3.24.0/codemirror.min.js rename ajax/libs/codemirror/3.24.0/{package => }/keymap/emacs.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/keymap/extra.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/keymap/vim.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/apl/apl.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/asterisk/asterisk.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/clike/clike.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/clojure/clojure.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/cobol/cobol.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/coffeescript/coffeescript.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/commonlisp/commonlisp.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/css/css.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/css/less_test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/css/scss_test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/css/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/d/d.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/diff/diff.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/django/django.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/dtd/dtd.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/dylan/dylan.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/ecl/ecl.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/eiffel/eiffel.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/erlang/erlang.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/fortran/fortran.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/gas/gas.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/gfm/gfm.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/gfm/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/gherkin/gherkin.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/go/go.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/groovy/groovy.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/haml/haml.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/haml/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/haskell/haskell.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/haxe/haxe.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/htmlembedded/htmlembedded.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/htmlmixed/htmlmixed.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/http/http.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/jade/jade.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/javascript/javascript.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/javascript/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/jinja2/jinja2.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/julia/julia.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/less/less.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/livescript/livescript.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/livescript/livescript.ls (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/lua/lua.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/markdown/markdown.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/markdown/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/meta.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/mirc/mirc.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/mllike/mllike.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/nginx/nginx.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/ntriples/ntriples.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/octave/octave.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/pascal/pascal.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/pegjs/pegjs.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/perl/perl.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/php/php.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/php/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/pig/pig.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/properties/properties.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/puppet/puppet.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/python/python.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/q/q.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/r/r.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/rpm/changes/changes.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/rpm/spec/spec.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/rpm/spec/spec.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/rst/rst.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/ruby/ruby.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/ruby/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/rust/rust.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/sass/sass.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/scheme/scheme.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/shell/shell.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/sieve/sieve.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/smalltalk/smalltalk.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/smarty/smarty.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/smartymixed/smartymixed.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/solr/solr.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/sparql/sparql.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/sql/sql.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/stex/stex.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/stex/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/tcl/tcl.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/tiddlywiki/tiddlywiki.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/tiddlywiki/tiddlywiki.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/tiki/tiki.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/tiki/tiki.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/toml/toml.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/turtle/turtle.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/vb/vb.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/vbscript/vbscript.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/velocity/velocity.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/verilog/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/verilog/verilog.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/xml/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/xml/xml.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/xquery/test.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/xquery/xquery.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/yaml/yaml.js (100%) rename ajax/libs/codemirror/3.24.0/{package => }/mode/z80/z80.js (100%) delete mode 100644 ajax/libs/codemirror/3.24.0/package/AUTHORS delete mode 100755 ajax/libs/codemirror/3.24.0/package/bin/authors.sh delete mode 100755 ajax/libs/codemirror/3.24.0/package/bin/compress delete mode 100755 ajax/libs/codemirror/3.24.0/package/bin/lint delete mode 100755 ajax/libs/codemirror/3.24.0/package/bin/release delete mode 100755 ajax/libs/codemirror/3.24.0/package/bin/source-highlight delete mode 100644 ajax/libs/codemirror/3.24.0/package/bower.json delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/activeline.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/anywordhint.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/bidi.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/btree.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/buffers.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/changemode.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/closebrackets.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/closetag.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/complete.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/emacs.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/folding.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/fullscreen.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/hardwrap.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/html5complete.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/indentwrap.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/lint.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/loadmode.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/marker.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/markselection.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/matchhighlighter.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/matchtags.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/merge.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/multiplex.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/mustache.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/placeholder.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/preview.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/resize.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/rulers.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/runmode.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/search.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/spanaffectswrapping_shim.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/tern.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/theme.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/trailingspace.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/variableheight.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/vim.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/visibletabs.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/widget.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/demo/xmlcomplete.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/activebookmark.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/compress.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/docs.css delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/internals.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/logo.png delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/logo.svg delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/manual.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/realworld.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/reporting.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/upgrade_v2.2.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/doc/upgrade_v3.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/apl/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/asterisk/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/clike/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/clike/scala.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/clojure/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/cobol/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/commonlisp/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/css/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/css/less.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/css/scss.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/diff/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/django/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/dtd/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/ecl/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/erlang/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/fortran/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/gas/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/gfm/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/gherkin/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/go/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/groovy/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/haml/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/haskell/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/haxe/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/htmlembedded/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/htmlmixed/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/http/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/jade/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/javascript/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/javascript/json-ld.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/javascript/typescript.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/jinja2/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/julia/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/less/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/livescript/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/lua/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/mirc/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/mllike/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/nginx/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/ntriples/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/octave/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/pascal/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/pegjs/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/perl/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/php/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/pig/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/properties/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/python/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/q/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/r/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/rpm/changes/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/rst/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/rust/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/sass/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/scheme/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/shell/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/sieve/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/smalltalk/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/smarty/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/smartymixed/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/solr/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/sparql/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/sql/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/stex/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/tcl/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/tiki/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/toml/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/turtle/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/vb/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/vbscript/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/velocity/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/verilog/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/xml/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/yaml/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/mode/z80/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/package.json delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/comment_test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/doc_test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/driver.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/emacs_test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/index.html delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/lint/acorn.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/lint/lint.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/lint/walk.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/mode_test.css delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/mode_test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/phantom_driver.js delete mode 100755 ajax/libs/codemirror/3.24.0/package/test/run.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/search_test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/vim_test.js delete mode 100644 ajax/libs/codemirror/3.24.0/package/test/widget_test.js rename ajax/libs/codemirror/3.24.0/{package => }/theme/3024-day.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/3024-night.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/ambiance-mobile.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/ambiance.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/base16-dark.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/base16-light.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/blackboard.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/cobalt.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/eclipse.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/elegant.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/erlang-dark.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/lesser-dark.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/mbo.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/mdn-like.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/midnight.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/monokai.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/neat.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/night.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/paraiso-dark.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/paraiso-light.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/pastel-on-dark.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/rubyblue.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/solarized.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/the-matrix.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/tomorrow-night-eighties.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/twilight.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/vibrant-ink.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/xq-dark.css (100%) rename ajax/libs/codemirror/3.24.0/{package => }/theme/xq-light.css (100%) diff --git a/ajax/libs/codemirror/3.24.0/package/addon/comment/comment.js b/ajax/libs/codemirror/3.24.0/addon/comment/comment.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/comment/comment.js rename to ajax/libs/codemirror/3.24.0/addon/comment/comment.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/comment/continuecomment.js b/ajax/libs/codemirror/3.24.0/addon/comment/continuecomment.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/comment/continuecomment.js rename to ajax/libs/codemirror/3.24.0/addon/comment/continuecomment.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/dialog/dialog.css b/ajax/libs/codemirror/3.24.0/addon/dialog/dialog.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/dialog/dialog.css rename to ajax/libs/codemirror/3.24.0/addon/dialog/dialog.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/dialog/dialog.js b/ajax/libs/codemirror/3.24.0/addon/dialog/dialog.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/dialog/dialog.js rename to ajax/libs/codemirror/3.24.0/addon/dialog/dialog.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/display/fullscreen.css b/ajax/libs/codemirror/3.24.0/addon/display/fullscreen.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/display/fullscreen.css rename to ajax/libs/codemirror/3.24.0/addon/display/fullscreen.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/display/fullscreen.js b/ajax/libs/codemirror/3.24.0/addon/display/fullscreen.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/display/fullscreen.js rename to ajax/libs/codemirror/3.24.0/addon/display/fullscreen.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/display/placeholder.js b/ajax/libs/codemirror/3.24.0/addon/display/placeholder.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/display/placeholder.js rename to ajax/libs/codemirror/3.24.0/addon/display/placeholder.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/display/rulers.js b/ajax/libs/codemirror/3.24.0/addon/display/rulers.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/display/rulers.js rename to ajax/libs/codemirror/3.24.0/addon/display/rulers.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/edit/closebrackets.js b/ajax/libs/codemirror/3.24.0/addon/edit/closebrackets.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/edit/closebrackets.js rename to ajax/libs/codemirror/3.24.0/addon/edit/closebrackets.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/edit/closetag.js b/ajax/libs/codemirror/3.24.0/addon/edit/closetag.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/edit/closetag.js rename to ajax/libs/codemirror/3.24.0/addon/edit/closetag.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/edit/continuelist.js b/ajax/libs/codemirror/3.24.0/addon/edit/continuelist.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/edit/continuelist.js rename to ajax/libs/codemirror/3.24.0/addon/edit/continuelist.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/edit/matchbrackets.js b/ajax/libs/codemirror/3.24.0/addon/edit/matchbrackets.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/edit/matchbrackets.js rename to ajax/libs/codemirror/3.24.0/addon/edit/matchbrackets.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/edit/matchtags.js b/ajax/libs/codemirror/3.24.0/addon/edit/matchtags.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/edit/matchtags.js rename to ajax/libs/codemirror/3.24.0/addon/edit/matchtags.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/edit/trailingspace.js b/ajax/libs/codemirror/3.24.0/addon/edit/trailingspace.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/edit/trailingspace.js rename to ajax/libs/codemirror/3.24.0/addon/edit/trailingspace.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/brace-fold.js b/ajax/libs/codemirror/3.24.0/addon/fold/brace-fold.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/brace-fold.js rename to ajax/libs/codemirror/3.24.0/addon/fold/brace-fold.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/comment-fold.js b/ajax/libs/codemirror/3.24.0/addon/fold/comment-fold.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/comment-fold.js rename to ajax/libs/codemirror/3.24.0/addon/fold/comment-fold.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/foldcode.js b/ajax/libs/codemirror/3.24.0/addon/fold/foldcode.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/foldcode.js rename to ajax/libs/codemirror/3.24.0/addon/fold/foldcode.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/foldgutter.css b/ajax/libs/codemirror/3.24.0/addon/fold/foldgutter.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/foldgutter.css rename to ajax/libs/codemirror/3.24.0/addon/fold/foldgutter.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/foldgutter.js b/ajax/libs/codemirror/3.24.0/addon/fold/foldgutter.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/foldgutter.js rename to ajax/libs/codemirror/3.24.0/addon/fold/foldgutter.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/indent-fold.js b/ajax/libs/codemirror/3.24.0/addon/fold/indent-fold.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/indent-fold.js rename to ajax/libs/codemirror/3.24.0/addon/fold/indent-fold.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/markdown-fold.js b/ajax/libs/codemirror/3.24.0/addon/fold/markdown-fold.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/markdown-fold.js rename to ajax/libs/codemirror/3.24.0/addon/fold/markdown-fold.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/fold/xml-fold.js b/ajax/libs/codemirror/3.24.0/addon/fold/xml-fold.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/fold/xml-fold.js rename to ajax/libs/codemirror/3.24.0/addon/fold/xml-fold.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/anyword-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/anyword-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/anyword-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/anyword-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/css-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/css-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/css-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/css-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/html-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/html-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/html-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/html-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/javascript-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/javascript-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/javascript-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/javascript-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/python-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/python-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/python-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/python-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/show-hint.css b/ajax/libs/codemirror/3.24.0/addon/hint/show-hint.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/show-hint.css rename to ajax/libs/codemirror/3.24.0/addon/hint/show-hint.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/show-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/show-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/show-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/show-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/sql-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/sql-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/sql-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/sql-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/hint/xml-hint.js b/ajax/libs/codemirror/3.24.0/addon/hint/xml-hint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/hint/xml-hint.js rename to ajax/libs/codemirror/3.24.0/addon/hint/xml-hint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/coffeescript-lint.js b/ajax/libs/codemirror/3.24.0/addon/lint/coffeescript-lint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/coffeescript-lint.js rename to ajax/libs/codemirror/3.24.0/addon/lint/coffeescript-lint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/css-lint.js b/ajax/libs/codemirror/3.24.0/addon/lint/css-lint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/css-lint.js rename to ajax/libs/codemirror/3.24.0/addon/lint/css-lint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/javascript-lint.js b/ajax/libs/codemirror/3.24.0/addon/lint/javascript-lint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/javascript-lint.js rename to ajax/libs/codemirror/3.24.0/addon/lint/javascript-lint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/json-lint.js b/ajax/libs/codemirror/3.24.0/addon/lint/json-lint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/json-lint.js rename to ajax/libs/codemirror/3.24.0/addon/lint/json-lint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/lint.css b/ajax/libs/codemirror/3.24.0/addon/lint/lint.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/lint.css rename to ajax/libs/codemirror/3.24.0/addon/lint/lint.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/lint.js b/ajax/libs/codemirror/3.24.0/addon/lint/lint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/lint.js rename to ajax/libs/codemirror/3.24.0/addon/lint/lint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/lint/yaml-lint.js b/ajax/libs/codemirror/3.24.0/addon/lint/yaml-lint.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/lint/yaml-lint.js rename to ajax/libs/codemirror/3.24.0/addon/lint/yaml-lint.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/merge/dep/diff_match_patch.js b/ajax/libs/codemirror/3.24.0/addon/merge/dep/diff_match_patch.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/merge/dep/diff_match_patch.js rename to ajax/libs/codemirror/3.24.0/addon/merge/dep/diff_match_patch.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/merge/merge.css b/ajax/libs/codemirror/3.24.0/addon/merge/merge.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/merge/merge.css rename to ajax/libs/codemirror/3.24.0/addon/merge/merge.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/merge/merge.js b/ajax/libs/codemirror/3.24.0/addon/merge/merge.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/merge/merge.js rename to ajax/libs/codemirror/3.24.0/addon/merge/merge.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/mode/loadmode.js b/ajax/libs/codemirror/3.24.0/addon/mode/loadmode.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/mode/loadmode.js rename to ajax/libs/codemirror/3.24.0/addon/mode/loadmode.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/mode/multiplex.js b/ajax/libs/codemirror/3.24.0/addon/mode/multiplex.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/mode/multiplex.js rename to ajax/libs/codemirror/3.24.0/addon/mode/multiplex.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/mode/multiplex_test.js b/ajax/libs/codemirror/3.24.0/addon/mode/multiplex_test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/mode/multiplex_test.js rename to ajax/libs/codemirror/3.24.0/addon/mode/multiplex_test.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/mode/overlay.js b/ajax/libs/codemirror/3.24.0/addon/mode/overlay.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/mode/overlay.js rename to ajax/libs/codemirror/3.24.0/addon/mode/overlay.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/runmode/colorize.js b/ajax/libs/codemirror/3.24.0/addon/runmode/colorize.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/runmode/colorize.js rename to ajax/libs/codemirror/3.24.0/addon/runmode/colorize.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/runmode/runmode-standalone.js b/ajax/libs/codemirror/3.24.0/addon/runmode/runmode-standalone.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/runmode/runmode-standalone.js rename to ajax/libs/codemirror/3.24.0/addon/runmode/runmode-standalone.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/runmode/runmode.js b/ajax/libs/codemirror/3.24.0/addon/runmode/runmode.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/runmode/runmode.js rename to ajax/libs/codemirror/3.24.0/addon/runmode/runmode.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/runmode/runmode.node.js b/ajax/libs/codemirror/3.24.0/addon/runmode/runmode.node.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/runmode/runmode.node.js rename to ajax/libs/codemirror/3.24.0/addon/runmode/runmode.node.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/scroll/scrollpastend.js b/ajax/libs/codemirror/3.24.0/addon/scroll/scrollpastend.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/scroll/scrollpastend.js rename to ajax/libs/codemirror/3.24.0/addon/scroll/scrollpastend.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/search/match-highlighter.js b/ajax/libs/codemirror/3.24.0/addon/search/match-highlighter.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/search/match-highlighter.js rename to ajax/libs/codemirror/3.24.0/addon/search/match-highlighter.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/search/search.js b/ajax/libs/codemirror/3.24.0/addon/search/search.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/search/search.js rename to ajax/libs/codemirror/3.24.0/addon/search/search.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/search/searchcursor.js b/ajax/libs/codemirror/3.24.0/addon/search/searchcursor.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/search/searchcursor.js rename to ajax/libs/codemirror/3.24.0/addon/search/searchcursor.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/selection/active-line.js b/ajax/libs/codemirror/3.24.0/addon/selection/active-line.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/selection/active-line.js rename to ajax/libs/codemirror/3.24.0/addon/selection/active-line.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/selection/mark-selection.js b/ajax/libs/codemirror/3.24.0/addon/selection/mark-selection.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/selection/mark-selection.js rename to ajax/libs/codemirror/3.24.0/addon/selection/mark-selection.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/tern/tern.css b/ajax/libs/codemirror/3.24.0/addon/tern/tern.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/tern/tern.css rename to ajax/libs/codemirror/3.24.0/addon/tern/tern.css diff --git a/ajax/libs/codemirror/3.24.0/package/addon/tern/tern.js b/ajax/libs/codemirror/3.24.0/addon/tern/tern.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/tern/tern.js rename to ajax/libs/codemirror/3.24.0/addon/tern/tern.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/tern/worker.js b/ajax/libs/codemirror/3.24.0/addon/tern/worker.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/tern/worker.js rename to ajax/libs/codemirror/3.24.0/addon/tern/worker.js diff --git a/ajax/libs/codemirror/3.24.0/package/addon/wrap/hardwrap.js b/ajax/libs/codemirror/3.24.0/addon/wrap/hardwrap.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/addon/wrap/hardwrap.js rename to ajax/libs/codemirror/3.24.0/addon/wrap/hardwrap.js diff --git a/ajax/libs/codemirror/3.24.0/codemirror.min.css b/ajax/libs/codemirror/3.24.0/codemirror.min.css new file mode 100644 index 000000000..f268166d2 --- /dev/null +++ b/ajax/libs/codemirror/3.24.0/codemirror.min.css @@ -0,0 +1 @@ +.CodeMirror{font-family:monospace;height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar,.cm-s-default .cm-error{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:none;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}} \ No newline at end of file diff --git a/ajax/libs/codemirror/3.24.0/codemirror.min.js b/ajax/libs/codemirror/3.24.0/codemirror.min.js new file mode 100644 index 000000000..af21f2ed2 --- /dev/null +++ b/ajax/libs/codemirror/3.24.0/codemirror.min.js @@ -0,0 +1,4 @@ +window.CodeMirror=function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n||{};for(var i in So)!n.hasOwnProperty(i)&&So.hasOwnProperty(i)&&(n[i]=So[i]);d(n);var o="string"==typeof n.value?0:n.value.first,l=this.display=t(r,o);l.wrapper.CodeMirror=this,c(this),n.autofocus&&!no&&mt(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new si},a(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var s=n.value;"string"==typeof s&&(s=new Ro(n.value,n.mode)),st(this,Mn)(this,s),Gi&&setTimeout(gi(pt,this,!0),20),yt(this);var u;try{u=document.activeElement==l.input}catch(f){}u||n.autofocus&&!no?setTimeout(gi(zt,this),20):Ft(this),st(this,function(){for(var e in Lo)Lo.propertyIsEnumerable(e)&&Lo[e](this,n[e],ko);for(var t=0;tt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function d(e){var t=hi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=e.doc.height,n=r+F(t);t.sizer.style.minHeight=t.heightForcer.style.top=n+"px",t.gutters.style.height=Math.max(n,t.scroller.clientHeight-Uo)+"px";var i=Math.max(n,t.scroller.scrollHeight),o=t.scroller.scrollWidth>t.scroller.clientWidth,l=i>t.scroller.clientHeight;if(l?(t.scrollbarV.style.display="block",t.scrollbarV.style.bottom=o?Mi(t.measure)+"px":"0",t.scrollbarV.firstChild.style.height=Math.max(0,i-t.scroller.clientHeight+t.scrollbarV.clientHeight)+"px"):(t.scrollbarV.style.display="",t.scrollbarV.firstChild.style.height="0"),o?(t.scrollbarH.style.display="block",t.scrollbarH.style.right=l?Mi(t.measure)+"px":"0",t.scrollbarH.firstChild.style.width=t.scroller.scrollWidth-t.scroller.clientWidth+t.scrollbarH.clientWidth+"px"):(t.scrollbarH.style.display="",t.scrollbarH.firstChild.style.width="0"),o&&l?(t.scrollbarFiller.style.display="block",t.scrollbarFiller.style.height=t.scrollbarFiller.style.width=Mi(t.measure)+"px"):t.scrollbarFiller.style.display="",o&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(t.gutterFiller.style.display="block",t.gutterFiller.style.height=Mi(t.measure)+"px",t.gutterFiller.style.width=t.gutters.offsetWidth+"px"):t.gutterFiller.style.display="",Ji&&0===Mi(t.measure)){t.scrollbarV.style.minWidth=t.scrollbarH.style.minHeight=eo?"18px":"12px";var s=function(r){qn(r)!=t.scrollbarV&&qn(r)!=t.scrollbarH&&st(e,Ct)(r)};Jn(t.scrollbarV,"mousedown",s),Jn(t.scrollbarH,"mousedown",s)}}function m(e,t,r){var n=e.scroller.scrollTop,i=e.wrapper.clientHeight;"number"==typeof r?n=r:r&&(n=r.top,i=r.bottom-r.top),n=Math.floor(n-z(e));var o=Math.ceil(n+i);return{from:Dn(t,n),to:Dn(t,o)}}function g(e){var t=e.display;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=b(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,i=r+"px",o=t.lineDiv.firstChild;o;o=o.nextSibling)if(o.alignable)for(var l=0,s=o.alignable;l=e.display.showingFrom&&s.to<=e.display.showingTo)break}return i&&(ri(e,"update",e),(e.display.showingFrom!=o||e.display.showingTo!=l)&&ri(e,"viewportChange",e,e.display.showingFrom,e.display.showingTo)),i}function C(e,t,r,n){var i=e.display,o=e.doc;if(!i.wrapper.offsetWidth)return i.showingFrom=i.showingTo=o.first,void(i.viewOffset=0);if(!(!n&&0==t.length&&r.from>i.showingFrom&&r.tof&&i.showingTo-f<20&&(f=Math.min(u,i.showingTo)),po)for(c=Wn(Jr(o,Tn(o,c)));u>f&&en(o,Tn(o,f));)++f;var h=[{from:Math.max(i.showingFrom,o.first),to:Math.min(i.showingTo,u)}];if(h=h[0].from>=h[0].to?[]:S(h,t),po)for(var a=0;ap.from)){h.splice(a--,1);break}p.to=m}for(var g=0,a=0;af&&(p.to=f),p.from>=p.to?h.splice(a--,1):g+=p.to-p.from}if(!n&&g==f-c&&c==i.showingFrom&&f==i.showingTo)return void L(e);h.sort(function(e,t){return e.from-t.from});try{var y=document.activeElement}catch(b){}.7*(f-c)>g&&(i.lineDiv.style.display="none"),M(e,c,f,h,s),i.lineDiv.style.display="",y&&document.activeElement!=y&&y.offsetHeight&&y.focus();var x=c!=i.showingFrom||f!=i.showingTo||i.lastSizeC!=i.wrapper.clientHeight;return x&&(i.lastSizeC=i.wrapper.clientHeight,O(e,400)),i.showingFrom=c,i.showingTo=f,i.gutters.style.height="",w(e),L(e),!0}}function w(e){for(var t,r=e.display,n=r.lineDiv.offsetTop,i=r.lineDiv.firstChild;i;i=i.nextSibling)if(i.lineObj){if(Vi){var o=i.offsetTop+i.offsetHeight;t=o-n,n=o}else{var l=Si(i);t=l.bottom-l.top}var s=i.lineObj.height-t;if(2>t&&(t=nt(r)),s>.001||-.001>s){Nn(i.lineObj,t);var a=i.lineObj.widgets;if(a)for(var u=0;ur;++r){for(var i=t[r],o=[],l=i.diff||0,s=0,a=e.length;a>s;++s){var u=e[s];i.to<=u.from&&i.diff?o.push({from:u.from+l,to:u.to+l}):i.to<=u.from||i.from>=u.to?o.push(u):(i.from>u.from&&o.push({from:u.from,to:i.from}),i.toh){for(;c.lineObj!=t;)c=o(c);a&&h>=i&&c.lineNumber&&Li(c.lineNumber,y(e.options,h)),c=c.nextSibling}else{if(t.widgets)for(var g,v=0,b=c;b&&20>v;++v,b=b.nextSibling)if(b.lineObj==t&&/div/i.test(b.nodeName)){g=b;break}var x=T(e,t,h,l,g);if(x!=g)u.insertBefore(x,c);else{for(;c!=g;)c=o(c);c=c.nextSibling}x.lineObj=t}++h});c;)c=o(c)}function T(e,t,r,n,i){var o,l=mn(e,t),s=l.pre,a=t.gutterMarkers,u=e.display,c=l.bgClass?l.bgClass+" "+(t.bgClass||""):t.bgClass;if(!(e.options.lineNumbers||a||c||t.wrapClass||t.widgets))return s;if(i){i.alignable=null;for(var f,h=!0,d=0,p=null,m=i.firstChild;m;m=f)if(f=m.nextSibling,/\bCodeMirror-linewidget\b/.test(m.className)){for(var g=0;gt&&(t=0),l.appendChild(xi("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?u-e:r)+"px; height: "+(n-t)+"px"))}function r(r,n,o){function l(t,n){return Q(e,Zt(r,t),"div",f,n)}var s,c,f=Tn(i,r),h=f.text.length;return Ai(En(f),n||0,null==o?h:o,function(e,r,i){var f,d,p,m=l(e,"left");if(e==r)f=m,d=p=m.left;else{if(f=l(r-1,"right"),"rtl"==i){var g=m;m=f,f=g}d=m.left,p=f.right}null==n&&0==e&&(d=a),f.top-m.top>3&&(t(d,m.top,null,m.bottom),d=a,m.bottomc.bottom||f.bottom==c.bottom&&f.right>c.right)&&(c=f),a+1>d&&(d=a),t(d,f.top,p-d,f.bottom)}),{start:s,end:c}}var n=e.display,i=e.doc,o=e.doc.sel,l=document.createDocumentFragment(),s=R(e.display),a=s.left,u=n.lineSpace.offsetWidth-s.right;if(o.from.line==o.to.line)r(o.from.line,o.from.ch,o.to.ch);else{var c=Tn(i,o.from.line),f=Tn(i,o.to.line),h=Jr(i,c)==Jr(i,f),d=r(o.from.line,o.from.ch,h?c.text.length:null).end,p=r(o.to.line,h?0:null,o.to.ch).start;h&&(d.top0&&(t.blinker=setInterval(function(){t.cursor.style.visibility=t.otherCursor.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate))}}function O(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.showingTo)){var r,n=+new Date+e.options.workTime,i=Lr(t.mode,I(e,t.frontier)),o=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.showingTo+500),function(l){if(t.frontier>=e.display.showingFrom){var s=l.styles;l.styles=fn(e,l,i,!0);for(var a=!s||s.length!=l.styles.length,u=0;!a&&un?(O(e,e.options.workDelay),!0):void 0}),o.length&&st(e,function(){for(var e=0;el;--s){if(s<=o.first)return o.first;var a=Tn(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=ai(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function I(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=P(e,t,r),l=o>n.first&&Tn(n,o-1).stateAfter;return l=l?Lr(n.mode,l):Sr(n.mode),n.iter(o,t,function(r){dn(e,r.text,l);var s=o==t-1||o%5==0||o>=i.showingFrom&&oo&&0==s&&(o=1)}return i=s>r?"left":r>s?"right":i,"left"==i&&a.leftSide?a=a.leftSide:"right"==i&&a.rightSide&&(a=a.rightSide),{left:r>s?a.right:a.left,right:s>r?a.left:a.right,top:a.top,bottom:a.bottom}}function G(e,t){for(var r=e.display.measureLineCache,n=0;nv&&(r=v),0>t&&(t=0);for(var n=m.length-2;n>=0;n-=2){var i=m[n],o=m[n+1];if(!(i>r||t>o)&&(t>=i&&o>=r||i>=t&&r>=o||Math.min(r,o)-Math.max(t,i)>=r-t>>1)){m[n]=Math.min(t,i),m[n+1]=Math.max(r,o);break}}return 0>n&&(n=m.length,m.push(t,r)),{left:e.left-p.left,right:e.right-p.left,top:n,bottom:null}}function n(e){e.bottom=m[e.top+1],e.top=m[e.top]}if(!e.options.lineWrapping&&t.text.length>=e.options.crudeMeasuringFrom)return _(e,t);var i=e.display,o=mi(t.text.length),l=mn(e,t,o,!0).pre;if(Gi&&!Vi&&!e.options.lineWrapping&&l.childNodes.length>100){for(var s=document.createDocumentFragment(),a=10,u=l.childNodes.length,c=0,f=Math.ceil(u/a);f>c;++c){for(var h=xi("div",null,null,"display: inline-block"),d=0;a>d&&u;++d)h.appendChild(l.firstChild),--u;s.appendChild(h)}l.appendChild(s)}wi(i.measure,l);var p=Si(i.lineDiv),m=[],g=mi(t.text.length),v=l.offsetHeight;Ki&&i.measure.first!=l&&wi(i.measure,l);for(var y,c=0;c1&&(x=g[c]=r(C[0]),x.rightSide=r(C[C.length-1]))}x||(x=g[c]=r(Si(b))),y.measureRight&&(x.right=Si(y.measureRight).left-p.left),y.leftSide&&(x.leftSide=r(Si(y.leftSide)))}Ci(e.display.measure);for(var y,c=0;c=e.options.crudeMeasuringFrom)return B(e,t,t.text.length,o&&o.measure,"right").right;var l=mn(e,t,null,!0).pre,s=l.appendChild(Ti(e.display.measure));wi(e.display.measure,l);var a=Si(s);return 0==a.right&&0==a.bottom&&(s=l.appendChild(xi("span"," ")),a=Si(s)),a.left-Si(e.display.lineDiv).left}function Y(e){e.display.measureLineCache.length=e.display.measureLineCachePos=0,e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function j(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Z(e,t,r,n){if(t.widgets)for(var i=0;ir.from?o(e-1):o(e,n)}n=n||Tn(e.doc,t.line),i||(i=K(e,n));var s=En(n),a=t.ch;if(!s)return o(a);var u=Ii(s,a),c=l(a,u);return null!=rl&&(c.other=l(a,rl)),c}function et(e,t,r,n){var i=new Zt(e,t);return i.xRel=n,r&&(i.outside=!0),i}function tt(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return et(n.first,0,!0,-1);var i=Dn(n,r),o=n.first+n.size-1;if(i>o)return et(n.first+n.size-1,Tn(n,o).text.length,!0,1);for(0>t&&(t=0);;){var l=Tn(n,i),s=rt(e,l,i,t,r),a=qr(l),u=a&&a.find();if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=u.to.line}}function rt(e,t,r,n,i){function o(n){var i=J(e,Zt(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lg)return et(r,d,v,1);for(;;){if(c?d==h||d==Fi(t,h,1):1>=d-h){for(var y=p>n||g-n>=n-p?h:d,b=n-(y==h?p:g);bi(t.text.charAt(y));)++y;var x=et(r,y,y==h?m:v,0>b?-1:b?1:0);return x}var C=Math.ceil(f/2),w=h+C;if(c){w=h;for(var L=0;C>L;++L)w=Fi(t,w,1)}var S=o(w);S>n?(d=w,g=S,(v=s)&&(g+=1e3),f=C):(h=w,p=S,m=s,f-=C)}}function nt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==so){so=xi("pre");for(var t=0;49>t;++t)so.appendChild(document.createTextNode("x")),so.appendChild(xi("br"));so.appendChild(document.createTextNode("x"))}wi(e.measure,so);var r=so.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Ci(e.measure),r||1}function it(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=xi("span","x"),r=xi("pre",[t]);wi(e.measure,r);var n=t.offsetWidth;return n>2&&(e.cachedCharWidth=n),n||10}function ot(e){e.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++mo},Ko++||(Vo=[])}function lt(e){var t=e.curOp,r=e.doc,n=e.display;if(e.curOp=null,t.updateMaxLine&&h(e),n.maxLineChanged&&!e.options.lineWrapping&&n.maxLine){var i=X(e,n.maxLine);n.sizer.style.minWidth=Math.max(0,i+3)+"px",n.maxLineChanged=!1;var o=Math.max(0,n.sizer.offsetLeft+n.sizer.offsetWidth-n.scroller.clientWidth);os&&r.charCodeAt(s)==o.charCodeAt(s);)++s;var u=i.from,c=i.to,f=o.slice(s);s-1){gr(e,i.head.line,"smart");break}}return o.length>1e3||o.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=o,l&<(e),e.state.pasteIncoming=e.state.cutIncoming=!1,!0}function pt(e,t){var r,n,i=e.doc;if(qt(i.sel.from,i.sel.to))t&&(e.display.prevInput=e.display.input.value="",Xi&&!Ki&&(e.display.inputHasSelection=null));else{e.display.prevInput="",r=el&&(i.sel.to.line-i.sel.from.line>100||(n=e.getSelection()).length>1e3);var o=r?"-":n||e.getSelection();e.display.input.value=o,e.state.focused&&fi(e.display.input),Xi&&!Ki&&(e.display.inputHasSelection=o)}e.display.inaccurateSelection=r}function mt(e){"nocursor"==e.options.readOnly||no&&document.activeElement==e.display.input||e.display.input.focus()}function gt(e){e.state.focused||(mt(e),zt(e))}function vt(e){return e.options.readOnly||e.doc.cantEdit}function yt(e){function t(){e.state.focused&&setTimeout(gi(mt,e),0)}function r(){null==s&&(s=setTimeout(function(){s=null,l.cachedCharWidth=l.cachedTextHeight=l.cachedPaddingH=Zo=null,Y(e),ut(e,gi(ct,e))},100))}function n(){for(var e=l.wrapper.parentNode;e&&e!=document.body;e=e.parentNode);e?setTimeout(n,5e3):ei(window,"resize",r)}function i(t){ni(e,t)||e.options.onDragEvent&&e.options.onDragEvent(e,Xn(t))||Zn(t)}function o(t){l.inaccurateSelection&&(l.prevInput="",l.inaccurateSelection=!1,l.input.value=e.getSelection(),fi(l.input)),"cut"==t.type&&(e.state.cutIncoming=!0)}var l=e.display;Jn(l.scroller,"mousedown",st(e,Ct)),Gi?Jn(l.scroller,"dblclick",st(e,function(t){if(!ni(e,t)){var r=xt(e,t);if(r&&!St(e,t)&&!bt(e.display,t)){Yn(t);var n=xr(Tn(e.doc,r.line).text,r);or(e.doc,n.from,n.to)}}})):Jn(l.scroller,"dblclick",function(t){ni(e,t)||Yn(t)}),Jn(l.lineSpace,"selectstart",function(e){bt(l,e)||Yn(e)}),fo||Jn(l.scroller,"contextmenu",function(t){Rt(e,t)}),Jn(l.scroller,"scroll",function(){l.scroller.clientHeight&&(Tt(e,l.scroller.scrollTop),At(e,l.scroller.scrollLeft,!0),ti(e,"scroll",e))}),Jn(l.scrollbarV,"scroll",function(){l.scroller.clientHeight&&Tt(e,l.scrollbarV.scrollTop)}),Jn(l.scrollbarH,"scroll",function(){l.scroller.clientHeight&&At(e,l.scrollbarH.scrollLeft)}),Jn(l.scroller,"mousewheel",function(t){Ht(e,t)}),Jn(l.scroller,"DOMMouseScroll",function(t){Ht(e,t)}),Jn(l.scrollbarH,"mousedown",t),Jn(l.scrollbarV,"mousedown",t),Jn(l.wrapper,"scroll",function(){l.wrapper.scrollTop=l.wrapper.scrollLeft=0});var s;Jn(window,"resize",r),setTimeout(n,5e3),Jn(l.input,"keyup",st(e,Et)),Jn(l.input,"input",function(){Xi&&!Ki&&e.display.inputHasSelection&&(e.display.inputHasSelection=null),ht(e)}),Jn(l.input,"keydown",st(e,Pt)),Jn(l.input,"keypress",st(e,It)),Jn(l.input,"focus",gi(zt,e)),Jn(l.input,"blur",gi(Ft,e)),e.options.dragDrop&&(Jn(l.scroller,"dragstart",function(t){Mt(e,t)}),Jn(l.scroller,"dragenter",i),Jn(l.scroller,"dragover",i),Jn(l.scroller,"drop",st(e,kt))),Jn(l.scroller,"paste",function(t){bt(l,t)||(mt(e),ht(e))}),Jn(l.input,"paste",function(){e.state.pasteIncoming=!0,ht(e)}),Jn(l.input,"cut",o),Jn(l.input,"copy",o),Qi&&Jn(l.sizer,"mouseup",function(){document.activeElement==l.input&&l.input.blur(),mt(e)})}function bt(e,t){for(var r=qn(t);r!=e.wrapper;r=r.parentNode)if(!r||r.ignoreEvents||r.parentNode==e.sizer&&r!=e.mover)return!0 +}function xt(e,t,r){var n=e.display;if(!r){var i=qn(t);if(i==n.scrollbarH||i==n.scrollbarV||i==n.scrollbarFiller||i==n.gutterFiller)return null}var o,l,s=Si(n.lineSpace);try{o=t.clientX,l=t.clientY}catch(t){return null}return tt(e,o-s.left,l-s.top)}function Ct(e){function t(e){if(!qt(v,e)){if(v=e,"single"==c)return void or(i.doc,rr(l,a),e);if(p=rr(l,p),g=rr(l,g),"double"==c){var t=xr(Tn(l,e.line).text,e);Qt(e,p)?or(i.doc,t.from,g):or(i.doc,p,t.to)}else"triple"==c&&(Qt(e,p)?or(i.doc,g,rr(l,Zt(e.line,0))):or(i.doc,p,rr(l,Zt(e.line+1,0))))}}function r(e){var n=++b,s=xt(i,e,!0);if(s)if(qt(s,h)){var a=e.clientYy.bottom?20:0;a&&setTimeout(st(i,function(){b==n&&(o.scroller.scrollTop+=a,r(e))}),50)}else{gt(i),h=s,t(s);var u=m(o,l);(s.line>=u.to||s.lineu-400&&qt(uo.pos,a))c="triple",Yn(e),setTimeout(gi(mt,i),20),Cr(i,a.line);else if(ao&&ao.time>u-400&&qt(ao.pos,a)){c="double",uo={time:u,pos:a},Yn(e);var f=xr(Tn(l,a.line).text,a);or(i.doc,f.from,f.to)}else ao={time:u,pos:a};var h=a;if(i.options.dragDrop&&$o&&!vt(i)&&!qt(s.from,s.to)&&!Qt(a,s.from)&&!Qt(s.to,a)&&"single"==c){var d=st(i,function(t){Yi&&(o.scroller.draggable=!1),i.state.draggingText=!1,ei(document,"mouseup",d),ei(o.scroller,"drop",d),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(Yn(t),or(i.doc,a),mt(i),Gi&&!Ki&&setTimeout(function(){document.body.focus(),mt(i)},20))});return Yi&&(o.scroller.draggable=!0),i.state.draggingText=d,o.scroller.dragDrop&&o.scroller.dragDrop(),Jn(document,"mouseup",d),void Jn(o.scroller,"drop",d)}Yn(e),"single"==c&&or(i.doc,rr(l,a));var p=s.from,g=s.to,v=a,y=Si(o.wrapper),b=0,x=st(i,function(e){(Xi&&!Ui?e.buttons:Qn(e))?r(e):n(e)}),C=st(i,n);Jn(document,"mousemove",x),Jn(document,"mouseup",C)}}}function wt(e,t,r,n,i){try{var o=t.clientX,l=t.clientY}catch(t){return!1}if(o>=Math.floor(Si(e.display.gutters).right))return!1;n&&Yn(t);var s=e.display,a=Si(s.lineDiv);if(l>a.bottom||!oi(e,r))return $n(t);l-=a.top-s.viewOffset;for(var u=0;u=o){var f=Dn(e.doc,l),h=e.options.gutters[u];return i(e,r,e,f,h,t),$n(t)}}}function Lt(e,t){return oi(e,"gutterContextMenu")?wt(e,t,"gutterContextMenu",!1,ti):!1}function St(e,t){return wt(e,t,"gutterClick",!0,ri)}function kt(e){var t=this;if(!(ni(t,e)||bt(t.display,e)||t.options.onDragEvent&&t.options.onDragEvent(t,Xn(e)))){Yn(e),Xi&&(go=+new Date);var r=xt(t,e,!0),n=e.dataTransfer.files;if(r&&!vt(t))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){var s=new FileReader;s.onload=function(){o[n]=s.result,++l==i&&(r=rr(t.doc,r),Kt(t.doc,{from:r,to:r,text:Qo(o.join("\n")),origin:"paste"},"around"))},s.readAsText(e)},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&!Qt(r,t.doc.sel.from)&&!Qt(t.doc.sel.to,r))return t.state.draggingText(e),void setTimeout(gi(mt,t),20);try{var o=e.dataTransfer.getData("Text");if(o){var u=t.doc.sel.from,c=t.doc.sel.to;sr(t.doc,r,r),t.state.draggingText&&$t(t.doc,"",u,c,"paste"),t.replaceSelection(o,null,"paste"),mt(t)}}catch(e){}}}}function Mt(e,t){if(Xi&&(!e.state.draggingText||+new Date-go<100))return void Zn(t);if(!ni(e,t)&&!bt(e.display,t)){var r=e.getSelection();if(t.dataTransfer.setData("Text",r),t.dataTransfer.setDragImage&&!qi){var n=xi("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Zi&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),Zi&&n.parentNode.removeChild(n)}}}function Tt(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Bi||x(e,[],t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t),Bi&&x(e,[]),O(e,100))}function At(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,g(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t))}function Ht(e,t){var r=t.wheelDeltaX,n=t.wheelDeltaY;null==r&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(r=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta);var i=e.display,o=i.scroller;if(r&&o.scrollWidth>o.clientWidth||n&&o.scrollHeight>o.clientHeight){if(n&&io&&Yi)for(var l=t.target;l!=o;l=l.parentNode)if(l.lineObj){e.display.currentWheelTarget=l;break}if(r&&!Bi&&!Zi&&null!=yo)return n&&Tt(e,Math.max(0,Math.min(o.scrollTop+n*yo,o.scrollHeight-o.clientHeight))),At(e,Math.max(0,Math.min(o.scrollLeft+r*yo,o.scrollWidth-o.clientWidth))),Yn(t),void(i.wheelStartX=null);if(n&&null!=yo){var s=n*yo,a=e.doc.scrollTop,u=a+i.wrapper.clientHeight;0>s?a=Math.max(0,a+s-50):u=Math.min(e.doc.height,u+s+50),x(e,[],{top:a,bottom:u})}20>vo&&(null==i.wheelStartX?(i.wheelStartX=o.scrollLeft,i.wheelStartY=o.scrollTop,i.wheelDX=r,i.wheelDY=n,setTimeout(function(){if(null!=i.wheelStartX){var e=o.scrollLeft-i.wheelStartX,t=o.scrollTop-i.wheelStartY,r=t&&i.wheelDY&&t/i.wheelDY||e&&i.wheelDX&&e/i.wheelDX;i.wheelStartX=i.wheelStartY=null,r&&(yo=(yo*vo+r)/(vo+1),++vo)}},200)):(i.wheelDX+=r,i.wheelDY+=n))}}function Nt(e,t,r){if("string"==typeof t&&(t=Wo[t],!t))return!1;e.display.pollingFast&&dt(e)&&(e.display.pollingFast=!1);var n=e.doc,i=n.sel.shift,o=!1;try{vt(e)&&(e.state.suppressEdits=!0),r&&(n.sel.shift=!1),o=t(e)!=_o}finally{n.sel.shift=i,e.state.suppressEdits=!1}return o}function Wt(e){var t=e.state.keyMaps.slice(0);return e.options.extraKeys&&t.push(e.options.extraKeys),t.push(e.options.keyMap),t}function Dt(e,t){var r=kr(e.options.keyMap),n=r.auto;clearTimeout(bo),n&&!Tr(t)&&(bo=setTimeout(function(){kr(e.options.keyMap)==r&&(e.options.keyMap=n.call?n.call(null,e):n,s(e))},50));var i=Ar(t,!0),o=!1;if(!i)return!1;var l=Wt(e);return o=t.shiftKey?Mr("Shift-"+i,l,function(t){return Nt(e,t,!0)})||Mr(i,l,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?Nt(e,t):void 0}):Mr(i,l,function(t){return Nt(e,t)}),o&&(Yn(t),D(e),Ki&&(t.oldKeyCode=t.keyCode,t.keyCode=0),ri(e,"keyHandled",e,i,t)),o}function Ot(e,t,r){var n=Mr("'"+r+"'",Wt(e),function(t){return Nt(e,t,!0)});return n&&(Yn(t),D(e),ri(e,"keyHandled",e,"'"+r+"'",t)),n}function Et(e){var t=this;ni(t,e)||t.options.onKeyEvent&&t.options.onKeyEvent(t,Xn(e))||16==e.keyCode&&(t.doc.sel.shift=!1)}function Pt(e){var t=this;if(gt(t),!(ni(t,e)||t.options.onKeyEvent&&t.options.onKeyEvent(t,Xn(e)))){Gi&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.doc.sel.shift=16==r||e.shiftKey;var n=Dt(t,e);Zi&&(Co=n?r:null,!n&&88==r&&!el&&(io?e.metaKey:e.ctrlKey)&&t.replaceSelection(""))}}function It(e){var t=this;if(!(ni(t,e)||t.options.onKeyEvent&&t.options.onKeyEvent(t,Xn(e)))){var r=e.keyCode,n=e.charCode;if(Zi&&r==Co)return Co=null,void Yn(e);if(!(Zi&&(!e.which||e.which<10)||Qi)||!Dt(t,e)){var i=String.fromCharCode(null==n?r:n);Ot(t,e,i)||(Xi&&!Ki&&(t.display.inputHasSelection=null),ht(t))}}}function zt(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(ti(e,"focus",e),e.state.focused=!0,-1==e.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(e.display.wrapper.className+=" CodeMirror-focused"),e.curOp||(pt(e,!0),Yi&&setTimeout(gi(pt,e,!0),0))),ft(e),D(e))}function Ft(e){e.state.focused&&(ti(e,"blur",e),e.state.focused=!1,e.display.wrapper.className=e.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.doc.sel.shift=!1)},150)}function Rt(e,t){function r(){if(null!=i.input.selectionStart){var e=i.input.value="​"+(qt(o.from,o.to)?"":i.input.value);i.prevInput="​",i.input.selectionStart=1,i.input.selectionEnd=e.length}}function n(){if(i.inputDiv.style.position="relative",i.input.style.cssText=u,Ki&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=s),ft(e),null!=i.input.selectionStart){(!Xi||Ki)&&r(),clearTimeout(xo);var t=0,n=function(){"​"==i.prevInput&&0==i.input.selectionStart?st(e,Wo.selectAll)(e):t++<10?xo=setTimeout(n,500):pt(e)};xo=setTimeout(n,200)}}if(!ni(e,t,"contextmenu")){var i=e.display,o=e.doc.sel;if(!bt(i,t)&&!Lt(e,t)){var l=xt(e,t),s=i.scroller.scrollTop;if(l&&!Zi){var a=e.options.resetSelectionOnContextMenu;a&&(qt(o.from,o.to)||Qt(l,o.from)||!Qt(l,o.to))&&st(e,sr)(e.doc,l,l);var u=i.input.style.cssText;if(i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(Xi?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",mt(e),pt(e,!0),qt(o.from,o.to)&&(i.input.value=i.prevInput=" "),Xi&&!Ki&&r(),fo){Zn(t);var c=function(){ei(window,"mouseup",c),setTimeout(n,20)};Jn(window,"mouseup",c)}else setTimeout(n,50)}}}}function Bt(e,t,r){if(!Qt(t.from,r))return rr(e,r);var n=t.text.length-1-(t.to.line-t.from.line);if(r.line>t.to.line+n){var i=r.line-n,o=e.first+e.size-1;return i>o?Zt(o,Tn(e,o).text.length):nr(r,Tn(e,i).text.length)}if(r.line==t.to.line+n)return nr(r,ci(t.text).length+(1==t.text.length?t.from.ch:0)+Tn(e,t.to.line).text.length-t.to.ch);var l=r.line-t.from.line;return nr(r,t.text[l].length+(l?0:t.from.ch))}function Gt(e,t,r){if(r&&"object"==typeof r)return{anchor:Bt(e,t,r.anchor),head:Bt(e,t,r.head)};if("start"==r)return{anchor:t.from,head:t.from};var n=wo(t);if("around"==r)return{anchor:t.from,head:n};if("end"==r)return{anchor:n,head:n};var i=function(e){if(Qt(e,t.from))return e;if(!Qt(t.to,e))return n;var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=n.ch-t.to.ch),Zt(r,i)};return{anchor:i(e.sel.anchor),head:i(e.sel.head)}}function Vt(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(n.update=function(t,r,n,i){t&&(this.from=rr(e,t)),r&&(this.to=rr(e,r)),n&&(this.text=n),void 0!==i&&(this.origin=i)}),ti(e,"beforeChange",e,n),e.cm&&ti(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Kt(e,t,r,n){if(e.cm){if(!e.cm.curOp)return st(e.cm,Kt)(e,t,r,n);if(e.cm.state.suppressEdits)return}if(!(oi(e,"beforeChange")||e.cm&&oi(e.cm,"beforeChange"))||(t=Vt(e,t,!0))){var i=ho&&!n&&_r(e,t.from,t.to);if(i){for(var o=i.length-1;o>=1;--o)Ut(e,{from:i[o].from,to:i[o].to,text:[""]});i.length&&Ut(e,{from:i[0].from,to:i[0].to,text:t.text},r)}else Ut(e,t,r)}}function Ut(e,t,r){if(1!=t.text.length||""!=t.text[0]||!qt(t.from,t.to)){var n=Gt(e,t,r);Fn(e,t,n,e.cm?e.cm.curOp.id:0/0),Yt(e,t,n,Vr(e,t));var i=[];kn(e,function(e,r){r||-1!=hi(i,e.history)||(Un(e.history,t),i.push(e.history)),Yt(e,t,null,Vr(e,t))})}}function _t(e,t){if(!e.cm||!e.cm.state.suppressEdits){var r=e.history,n=("undo"==t?r.done:r.undone).pop();if(n){var i={changes:[],anchorBefore:n.anchorAfter,headBefore:n.headAfter,anchorAfter:n.anchorBefore,headAfter:n.headBefore,generation:r.generation};("undo"==t?r.undone:r.done).push(i),r.generation=n.generation||++r.maxGeneration;for(var o=oi(e,"beforeChange")||e.cm&&oi(e.cm,"beforeChange"),l=n.changes.length-1;l>=0;--l){var s=n.changes[l];if(s.origin=t,o&&!Vt(e,s,!1))return void(("undo"==t?r.done:r.undone).length=0);i.changes.push(zn(e,s));var a=l?Gt(e,s,null):{anchor:n.anchorBefore,head:n.headBefore};Yt(e,s,a,Ur(e,s));var u=[];kn(e,function(e,t){t||-1!=hi(u,e.history)||(Un(e.history,s),u.push(e.history)),Yt(e,s,null,Ur(e,s))})}}}}function Xt(e,t){function r(e){return Zt(e.line+t,e.ch)}e.first+=t,e.cm&&ct(e.cm,e.first,e.first,t),e.sel.head=r(e.sel.head),e.sel.anchor=r(e.sel.anchor),e.sel.from=r(e.sel.from),e.sel.to=r(e.sel.to)}function Yt(e,t,r,n){if(e.cm&&!e.cm.curOp)return st(e.cm,Yt)(e,t,r,n);if(t.to.linee.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Zt(o,Tn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=An(e,t.from,t.to),r||(r=Gt(e,t,null)),e.cm?jt(e.cm,t,n,r):wn(e,t,n,r)}}function jt(e,t,r,n){var i=e.doc,l=e.display,s=t.from,a=t.to,u=!1,c=s.line;e.options.lineWrapping||(c=Wn(Jr(i,Tn(i,s.line))),i.iter(c,a.line+1,function(e){return e==l.maxLine?(u=!0,!0):void 0})),Qt(i.sel.head,t.from)||Qt(t.to,i.sel.head)||(e.curOp.cursorActivity=!0),wn(i,t,r,n,o(e)),e.options.lineWrapping||(i.iter(c,s.line+t.text.length,function(e){var t=f(i,e);t>l.maxLineLength&&(l.maxLine=e,l.maxLineLength=t,l.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),i.frontier=Math.min(i.frontier,s.line),O(e,400);var h=t.text.length-(a.line-s.line)-1;if(ct(e,s.line,a.line+1,h),oi(e,"change")){var d={from:s,to:a,text:t.text,removed:t.removed,origin:t.origin};if(e.curOp.textChanged){for(var p=e.curOp.textChanged;p.next;p=p.next);p.next=d}else e.curOp.textChanged=d}}function $t(e,t,r,n,i){if(n||(n=r),Qt(n,r)){var o=n;n=r,r=o}"string"==typeof t&&(t=Qo(t)),Kt(e,{from:r,to:n,text:t,origin:i},null)}function Zt(e,t){return this instanceof Zt?(this.line=e,void(this.ch=t)):new Zt(e,t)}function qt(e,t){return e.line==t.line&&e.ch==t.ch}function Qt(e,t){return e.liner?Zt(r,Tn(e,r).text.length):nr(t,Tn(e,t.line).text.length)}function nr(e,t){var r=e.ch;return null==r||r>t?Zt(e.line,t):0>r?Zt(e.line,0):e}function ir(e,t){return t>=e.first&&t=o.ch:u.to>o.ch))){if(n&&(ti(c,"beforeCursorEnter"),c.explicitlyCleared)){if(s.markedSpans){--a;continue}break}if(!c.atomic)continue;var f=c.find()[0>l?"from":"to"];if(qt(f,o)&&(f.ch+=l,f.ch<0?f=f.line>e.first?rr(e,Zt(f.line-1)):null:f.ch>s.text.length&&(f=f.line(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!to){var o=xi("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset)+"px; height: "+(t.bottom-t.top+Uo)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function fr(e,t,r,n){for(null==n&&(n=0);;){var i=!1,o=J(e,t),l=r&&r!=t?J(e,r):o,s=dr(e,Math.min(o.left,l.left),Math.min(o.top,l.top)-n,Math.max(o.left,l.left),Math.max(o.bottom,l.bottom)+n),a=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Tt(e,s.scrollTop),Math.abs(e.doc.scrollTop-a)>1&&(i=!0)),null!=s.scrollLeft&&(At(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(i=!0)),!i)return o}}function hr(e,t,r,n,i){var o=dr(e,t,r,n,i);null!=o.scrollTop&&Tt(e,o.scrollTop),null!=o.scrollLeft&&At(e,o.scrollLeft)}function dr(e,t,r,n,i){var o=e.display,l=nt(e.display);0>r&&(r=0);var s=o.scroller.clientHeight-Uo,a=o.scroller.scrollTop,u={},c=e.doc.height+F(o),f=l>r,h=i>c-l;if(a>r)u.scrollTop=f?0:r;else if(i>a+s){var d=Math.min(r,(h?c:i)-s);d!=a&&(u.scrollTop=d)}var p=o.scroller.clientWidth-Uo,m=o.scroller.scrollLeft;t+=o.gutters.offsetWidth,n+=o.gutters.offsetWidth;var g=o.gutters.offsetWidth,v=g+10>t;return m+g>t||v?(v&&(t=0),u.scrollLeft=Math.max(0,t-10-g)):n>p+m-3&&(u.scrollLeft=n+10-p),u}function pr(e,t,r){e.curOp.updateScrollPos={scrollLeft:null==t?e.doc.scrollLeft:t,scrollTop:null==r?e.doc.scrollTop:r}}function mr(e,t,r){var n=e.curOp.updateScrollPos||(e.curOp.updateScrollPos={scrollLeft:e.doc.scrollLeft,scrollTop:e.doc.scrollTop}),i=e.display.scroller;n.scrollTop=Math.max(0,Math.min(i.scrollHeight-i.clientHeight,n.scrollTop+r)),n.scrollLeft=Math.max(0,Math.min(i.scrollWidth-i.clientWidth,n.scrollLeft+t))}function gr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(e.doc.mode.indent?i=I(e,t):r="prev");var l=e.options.tabSize,s=Tn(o,t),a=ai(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=e.doc.mode.indent(i,s.text.slice(c.length),s.text),u==_o)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?ai(Tn(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+=" ";u>h&&(f+=ui(u-h)),f!=c?$t(e.doc,f,Zt(t,0),Zt(t,c.length),"+input"):o.sel.head.line==t&&o.sel.head.ch=e.first+e.size?f=!1:(s=t,c=Tn(e,t))}function l(e){var t=(i?Fi:Ri)(c,a,r,!0);if(null==t){if(e||!o())return f=!1;a=i?(0>r?Di:Wi)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Tn(e,s),f=!0;if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,d="group"==n,p=!0;!(0>r)||l(!p);p=!1){var m=c.text.charAt(a)||"\n",g=vi(m)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||p||g||(g="s"),h&&h!=g){0>r&&(r=1,l());break}if(g&&(h=g),r>0&&!l(!p))break}var v=ur(e,Zt(s,a),u,!0);return f||(v.hitSide=!0),v}function br(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*nt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=tt(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function xr(e,t){var r=t.ch,n=t.ch;if(e){(t.xRel<0||n==e.length)&&r?--r:++n;for(var i=e.charAt(r),o=vi(i)?vi:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!vi(e)};r>0&&o(e.charAt(r-1));)--r;for(;nl;++l){var a=n(o[l]);if(a)return a}return!1}for(var i=0;i=t:o.to>t);(n||(n=[])).push({from:o.from,to:a?null:o.to,marker:l})}}return n}function Gr(e,t,r){if(e)for(var n,i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(var f=0;ff;++f)p.push(m);p.push(a)}return p}function Kr(e){for(var t=0;t=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Jt(u.to,r)||Yr(a.marker)-Xr(i))>0||c>=0&&(Jt(u.from,n)||Xr(a.marker)-Yr(i))<0))return!0}}}function Jr(e,t){for(var r;r=Zr(t);)t=Tn(e,r.find().from.line);return t}function en(e,t){var r=po&&t.markedSpans;if(r)for(var n,i=0;it.options.maxHighlightLength?(s=!1,l&&dn(t,r,i,f.pos),f.pos=r.length,a=null):a=n.token(f,i),t.options.addModeClass){var h=e.innerMode(n,i).mode.name;h&&(a="m-"+(a?h+" "+a:h))}s&&c==a||(ua;){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,a=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,t),s=r+2;else for(;s>r;r+=2){var o=i[r+1];i[r+1]=o?o+" "+t:t}})}return i}function hn(e,t){return t.styles&&t.styles[0]==e.state.modeGen||(t.styles=fn(e,t,t.stateAfter=I(e,Wn(t)))),t.styles}function dn(e,t,r,n){var i=e.doc.mode,o=new Hr(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&i.blankLine&&i.blankLine(r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)i.token(o,r),o.start=o.pos}function pn(e,t){if(!e)return null;for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}if(/^\s*$/.test(e))return null;var i=t.cm.options.addModeClass?zo:Io;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t,r,n){for(var i,o=t,l=!0;i=Zr(o);)o=Tn(e.doc,i.find().from.line);var s={pre:xi("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:e,copyWidgets:n};do{o.text&&(l=!1),s.measure=o==t&&r,s.pos=0,s.addToken=s.measure?yn:vn,(Xi||Yi)&&e.getOption("lineWrapping")&&(s.addToken=bn(s.addToken));var a=Cn(o,s,hn(e,o));r&&o==t&&!s.measuredSomething&&(r[0]=s.pre.appendChild(Ti(e.display.measure)),s.measuredSomething=!0),a&&(o=Tn(e.doc,a.to.line))}while(a);!r||s.measuredSomething||r[0]||(r[0]=s.pre.appendChild(l?xi("span"," "):Ti(e.display.measure))),s.pre.firstChild||en(e.doc,t)||s.pre.appendChild(document.createTextNode(" "));var u;if(r&&Xi&&(u=En(o))){var c=u.length-1;u[c].from==u[c].to&&--c;var f=u[c],h=u[c-1];if(f.from+1==f.to&&h&&f.leveld)?(null!=b.to&&g>b.to&&(g=b.to,a=""),x.className&&(s+=" "+x.className),x.startStyle&&b.from==d&&(u+=" "+x.startStyle),x.endStyle&&b.to==g&&(a+=" "+x.endStyle),x.title&&!c&&(c=x.title),x.collapsed&&(!f||jr(f.marker,x)<0)&&(f=b)):b.from>d&&g>b.from&&(g=b.from),"bookmark"==x.type&&b.from==d&&x.replacedWith&&v.push(x)}if(f&&(f.from||0)==d&&(xn(t,(null==f.to?h:f.to)-d,f.marker,null==f.from),null==f.to))return f.marker.find();if(!f&&v.length)for(var y=0;y=h)break;for(var C=Math.min(h,g);;){if(m){var w=d+m.length;if(!f){var L=w>C?m.slice(0,C-d):m;t.addToken(t,L,l?l+s:s,u,d+L.length==g?a:"",c)}if(w>=C){m=m.slice(C-d),d=C;break}d=w,u=""}m=i.slice(o,o=r[p++]),l=pn(r[p++],t)}}else for(var p=1;pg;++g)m.push(new Po(u[g],o(g),i));m.push(new Po(h+c.text.slice(a.ch),d,i)),l(c,c.text.slice(0,s.ch)+u[0],o(0)),e.insert(s.line+1,m)}else if(1==u.length)l(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(a.ch),o(0)),e.remove(s.line+1,p);else{l(c,c.text.slice(0,s.ch)+u[0],o(0)),l(f,h+f.text.slice(a.ch),d);for(var g=1,v=u.length-1,m=[];v>g;++g)m.push(new Po(u[g],o(g),i));p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}else{for(var g=0,v=u.length-1,m=[];v>g;++g)m.push(new Po(u[g],o(g),i));l(f,f.text,d),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}ri(e,"change",e,t),sr(e,n.anchor,n.head,null,!0)}function Ln(e){this.lines=e,this.parent=null;for(var t=0,r=e.length,n=0;r>t;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Sn(e){this.children=e;for(var t=0,r=0,n=0,i=e.length;i>n;++n){var o=e[n];t+=o.chunkSize(),r+=o.height,o.parent=this}this.size=t,this.height=r,this.parent=null}function kn(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;lt){e=n;break}t-=i}return e.lines[t]}function An(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Hn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function Nn(e,t){for(var r=t-e.height,n=e;n;n=n.parent)n.height+=r}function Wn(e){if(null==e.parent)return null;for(var t=e.parent,r=hi(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function Dn(e,t){var r=e.first;e:do{for(var n=0,i=e.children.length;i>n;++n){var o=e.children[n],l=o.height;if(l>t){e=o;continue e}t-=l,r+=o.chunkSize()}return r}while(!e.lines);for(var n=0,i=e.lines.length;i>n;++n){var s=e.lines[n],a=s.height;if(a>t)break;t-=a}return r+n}function On(e,t){t=Jr(e.doc,t);for(var r=0,n=t.parent,i=0;io-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))){var s=ci(l.changes);qt(t.from,t.to)&&qt(t.from,s.to)?s.to=wo(t):l.changes.push(zn(e,t)),l.anchorAfter=r.anchor,l.headAfter=r.head}else for(l={changes:[zn(e,t)],generation:i.generation,anchorBefore:e.sel.anchor,headBefore:e.sel.head,anchorAfter:r.anchor,headAfter:r.head},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift();i.generation=++i.maxGeneration,i.lastTime=o,i.lastOp=n,i.lastOrigin=t.origin,s||ti(e,"historyAdded")}function Rn(e){if(!e)return null;for(var t,r=0;r-1&&(ci(l)[c]=u[c],delete u[c])}}return n}function Vn(e,t,r,n){r0}function li(e){e.prototype.on=function(e,t){Jn(this,e,t)},e.prototype.off=function(e,t){ei(this,e,t)}}function si(){this.id=null}function ai(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=n||0,l=i||0;t>o;++o)" "==e.charAt(o)?l+=r-l%r:++l;return l}function ui(e){for(;Xo.length<=e;)Xo.push(ci(Xo)+" ");return Xo[e]}function ci(e){return e[e.length-1]}function fi(e){if(ro)e.selectionStart=0,e.selectionEnd=e.value.length;else try{e.select()}catch(t){}}function hi(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;n>r;++r)if(e[r]==t)return r;return-1}function di(e,t){function r(){}r.prototype=e;var n=new r;return t&&pi(t,n),n}function pi(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function mi(e){for(var t=[],r=0;e>r;++r)t.push(void 0);return t}function gi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function vi(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Yo.test(e))}function yi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function bi(e){return e.charCodeAt(0)>=768&&jo.test(e)}function xi(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)Li(i,t);else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function wi(e,t){return Ci(e).appendChild(t)}function Li(e,t){Ki?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function Si(e){return e.getBoundingClientRect()}function ki(){return!1}function Mi(e){if(null!=Zo)return Zo;var t=xi("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return wi(e,t),t.offsetWidth&&(Zo=t.offsetHeight-t.clientHeight),Zo||0}function Ti(e){if(null==qo){var t=xi("span","​");wi(e,xi("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(qo=t.offsetWidth<=1&&t.offsetHeight>2&&!Vi)}return qo?xi("span","​"):xi("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Ai(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function Hi(e){return e.level%2?e.to:e.from}function Ni(e){return e.level%2?e.from:e.to}function Wi(e){var t=En(e);return t?Hi(t[0]):0}function Di(e){var t=En(e);return t?Ni(ci(t)):e.text.length}function Oi(e,t){var r=Tn(e.doc,t),n=Jr(e.doc,r);n!=r&&(t=Wn(n));var i=En(n),o=i?i[0].level%2?Di(n):Wi(n):0;return Zt(t,o)}function Ei(e,t){for(var r,n;r=qr(n=Tn(e.doc,t));)t=r.find().to.line;var i=En(n),o=i?i[0].level%2?Wi(n):Di(n):n.text.length;return Zt(t,o)}function Pi(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function Ii(e,t){rl=null;for(var r,n=0;nt)return n;if(i.from==t||i.to==t){if(null!=r)return Pi(e,i.level,e[r].level)?(i.from!=i.to&&(rl=r),n):(i.from!=i.to&&(rl=n),r);r=n}}return r}function zi(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&bi(e.text.charAt(t)));return t}function Fi(e,t,r,n){var i=En(e);if(!i)return Ri(e,t,r,n);for(var o=Ii(i,t),l=i[o],s=zi(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?zi(e,l.to,-1,n):zi(e,l.from,1,n)}}function Ri(e,t,r,n){var i=t+r;if(n)for(;i>0&&bi(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var Bi=/gecko\/\d/i.test(navigator.userAgent),Gi=/MSIE \d/.test(navigator.userAgent),Vi=Gi&&(null==document.documentMode||document.documentMode<8),Ki=Gi&&(null==document.documentMode||document.documentMode<9),Ui=Gi&&(null==document.documentMode||document.documentMode<10),_i=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),Xi=Gi||_i,Yi=/WebKit\//.test(navigator.userAgent),ji=Yi&&/Qt\/\d+\.\d+/.test(navigator.userAgent),$i=/Chrome\//.test(navigator.userAgent),Zi=/Opera\//.test(navigator.userAgent),qi=/Apple Computer/.test(navigator.vendor),Qi=/KHTML\//.test(navigator.userAgent),Ji=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),eo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),to=/PhantomJS/.test(navigator.userAgent),ro=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),no=ro||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),io=ro||/Mac/.test(navigator.platform),oo=/win/i.test(navigator.platform),lo=Zi&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);lo&&(lo=Number(lo[1])),lo&&lo>=15&&(Zi=!1,Yi=!0);var so,ao,uo,co=io&&(ji||Zi&&(null==lo||12.11>lo)),fo=Bi||Xi&&!Ki,ho=!1,po=!1,mo=0,go=0,vo=0,yo=null;Xi?yo=-.53:Bi?yo=15:$i?yo=-.7:qi&&(yo=-1/3);var bo,xo,Co=null,wo=e.changeEnd=function(e){return e.text?Zt(e.from.line+e.text.length-1,ci(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.Pos=Zt,e.prototype={constructor:e,focus:function(){window.focus(),mt(this),ht(this)},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,Lo.hasOwnProperty(e)&&st(this,Lo[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](e)},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r=n;++n)gr(this,n,e)}),getTokenAt:function(e,t){var r=this.doc;e=rr(r,e);for(var n=I(this,e.line,t),i=this.doc.mode,o=Tn(r,e.line),l=new Hr(o.text,this.options.tabSize);l.pos>1;if((o?t[2*o-1]:0)>=i)n=o;else{if(!(t[2*o+1]n&&(e=n,r=!0);var i=Tn(this.doc,e);return Z(this,Tn(this.doc,e),{top:0,left:0},t||"page").top+(r?this.doc.height-On(this,i):0)},defaultTextHeight:function(){return nt(this.display)},defaultCharWidth:function(){return it(this.display)},setGutterMarker:st(null,function(e,t,r){return vr(this,e,function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&yi(n)&&(e.gutterMarkers=null),!0})}),clearGutter:st(null,function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,ct(t,n,n+1),yi(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),addLineClass:st(null,function(e,t,r){return vr(this,e,function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"wrapClass";if(e[n]){if(new RegExp("(?:^|\\s)"+r+"(?:$|\\s)").test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:st(null,function(e,t,r){return vr(this,e,function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(new RegExp("(?:^|\\s+)"+r+"(?:$|\\s+)"));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:st(null,function(e,t,r){return sn(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!ir(this.doc,e))return null;var t=e;if(e=Tn(this.doc,e),!e)return null}else{var t=Wn(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=J(this,rr(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&hr(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:st(null,Pt),triggerOnKeyPress:st(null,It),triggerOnKeyUp:st(null,Et),execCommand:function(e){return Wo.hasOwnProperty(e)?Wo[e](this):void 0},findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=rr(this.doc,e);t>o&&(l=yr(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:st(null,function(e,t){var r,n=this.doc.sel;r=n.shift||n.extend||qt(n.from,n.to)?yr(this.doc,n.head,e,t,this.options.rtlMoveVisually):0>e?n.from:n.to,or(this.doc,r,r,e)}),deleteH:st(null,function(e,t){var r=this.doc.sel;qt(r.from,r.to)?$t(this.doc,"",r.from,yr(this.doc,r.head,e,t,!1),"+delete"):$t(this.doc,"",r.from,r.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=rr(this.doc,e);t>l;++l){var a=J(this,s,"div");if(null==o?o=a.left:a.left=o,s=br(this,a,i,r),s.hitSide)break}return s},moveV:st(null,function(e,t){var r,n,i=this.doc.sel;if(i.shift||i.extend||qt(i.from,i.to)){var o=J(this,i.head,"div");null!=i.goalColumn&&(o.left=i.goalColumn),r=br(this,o,e,t),"page"==t&&mr(this,0,Q(this,r,"div").top-o.top),n=o.left}else r=0>e?i.from:i.to;or(this.doc,r,r,e),null!=n&&(i.goalColumn=n)}),toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""),ti(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return document.activeElement==this.display.input},scrollTo:st(null,function(e,t){pr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller,t=Uo;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:st(null,function(e,t){null==e?e={from:this.doc.sel.head,to:null}:"number"==typeof e?e={from:Zt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),t||(t=0);var r=e;null!=e.from.line&&(this.curOp.scrollToPos={from:e.from,to:e.to,margin:t},r={from:J(this,e.from),to:J(this,e.to)});var n=dr(this,Math.min(r.from.left,r.to.left),Math.min(r.from.top,r.to.top)-t,Math.max(r.from.right,r.to.right),Math.max(r.from.bottom,r.to.bottom)+t);pr(this,n.scrollLeft,n.scrollTop)}),setSize:st(null,function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0,ti(this,"refresh",this)}),operation:function(e){return ut(this,e)},refresh:st(null,function(){var e=this.display.cachedTextHeight;Y(this),pr(this,this.doc.scrollLeft,this.doc.scrollTop),ct(this),(null==e||Math.abs(e-nt(this.display))>.5)&&l(this),ti(this,"refresh",this)}),swapDoc:st(null,function(e){var t=this.doc;return t.cm=null,Mn(this,e),Y(this),pt(this,!0),pr(this,e.scrollLeft,e.scrollTop),ri(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},li(e);var Lo=e.optionHandlers={},So=e.defaults={},ko=e.Init={toString:function(){return"CodeMirror.Init"}};wr("value","",function(e,t){e.setValue(t)},!0),wr("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),wr("indentUnit",2,r,!0),wr("indentWithTabs",!1),wr("smartIndent",!0),wr("tabSize",4,function(e){n(e),Y(e),ct(e)},!0),wr("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),wr("specialCharPlaceholder",gn,function(e){e.refresh()},!0),wr("electricChars",!0),wr("rtlMoveVisually",!oo),wr("wholeLineUpdateBefore",!0),wr("theme","default",function(e){a(e),u(e)},!0),wr("keyMap","default",s),wr("extraKeys",null),wr("onKeyEvent",null),wr("onDragEvent",null),wr("lineWrapping",!1,i,!0),wr("gutters",[],function(e){d(e.options),u(e)},!0),wr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?b(e.display)+"px":"0",e.refresh()},!0),wr("coverGutterNextToScrollbar",!1,p,!0),wr("lineNumbers",!1,function(e){d(e.options),u(e)},!0),wr("firstLineNumber",1,u,!0),wr("lineNumberFormatter",function(e){return e},u,!0),wr("showCursorWhenSelecting",!1,H,!0),wr("resetSelectionOnContextMenu",!0),wr("readOnly",!1,function(e,t){"nocursor"==t?(Ft(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||pt(e,!0))}),wr("disableInput",!1,function(e,t){t||pt(e,!0)},!0),wr("dragDrop",!0),wr("cursorBlinkRate",530),wr("cursorScrollMargin",0),wr("cursorHeight",1),wr("workTime",100),wr("workDelay",100),wr("flattenSpans",!0,n,!0),wr("addModeClass",!1,n,!0),wr("pollInterval",100),wr("undoDepth",40,function(e,t){e.doc.history.undoDepth=t}),wr("historyEventDelay",500),wr("viewportMargin",10,function(e){e.refresh()},!0),wr("maxHighlightLength",1e4,n,!0),wr("crudeMeasuringFrom",1e4),wr("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)}),wr("tabindex",null,function(e,t){e.display.input.tabIndex=t||""}),wr("autofocus",null);var Mo=e.modes={},To=e.mimeModes={};e.defineMode=function(t,r){if(e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2){r.dependencies=[];for(var n=2;n0&&t.ch=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},e.StringStream=Hr,e.TextMarker=Nr,li(Nr),Nr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ot(e),oi(this,"clear")){var r=this.find();r&&ri(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&ct(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ar(e)),e&&ri(e,"markerCleared",e,this),t&<(e),this.parent&&this.parent.clear()}},Nr.prototype.find=function(e){for(var t,r,n=0;n=t.display.showingFrom&&e.liner;++r){var i=this.lines[r];this.height-=i.height,un(i),ri(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0,i=t.length;i>n;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;n>e;++e)if(r(this.lines[e]))return!0}},Sn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;re){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25){var s=[];this.collapse(s),this.children=[new Ln(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0,r=this.children.length;r>t;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0,i=this.children.length;i>n;++n){var o=this.children[n],l=o.chunkSize();if(l>=e){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(;o.lines.length>50;){var s=o.lines.splice(o.lines.length-25,25),a=new Ln(s);o.height-=a.height,this.children.splice(n+1,0,a),a.parent=this}this.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Sn(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=hi(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Sn(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0,i=this.children.length;i>n;++n){var o=this.children[n],l=o.chunkSize();if(l>e){var s=Math.min(t,l-e);if(o.iterN(e,s,r))return!0;if(0==(t-=s))break;e=0}else e-=l}}};var Fo=0,Ro=e.Doc=function(e,t,r){if(!(this instanceof Ro))return new Ro(e,t,r);null==r&&(r=0),Sn.call(this,[new Ln([new Po("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=Pn(),this.cleanGeneration=1,this.frontier=r;var n=Zt(r,0);this.sel={from:n,to:n,head:n,anchor:n,shift:!1,extend:!1,goalColumn:null},this.id=++Fo,this.modeOption=t,"string"==typeof e&&(e=Qo(e)),wn(this,{from:n,to:n,text:e},null,{head:n,anchor:n})};Ro.prototype=di(Sn.prototype,{constructor:Ro,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0,i=t.length;i>n;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Hn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:function(e){var t=Zt(this.first,0),r=this.first+this.size-1;Kt(this,{from:t,to:Zt(r,Tn(this,r).text.length),text:Qo(e),origin:"setValue"},{head:t,anchor:t},!0)},replaceRange:function(e,t,r,n){t=rr(this,t),r=r?rr(this,r):t,$t(this,e,t,r,n)},getRange:function(e,t,r){var n=An(this,rr(this,e),rr(this,t));return r===!1?n:n.join(r||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},setLine:function(e,t){ir(this,e)&&$t(this,t,Zt(e,0),rr(this,Zt(e)))},removeLine:function(e){e?$t(this,"",rr(this,Zt(e-1)),rr(this,Zt(e))):$t(this,"",Zt(0,0),rr(this,Zt(1,0)))},getLineHandle:function(e){return ir(this,e)?Tn(this,e):void 0},getLineNumber:function(e){return Wn(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Tn(this,e)),Jr(this,e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return rr(this,e)},getCursor:function(e){var t,r=this.sel;return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||e===!1?r.to:r.from,er(t)},somethingSelected:function(){return!qt(this.sel.head,this.sel.anchor)},setCursor:at(function(e,t,r){var n=rr(this,"number"==typeof e?Zt(e,t||0):e);r?or(this,n):sr(this,n,n)}),setSelection:at(function(e,t,r){sr(this,rr(this,e),rr(this,t||e),r)}),extendSelection:at(function(e,t,r){or(this,rr(this,e),t&&rr(this,t),r)}),getSelection:function(e){return this.getRange(this.sel.from,this.sel.to,e)},replaceSelection:function(e,t,r){Kt(this,{from:this.sel.from,to:this.sel.to,text:Qo(e),origin:r},t||"around")},undo:at(function(){_t(this,"undo")}),redo:at(function(){_t(this,"redo")}),setExtending:function(e){this.sel.extend=e},getExtending:function(){return this.sel.extend},historySize:function(){var e=this.history;return{undo:e.done.length,redo:e.undone.length}},clearHistory:function(){this.history=Pn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gn(this.history.done),undone:Gn(this.history.undone)}},setHistory:function(e){var t=this.history=Pn(this.history.maxGeneration);t.done=e.done.slice(0),t.undone=e.undone.slice(0)},markText:function(e,t,r){return Wr(this,rr(this,e),rr(this,t),r,"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1};return e=rr(this,e),Wr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=rr(this,e);var t=[],r=Tn(this,e.line).markedSpans;if(r)for(var n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=rr(this,e),t=rr(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;sa.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=i,void++r)}),rr(this,Zt(r,t))},indexFromPos:function(e){e=rr(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.to=8208&&8212>=r}:Yi&&(ki=function(e,t){if(t>1&&45==e.charCodeAt(t-1)){if(/\w/.test(e.charAt(t-2))&&/[^\-?\.]/.test(e.charAt(t)))return!0;if(t>2&&/[\d\.,]/.test(e.charAt(t-2))&&/[\d\.,]/.test(e.charAt(t)))return!1}return/[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(e.slice(t-1,t+1))});var Zo,qo,Qo=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=Qo;var Jo=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},el=function(){var e=xi("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),tl={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=tl,function(){for(var e=0;10>e;e++)tl[e+48]=tl[e+96]=String(e);for(var e=65;90>=e;e++)tl[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)tl[e+111]=tl[e+63235]="F"+e}();var rl,nl=function(){function e(e){return 255>=e?t.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1791>=e?r.charAt(e-1536):e>=1792&&2220>=e?"r":"L"}var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,a="L";return function(t){if(!n.test(t))return!1;for(var r,u=t.length,c=[],f=0;u>f;++f)c.push(r=e(t.charCodeAt(f)));for(var f=0,h=a;u>f;++f){var r=c[f];"m"==r?c[f]=h:h=r}for(var f=0,d=a;u>f;++f){var r=c[f];"1"==r&&"r"==d?c[f]="n":o.test(r)&&(d=r,"r"==r&&(c[f]="R"))}for(var f=1,h=c[0];u-1>f;++f){var r=c[f];"+"==r&&"1"==h&&"1"==c[f+1]?c[f]="1":","!=r||h!=c[f+1]||"1"!=h&&"n"!=h||(c[f]=h),h=r}for(var f=0;u>f;++f){var r=c[f];if(","==r)c[f]="N";else if("%"==r){for(var p=f+1;u>p&&"%"==c[p];++p);for(var m=f&&"!"==c[f-1]||u>p&&"1"==c[p]?"1":"N",g=f;p>g;++g)c[g]=m;f=p-1}}for(var f=0,d=a;u>f;++f){var r=c[f];"L"==d&&"1"==r?c[f]="L":o.test(r)&&(d=r)}for(var f=0;u>f;++f)if(i.test(c[f])){for(var p=f+1;u>p&&i.test(c[p]);++p);for(var v="L"==(f?c[f-1]:a),y="L"==(u>p?c[p]:a),m=v||y?"L":"R",g=f;p>g;++g)c[g]=m;f=p-1}for(var b,x=[],f=0;u>f;)if(l.test(c[f])){var C=f;for(++f;u>f&&l.test(c[f]);++f);x.push({from:C,to:f,level:0})}else{var w=f,L=x.length;for(++f;u>f&&"L"!=c[f];++f);for(var g=w;f>g;)if(s.test(c[g])){g>w&&x.splice(L,0,{from:w,to:g,level:1});var S=g;for(++g;f>g&&s.test(c[g]);++g);x.splice(L,0,{from:S,to:g,level:2}),w=g}else++g;f>w&&x.splice(L,0,{from:w,to:f,level:1})}return 1==x[0].level&&(b=t.match(/^\s+/))&&(x[0].from=b[0].length,x.unshift({from:0,to:b[0].length,level:0})),1==ci(x).level&&(b=t.match(/\s+$/))&&(ci(x).to-=b[0].length,x.push({from:u-b[0].length,to:u,level:0})),x[0].level!=ci(x).level&&x.push({from:u,to:u,level:x[0].level}),x}}();return e.version="3.24.0",e}(); \ No newline at end of file diff --git a/ajax/libs/codemirror/3.24.0/package/keymap/emacs.js b/ajax/libs/codemirror/3.24.0/keymap/emacs.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/keymap/emacs.js rename to ajax/libs/codemirror/3.24.0/keymap/emacs.js diff --git a/ajax/libs/codemirror/3.24.0/package/keymap/extra.js b/ajax/libs/codemirror/3.24.0/keymap/extra.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/keymap/extra.js rename to ajax/libs/codemirror/3.24.0/keymap/extra.js diff --git a/ajax/libs/codemirror/3.24.0/package/keymap/vim.js b/ajax/libs/codemirror/3.24.0/keymap/vim.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/keymap/vim.js rename to ajax/libs/codemirror/3.24.0/keymap/vim.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/apl/apl.js b/ajax/libs/codemirror/3.24.0/mode/apl/apl.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/apl/apl.js rename to ajax/libs/codemirror/3.24.0/mode/apl/apl.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/asterisk/asterisk.js b/ajax/libs/codemirror/3.24.0/mode/asterisk/asterisk.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/asterisk/asterisk.js rename to ajax/libs/codemirror/3.24.0/mode/asterisk/asterisk.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/clike/clike.js b/ajax/libs/codemirror/3.24.0/mode/clike/clike.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/clike/clike.js rename to ajax/libs/codemirror/3.24.0/mode/clike/clike.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/clojure/clojure.js b/ajax/libs/codemirror/3.24.0/mode/clojure/clojure.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/clojure/clojure.js rename to ajax/libs/codemirror/3.24.0/mode/clojure/clojure.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/cobol/cobol.js b/ajax/libs/codemirror/3.24.0/mode/cobol/cobol.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/cobol/cobol.js rename to ajax/libs/codemirror/3.24.0/mode/cobol/cobol.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/coffeescript/coffeescript.js b/ajax/libs/codemirror/3.24.0/mode/coffeescript/coffeescript.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/coffeescript/coffeescript.js rename to ajax/libs/codemirror/3.24.0/mode/coffeescript/coffeescript.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/commonlisp/commonlisp.js b/ajax/libs/codemirror/3.24.0/mode/commonlisp/commonlisp.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/commonlisp/commonlisp.js rename to ajax/libs/codemirror/3.24.0/mode/commonlisp/commonlisp.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/css.js b/ajax/libs/codemirror/3.24.0/mode/css/css.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/css/css.js rename to ajax/libs/codemirror/3.24.0/mode/css/css.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/less_test.js b/ajax/libs/codemirror/3.24.0/mode/css/less_test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/css/less_test.js rename to ajax/libs/codemirror/3.24.0/mode/css/less_test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/scss_test.js b/ajax/libs/codemirror/3.24.0/mode/css/scss_test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/css/scss_test.js rename to ajax/libs/codemirror/3.24.0/mode/css/scss_test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/test.js b/ajax/libs/codemirror/3.24.0/mode/css/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/css/test.js rename to ajax/libs/codemirror/3.24.0/mode/css/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/d/d.js b/ajax/libs/codemirror/3.24.0/mode/d/d.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/d/d.js rename to ajax/libs/codemirror/3.24.0/mode/d/d.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/diff/diff.js b/ajax/libs/codemirror/3.24.0/mode/diff/diff.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/diff/diff.js rename to ajax/libs/codemirror/3.24.0/mode/diff/diff.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/django/django.js b/ajax/libs/codemirror/3.24.0/mode/django/django.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/django/django.js rename to ajax/libs/codemirror/3.24.0/mode/django/django.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/dtd/dtd.js b/ajax/libs/codemirror/3.24.0/mode/dtd/dtd.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/dtd/dtd.js rename to ajax/libs/codemirror/3.24.0/mode/dtd/dtd.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/dylan/dylan.js b/ajax/libs/codemirror/3.24.0/mode/dylan/dylan.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/dylan/dylan.js rename to ajax/libs/codemirror/3.24.0/mode/dylan/dylan.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/ecl/ecl.js b/ajax/libs/codemirror/3.24.0/mode/ecl/ecl.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/ecl/ecl.js rename to ajax/libs/codemirror/3.24.0/mode/ecl/ecl.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/eiffel/eiffel.js b/ajax/libs/codemirror/3.24.0/mode/eiffel/eiffel.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/eiffel/eiffel.js rename to ajax/libs/codemirror/3.24.0/mode/eiffel/eiffel.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/erlang/erlang.js b/ajax/libs/codemirror/3.24.0/mode/erlang/erlang.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/erlang/erlang.js rename to ajax/libs/codemirror/3.24.0/mode/erlang/erlang.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/fortran/fortran.js b/ajax/libs/codemirror/3.24.0/mode/fortran/fortran.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/fortran/fortran.js rename to ajax/libs/codemirror/3.24.0/mode/fortran/fortran.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gas/gas.js b/ajax/libs/codemirror/3.24.0/mode/gas/gas.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/gas/gas.js rename to ajax/libs/codemirror/3.24.0/mode/gas/gas.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gfm/gfm.js b/ajax/libs/codemirror/3.24.0/mode/gfm/gfm.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/gfm/gfm.js rename to ajax/libs/codemirror/3.24.0/mode/gfm/gfm.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gfm/test.js b/ajax/libs/codemirror/3.24.0/mode/gfm/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/gfm/test.js rename to ajax/libs/codemirror/3.24.0/mode/gfm/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gherkin/gherkin.js b/ajax/libs/codemirror/3.24.0/mode/gherkin/gherkin.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/gherkin/gherkin.js rename to ajax/libs/codemirror/3.24.0/mode/gherkin/gherkin.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/go/go.js b/ajax/libs/codemirror/3.24.0/mode/go/go.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/go/go.js rename to ajax/libs/codemirror/3.24.0/mode/go/go.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/groovy/groovy.js b/ajax/libs/codemirror/3.24.0/mode/groovy/groovy.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/groovy/groovy.js rename to ajax/libs/codemirror/3.24.0/mode/groovy/groovy.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haml/haml.js b/ajax/libs/codemirror/3.24.0/mode/haml/haml.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/haml/haml.js rename to ajax/libs/codemirror/3.24.0/mode/haml/haml.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haml/test.js b/ajax/libs/codemirror/3.24.0/mode/haml/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/haml/test.js rename to ajax/libs/codemirror/3.24.0/mode/haml/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haskell/haskell.js b/ajax/libs/codemirror/3.24.0/mode/haskell/haskell.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/haskell/haskell.js rename to ajax/libs/codemirror/3.24.0/mode/haskell/haskell.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haxe/haxe.js b/ajax/libs/codemirror/3.24.0/mode/haxe/haxe.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/haxe/haxe.js rename to ajax/libs/codemirror/3.24.0/mode/haxe/haxe.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/htmlembedded/htmlembedded.js b/ajax/libs/codemirror/3.24.0/mode/htmlembedded/htmlembedded.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/htmlembedded/htmlembedded.js rename to ajax/libs/codemirror/3.24.0/mode/htmlembedded/htmlembedded.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/htmlmixed/htmlmixed.js b/ajax/libs/codemirror/3.24.0/mode/htmlmixed/htmlmixed.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/htmlmixed/htmlmixed.js rename to ajax/libs/codemirror/3.24.0/mode/htmlmixed/htmlmixed.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/http/http.js b/ajax/libs/codemirror/3.24.0/mode/http/http.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/http/http.js rename to ajax/libs/codemirror/3.24.0/mode/http/http.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/jade/jade.js b/ajax/libs/codemirror/3.24.0/mode/jade/jade.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/jade/jade.js rename to ajax/libs/codemirror/3.24.0/mode/jade/jade.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/javascript/javascript.js b/ajax/libs/codemirror/3.24.0/mode/javascript/javascript.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/javascript/javascript.js rename to ajax/libs/codemirror/3.24.0/mode/javascript/javascript.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/javascript/test.js b/ajax/libs/codemirror/3.24.0/mode/javascript/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/javascript/test.js rename to ajax/libs/codemirror/3.24.0/mode/javascript/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/jinja2/jinja2.js b/ajax/libs/codemirror/3.24.0/mode/jinja2/jinja2.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/jinja2/jinja2.js rename to ajax/libs/codemirror/3.24.0/mode/jinja2/jinja2.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/julia/julia.js b/ajax/libs/codemirror/3.24.0/mode/julia/julia.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/julia/julia.js rename to ajax/libs/codemirror/3.24.0/mode/julia/julia.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/less/less.js b/ajax/libs/codemirror/3.24.0/mode/less/less.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/less/less.js rename to ajax/libs/codemirror/3.24.0/mode/less/less.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/livescript/livescript.js b/ajax/libs/codemirror/3.24.0/mode/livescript/livescript.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/livescript/livescript.js rename to ajax/libs/codemirror/3.24.0/mode/livescript/livescript.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/livescript/livescript.ls b/ajax/libs/codemirror/3.24.0/mode/livescript/livescript.ls similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/livescript/livescript.ls rename to ajax/libs/codemirror/3.24.0/mode/livescript/livescript.ls diff --git a/ajax/libs/codemirror/3.24.0/package/mode/lua/lua.js b/ajax/libs/codemirror/3.24.0/mode/lua/lua.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/lua/lua.js rename to ajax/libs/codemirror/3.24.0/mode/lua/lua.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/markdown/markdown.js b/ajax/libs/codemirror/3.24.0/mode/markdown/markdown.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/markdown/markdown.js rename to ajax/libs/codemirror/3.24.0/mode/markdown/markdown.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/markdown/test.js b/ajax/libs/codemirror/3.24.0/mode/markdown/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/markdown/test.js rename to ajax/libs/codemirror/3.24.0/mode/markdown/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/meta.js b/ajax/libs/codemirror/3.24.0/mode/meta.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/meta.js rename to ajax/libs/codemirror/3.24.0/mode/meta.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/mirc/mirc.js b/ajax/libs/codemirror/3.24.0/mode/mirc/mirc.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/mirc/mirc.js rename to ajax/libs/codemirror/3.24.0/mode/mirc/mirc.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/mllike/mllike.js b/ajax/libs/codemirror/3.24.0/mode/mllike/mllike.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/mllike/mllike.js rename to ajax/libs/codemirror/3.24.0/mode/mllike/mllike.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/nginx/nginx.js b/ajax/libs/codemirror/3.24.0/mode/nginx/nginx.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/nginx/nginx.js rename to ajax/libs/codemirror/3.24.0/mode/nginx/nginx.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/ntriples/ntriples.js b/ajax/libs/codemirror/3.24.0/mode/ntriples/ntriples.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/ntriples/ntriples.js rename to ajax/libs/codemirror/3.24.0/mode/ntriples/ntriples.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/octave/octave.js b/ajax/libs/codemirror/3.24.0/mode/octave/octave.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/octave/octave.js rename to ajax/libs/codemirror/3.24.0/mode/octave/octave.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/pascal/pascal.js b/ajax/libs/codemirror/3.24.0/mode/pascal/pascal.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/pascal/pascal.js rename to ajax/libs/codemirror/3.24.0/mode/pascal/pascal.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/pegjs/pegjs.js b/ajax/libs/codemirror/3.24.0/mode/pegjs/pegjs.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/pegjs/pegjs.js rename to ajax/libs/codemirror/3.24.0/mode/pegjs/pegjs.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/perl/perl.js b/ajax/libs/codemirror/3.24.0/mode/perl/perl.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/perl/perl.js rename to ajax/libs/codemirror/3.24.0/mode/perl/perl.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/php/php.js b/ajax/libs/codemirror/3.24.0/mode/php/php.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/php/php.js rename to ajax/libs/codemirror/3.24.0/mode/php/php.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/php/test.js b/ajax/libs/codemirror/3.24.0/mode/php/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/php/test.js rename to ajax/libs/codemirror/3.24.0/mode/php/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/pig/pig.js b/ajax/libs/codemirror/3.24.0/mode/pig/pig.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/pig/pig.js rename to ajax/libs/codemirror/3.24.0/mode/pig/pig.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/properties/properties.js b/ajax/libs/codemirror/3.24.0/mode/properties/properties.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/properties/properties.js rename to ajax/libs/codemirror/3.24.0/mode/properties/properties.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/puppet/puppet.js b/ajax/libs/codemirror/3.24.0/mode/puppet/puppet.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/puppet/puppet.js rename to ajax/libs/codemirror/3.24.0/mode/puppet/puppet.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/python/python.js b/ajax/libs/codemirror/3.24.0/mode/python/python.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/python/python.js rename to ajax/libs/codemirror/3.24.0/mode/python/python.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/q/q.js b/ajax/libs/codemirror/3.24.0/mode/q/q.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/q/q.js rename to ajax/libs/codemirror/3.24.0/mode/q/q.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/r/r.js b/ajax/libs/codemirror/3.24.0/mode/r/r.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/r/r.js rename to ajax/libs/codemirror/3.24.0/mode/r/r.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rpm/changes/changes.js b/ajax/libs/codemirror/3.24.0/mode/rpm/changes/changes.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/rpm/changes/changes.js rename to ajax/libs/codemirror/3.24.0/mode/rpm/changes/changes.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rpm/spec/spec.css b/ajax/libs/codemirror/3.24.0/mode/rpm/spec/spec.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/rpm/spec/spec.css rename to ajax/libs/codemirror/3.24.0/mode/rpm/spec/spec.css diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rpm/spec/spec.js b/ajax/libs/codemirror/3.24.0/mode/rpm/spec/spec.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/rpm/spec/spec.js rename to ajax/libs/codemirror/3.24.0/mode/rpm/spec/spec.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rst/rst.js b/ajax/libs/codemirror/3.24.0/mode/rst/rst.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/rst/rst.js rename to ajax/libs/codemirror/3.24.0/mode/rst/rst.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/ruby/ruby.js b/ajax/libs/codemirror/3.24.0/mode/ruby/ruby.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/ruby/ruby.js rename to ajax/libs/codemirror/3.24.0/mode/ruby/ruby.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/ruby/test.js b/ajax/libs/codemirror/3.24.0/mode/ruby/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/ruby/test.js rename to ajax/libs/codemirror/3.24.0/mode/ruby/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rust/rust.js b/ajax/libs/codemirror/3.24.0/mode/rust/rust.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/rust/rust.js rename to ajax/libs/codemirror/3.24.0/mode/rust/rust.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sass/sass.js b/ajax/libs/codemirror/3.24.0/mode/sass/sass.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/sass/sass.js rename to ajax/libs/codemirror/3.24.0/mode/sass/sass.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/scheme/scheme.js b/ajax/libs/codemirror/3.24.0/mode/scheme/scheme.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/scheme/scheme.js rename to ajax/libs/codemirror/3.24.0/mode/scheme/scheme.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/shell/shell.js b/ajax/libs/codemirror/3.24.0/mode/shell/shell.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/shell/shell.js rename to ajax/libs/codemirror/3.24.0/mode/shell/shell.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sieve/sieve.js b/ajax/libs/codemirror/3.24.0/mode/sieve/sieve.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/sieve/sieve.js rename to ajax/libs/codemirror/3.24.0/mode/sieve/sieve.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/smalltalk/smalltalk.js b/ajax/libs/codemirror/3.24.0/mode/smalltalk/smalltalk.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/smalltalk/smalltalk.js rename to ajax/libs/codemirror/3.24.0/mode/smalltalk/smalltalk.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/smarty/smarty.js b/ajax/libs/codemirror/3.24.0/mode/smarty/smarty.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/smarty/smarty.js rename to ajax/libs/codemirror/3.24.0/mode/smarty/smarty.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/smartymixed/smartymixed.js b/ajax/libs/codemirror/3.24.0/mode/smartymixed/smartymixed.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/smartymixed/smartymixed.js rename to ajax/libs/codemirror/3.24.0/mode/smartymixed/smartymixed.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/solr/solr.js b/ajax/libs/codemirror/3.24.0/mode/solr/solr.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/solr/solr.js rename to ajax/libs/codemirror/3.24.0/mode/solr/solr.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sparql/sparql.js b/ajax/libs/codemirror/3.24.0/mode/sparql/sparql.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/sparql/sparql.js rename to ajax/libs/codemirror/3.24.0/mode/sparql/sparql.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sql/sql.js b/ajax/libs/codemirror/3.24.0/mode/sql/sql.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/sql/sql.js rename to ajax/libs/codemirror/3.24.0/mode/sql/sql.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/stex/stex.js b/ajax/libs/codemirror/3.24.0/mode/stex/stex.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/stex/stex.js rename to ajax/libs/codemirror/3.24.0/mode/stex/stex.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/stex/test.js b/ajax/libs/codemirror/3.24.0/mode/stex/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/stex/test.js rename to ajax/libs/codemirror/3.24.0/mode/stex/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tcl/tcl.js b/ajax/libs/codemirror/3.24.0/mode/tcl/tcl.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/tcl/tcl.js rename to ajax/libs/codemirror/3.24.0/mode/tcl/tcl.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/tiddlywiki.css b/ajax/libs/codemirror/3.24.0/mode/tiddlywiki/tiddlywiki.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/tiddlywiki.css rename to ajax/libs/codemirror/3.24.0/mode/tiddlywiki/tiddlywiki.css diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/tiddlywiki.js b/ajax/libs/codemirror/3.24.0/mode/tiddlywiki/tiddlywiki.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/tiddlywiki.js rename to ajax/libs/codemirror/3.24.0/mode/tiddlywiki/tiddlywiki.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tiki/tiki.css b/ajax/libs/codemirror/3.24.0/mode/tiki/tiki.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/tiki/tiki.css rename to ajax/libs/codemirror/3.24.0/mode/tiki/tiki.css diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tiki/tiki.js b/ajax/libs/codemirror/3.24.0/mode/tiki/tiki.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/tiki/tiki.js rename to ajax/libs/codemirror/3.24.0/mode/tiki/tiki.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/toml/toml.js b/ajax/libs/codemirror/3.24.0/mode/toml/toml.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/toml/toml.js rename to ajax/libs/codemirror/3.24.0/mode/toml/toml.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/turtle/turtle.js b/ajax/libs/codemirror/3.24.0/mode/turtle/turtle.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/turtle/turtle.js rename to ajax/libs/codemirror/3.24.0/mode/turtle/turtle.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/vb/vb.js b/ajax/libs/codemirror/3.24.0/mode/vb/vb.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/vb/vb.js rename to ajax/libs/codemirror/3.24.0/mode/vb/vb.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/vbscript/vbscript.js b/ajax/libs/codemirror/3.24.0/mode/vbscript/vbscript.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/vbscript/vbscript.js rename to ajax/libs/codemirror/3.24.0/mode/vbscript/vbscript.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/velocity/velocity.js b/ajax/libs/codemirror/3.24.0/mode/velocity/velocity.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/velocity/velocity.js rename to ajax/libs/codemirror/3.24.0/mode/velocity/velocity.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/verilog/test.js b/ajax/libs/codemirror/3.24.0/mode/verilog/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/verilog/test.js rename to ajax/libs/codemirror/3.24.0/mode/verilog/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/verilog/verilog.js b/ajax/libs/codemirror/3.24.0/mode/verilog/verilog.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/verilog/verilog.js rename to ajax/libs/codemirror/3.24.0/mode/verilog/verilog.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/xml/test.js b/ajax/libs/codemirror/3.24.0/mode/xml/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/xml/test.js rename to ajax/libs/codemirror/3.24.0/mode/xml/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/xml/xml.js b/ajax/libs/codemirror/3.24.0/mode/xml/xml.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/xml/xml.js rename to ajax/libs/codemirror/3.24.0/mode/xml/xml.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/xquery/test.js b/ajax/libs/codemirror/3.24.0/mode/xquery/test.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/xquery/test.js rename to ajax/libs/codemirror/3.24.0/mode/xquery/test.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/xquery/xquery.js b/ajax/libs/codemirror/3.24.0/mode/xquery/xquery.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/xquery/xquery.js rename to ajax/libs/codemirror/3.24.0/mode/xquery/xquery.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/yaml/yaml.js b/ajax/libs/codemirror/3.24.0/mode/yaml/yaml.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/yaml/yaml.js rename to ajax/libs/codemirror/3.24.0/mode/yaml/yaml.js diff --git a/ajax/libs/codemirror/3.24.0/package/mode/z80/z80.js b/ajax/libs/codemirror/3.24.0/mode/z80/z80.js similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/mode/z80/z80.js rename to ajax/libs/codemirror/3.24.0/mode/z80/z80.js diff --git a/ajax/libs/codemirror/3.24.0/package/AUTHORS b/ajax/libs/codemirror/3.24.0/package/AUTHORS deleted file mode 100644 index 9eb0c538e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/AUTHORS +++ /dev/null @@ -1,341 +0,0 @@ -List of CodeMirror contributors. Updated before every release. - -4r2r -Aaron Brooks -Abe Fettig -Adam Ahmed -Adam King -adanlobato -Adán Lobato -Adrian Aichner -aeroson -Ahmad Amireh -Ahmad M. Zawawi -ahoward -Akeksandr Motsjonov -Alberto González Palomo -Alberto Pose -Albert Xing -Alexander Pavlov -Alexander Schepanovski -Alexander Solovyov -alexey-k -Alex Piggott -Amsul -Amy -Ananya Sen -anaran -AndersMad -Anderson Mesquita -Andre von Houck -Andrey Lushnikov -Andy Joslin -Andy Kimball -Andy Li -angelozerr -angelo.zerr@gmail.com -Ankit Ahuja -Ansel Santosa -Anthony Grimes -Anton Kovalyov -areos -as3boyan -AtomicPages LLC -Atul Bhouraskar -Aurelian Oancea -Bastian Müller -benbro -Beni Cherniavsky-Paskin -Benjamin DeCoste -Ben Keen -Bernhard Sirlinger -Billy Moon -binny -Blaine G -boomyjee -borawjm -Brandon Frohs -Brandon Wamboldt -Brett Zamir -Brian Sletten -Bruce Mitchener -Chandra Sekhar Pydi -Charles Skelton -Chris Coyier -Chris Granger -Chris Houseknecht -Chris Morgan -Christopher Brown -ciaranj -CodeAnimal -ComFreek -Curtis Gagliardi -dagsta -Dan Heberden -Daniel, Dao Quang Minh -Daniel Faust -Daniel Huigens -Daniel KJ -Daniel Neel -Daniel Parnell -Danny Yoo -Darius Roberts -David Mignot -David Pathakjee -deebugger -Deep Thought -dignifiedquire -domagoj412 -Dominator008 -Domizio Demichelis -Doug Wikle -Drew Bratcher -Drew Hintz -Drew Khoury -Dror BG -duralog -eborden -edsharp -ekhaled -Enam Mijbah Noor -Eric Allam -eustas -Fabien O'Carroll -Fabio Zendhi Nagao -Fauntleroy -fbuchinger -feizhang365 -Felipe Lalanne -Felix Raab -Filip Noetzel -flack -ForbesLindesay -Forbes Lindesay -Ford_Lawnmower -Frank Wiegand -Gabriel Horner -Gabriel Nahmias -galambalazs -Gautam Mehta -Gergely Hegykozi -Glenn Jorde -Glenn Ruehle -Golevka -Gordon Smith -Grant Skinner -greengiant -Guillaume Massé -Guillaume Massé -Gustavo Rodrigues -Hans Engel -Hardest -Hasan Karahan -hitsthings -Hocdoc -Ian Beck -Ian Dickinson -Ian Wehrman -Ian Wetherbee -Ice White -ICHIKAWA, Yuji -ilvalle -Ingo Richter -Irakli Gozalishvili -Ivan Kurnosov -Jacob Lee -Jakob Miland -Jakub Vrana -James Campos -James Thorne -Jamie Hill -Jan Jongboom -jankeromnes -Jan Keromnes -Jan Odvarko -Jan T. Sott -Jason -Jason Grout -Jason Johnston -Jason San Jose -Jason Siefken -Jean Boussier -jeffkenton -Jeff Pickhardt -jem (graphite) -Jochen Berger -Johan Ask -John Connor -John Lees-Miller -John Snelson -John Van Der Loo -Jonathan Malmaud -jongalloway -Jon Malmaud -Joost-Wim Boekesteijn -Joseph Pecoraro -Joshua Newman -Josh Watzman -jots -jsoojeon -Juan Benavides Romero -Jucovschi Constantin -Juho Vuori -jwallers@gmail.com -kaniga -Ken Newman -Ken Rockot -Kevin Sawicki -Klaus Silveira -Koh Zi Han, Cliff -komakino -Konstantin Lopuhin -koops -ks-ifware -kubelsmieci -Lanny -Laszlo Vidacs -leaf corcoran -Leonya Khachaturov -Liam Newman -LM -Lorenzo Stoakes -Luciano Longo -lynschinzer -Maksim Lin -Maksym Taran -Malay Majithia -Manuel Rego Casasnovas -Marat Dreizin -Marco Aurélio -Marco Munizaga -Marijn Haverbeke -Mario Pietsch -Mark Lentczner -Marko Bonaci -Martin Balek -Martín Gaitán -Martin Hasoň -Mason Malone -Mateusz Paprocki -mats cronqvist -Matthew Beale -Matthias BUSSONNIER -Matt McDonald -Matt Pass -Matt Sacks -Maximilian Hils -Maxim Kraev -Max Kirsch -mbarkhau -Metatheos -Micah Dubinko -Michael Lehenbauer -Michael Zhou -Mighty Guava -Miguel Castillo -Mike -Mike Brevoort -Mike Diaz -Mike Ivanov -Mike Kadin -MinRK -Miraculix87 -misfo -mloginov -mps -mtaran-google -Narciso Jaramillo -Nathan Williams -ndr -nerbert -nextrevision -nguillaumin -Ng Zhi An -Nicholas Bollweg -Niels van Groningen -Nikita Beloglazov -Nikita Vasilyev -Nikolay Kostov -nlwillia -pablo -Page -paris -Patil Arpith -Patrick Strawderman -Paul Garvin -Paul Ivanov -Pavel Feldman -Pavel Strashkin -Paweł Bartkiewicz -peteguhl -peterkroon -Peter Kroon -prasanthj -Prasanth J -Radek Piórkowski -Rahul -Randy Edmunds -Rasmus Erik Voel Jensen -Richard Z.H. Wang -robertop23 -Robert Plummer -Ruslan Osmanov -Ryan Prior -sabaca -Samuel Ainsworth -sandeepshetty -santec -Sascha Peilicke -satchmorun -sathyamoorthi -SCLINIC\jdecker -Sebastian Zaha -shaund -shaun gilchrist -Shawn A -sheopory -Shiv Deepak -Shmuel Englard -soliton4 -sonson -spastorelli -Stanislav Oaserele -Stas Kobzar -Stefan Borsje -Steffen Beyer -Steve O'Hara -stoskov -Taha Jahangir -Tarmil -tfjgeorge -Thaddee Tyl -think -Thomas Dvornik -Thomas Schmid -Tim Baumann -Timothy Farrell -Timothy Hatcher -TobiasBg -Tomas-A -Tomas Varaneckas -Tom Erik Støwer -Tom MacWright -Tony Jian -Travis Heppe -Triangle717 -twifkak -Vestimir Markov -vf -Vincent Woo -Volker Mische -wenli -Wesley Wiser -William Jamieson -Wojtek Ptak -Xavier Mendez -YNH Webdev -Yunchi Luo -Yuvi Panda -Zachary Dremann -zziuni -魏鹏刚 diff --git a/ajax/libs/codemirror/3.24.0/package/bin/authors.sh b/ajax/libs/codemirror/3.24.0/package/bin/authors.sh deleted file mode 100755 index b3ee99c6d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/bin/authors.sh +++ /dev/null @@ -1,6 +0,0 @@ -# Combine existing list of authors with everyone known in git, sort, add header. -tail --lines=+3 AUTHORS > AUTHORS.tmp -git log --format='%aN' >> AUTHORS.tmp -echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS -sort -u AUTHORS.tmp >> AUTHORS -rm -f AUTHORS.tmp diff --git a/ajax/libs/codemirror/3.24.0/package/bin/compress b/ajax/libs/codemirror/3.24.0/package/bin/compress deleted file mode 100755 index 809fbe83d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/bin/compress +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env node - -// Compression helper for CodeMirror -// -// Example: -// -// bin/compress codemirror runmode javascript xml -// -// Will take lib/codemirror.js, addon/runmode/runmode.js, -// mode/javascript/javascript.js, and mode/xml/xml.js, run them though -// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit -// out the result. -// -// bin/compress codemirror --local /path/to/bin/UglifyJS -// -// Will use a local minifier instead of the online default one. -// -// Script files are specified without .js ending. Prefixing them with -// their full (local) path is optional. So you may say lib/codemirror -// or mode/xml/xml to be more precise. In fact, even the .js suffix -// may be speficied, if wanted. - -"use strict"; - -var fs = require("fs"); - -function help(ok) { - console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files..."); - process.exit(ok ? 0 : 1); -} - -var local = null, args = [], extraArgs = null, files = [], blob = ""; - -for (var i = 2; i < process.argv.length; ++i) { - var arg = process.argv[i]; - if (arg == "--local" && i + 1 < process.argv.length) { - var parts = process.argv[++i].split(/\s+/); - local = parts[0]; - extraArgs = parts.slice(1); - if (!extraArgs.length) extraArgs = ["-c", "-m"]; - } else if (arg == "--help") { - help(true); - } else if (arg[0] != "-") { - files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))}); - } else help(false); -} - -function walk(dir) { - fs.readdirSync(dir).forEach(function(fname) { - if (/^[_\.]/.test(fname)) return; - var file = dir + fname; - if (fs.statSync(file).isDirectory()) return walk(file + "/"); - if (files.some(function(spec, i) { - var match = spec.re.test(file); - if (match) files.splice(i, 1); - return match; - })) { - if (local) args.push(file); - else blob += fs.readFileSync(file, "utf8"); - } - }); -} - -walk("lib/"); -walk("addon/"); -walk("mode/"); - -if (!local && !blob) help(false); - -if (files.length) { - console.log("Some speficied files were not found: " + - files.map(function(a){return a.name;}).join(", ")); - process.exit(1); -} - -if (local) { - require("child_process").spawn(local, args.concat(extraArgs), {stdio: ["ignore", process.stdout, process.stderr]}); -} else { - var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8"); - var req = require("http").request({ - host: "marijnhaverbeke.nl", - port: 80, - method: "POST", - path: "/uglifyjs", - headers: {"content-type": "application/x-www-form-urlencoded", - "content-length": data.length} - }); - req.on("response", function(resp) { - resp.on("data", function (chunk) { process.stdout.write(chunk); }); - }); - req.end(data); -} diff --git a/ajax/libs/codemirror/3.24.0/package/bin/lint b/ajax/libs/codemirror/3.24.0/package/bin/lint deleted file mode 100755 index 4f70994c5..000000000 --- a/ajax/libs/codemirror/3.24.0/package/bin/lint +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -var lint = require("../test/lint/lint"), - path = require("path"); - -if (process.argv.length > 2) { - lint.checkDir(process.argv[2]); -} else { - process.chdir(path.resolve(__dirname, "..")); - lint.checkDir("lib"); - lint.checkDir("mode"); - lint.checkDir("addon"); - lint.checkDir("keymap"); -} - -process.exit(lint.success() ? 0 : 1); diff --git a/ajax/libs/codemirror/3.24.0/package/bin/release b/ajax/libs/codemirror/3.24.0/package/bin/release deleted file mode 100755 index 3c33290f3..000000000 --- a/ajax/libs/codemirror/3.24.0/package/bin/release +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node - -var fs = require("fs"), child = require("child_process"); - -var number, bumpOnly; - -for (var i = 2; i < process.argv.length; i++) { - if (process.argv[i] == "-bump") bumpOnly = true; - else if (/^\d+\.\d+\.\d+$/.test(process.argv[i])) number = process.argv[i]; - else { console.log("Bogus command line arg: " + process.argv[i]); process.exit(1); } -} - -if (!number) { console.log("Must give a version"); process.exit(1); } - -function rewrite(file, f) { - fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8"); -} - -rewrite("lib/codemirror.js", function(lib) { - return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/, - "CodeMirror.version = \"" + number + "\""); -}); -rewrite("package.json", function(pack) { - return pack.replace(/"version":"\d+\.\d+\.\d+"/, "\"version\":\"" + number + "\""); -}); -rewrite("doc/manual.html", function(manual) { - return manual.replace(/>version \d+\.\d+\.\d+<\/span>/, ">version " + number + ""); -}); - -if (bumpOnly) process.exit(0); - -child.exec("bash bin/authors.sh", function(){}); - -var simple = number.slice(0, number.lastIndexOf(".")); - -rewrite("doc/compress.html", function(cmp) { - return cmp.replace(/\n "); -}); - -rewrite("index.html", function(index) { - return index.replace(/version \d+\.\d+<\/strong>/, - "version " + simple + ""); -}); diff --git a/ajax/libs/codemirror/3.24.0/package/bin/source-highlight b/ajax/libs/codemirror/3.24.0/package/bin/source-highlight deleted file mode 100755 index 1373f6626..000000000 --- a/ajax/libs/codemirror/3.24.0/package/bin/source-highlight +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env node - -// Simple command-line code highlighting tool. Reads code from stdin, -// spits html to stdout. For example: -// -// echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript -// bin/source-highlight -s - -var fs = require("fs"); - -CodeMirror = require("../addon/runmode/runmode.node.js"); -require("../mode/meta.js"); - -var sPos = process.argv.indexOf("-s"); -if (sPos == -1 || sPos == process.argv.length - 1) { - console.error("Usage: source-highlight -s language"); - process.exit(1); -} -var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang; -CodeMirror.modeInfo.forEach(function(info) { - if (info.mime == lang) { - modeName = info.mode; - } else if (info.name.toLowerCase() == lang) { - modeName = info.mode; - lang = info.mime; - } -}); - -function ensureMode(name) { - if (CodeMirror.modes[name] || name == "null") return; - try { - require("../mode/" + name + "/" + name + ".js"); - } catch(e) { - console.error("Could not load mode " + name + "."); - process.exit(1); - } - var obj = CodeMirror.modes[name]; - if (obj.dependencies) obj.dependencies.forEach(ensureMode); -} -ensureMode(modeName); - -function esc(str) { - return str.replace(/[<&]/g, function(ch) { return ch == "&" ? "&" : "<"; }); -} - -var code = fs.readFileSync("/dev/stdin", "utf8"); -var curStyle = null, accum = ""; -function flush() { - if (curStyle) process.stdout.write("" + esc(accum) + ""); - else process.stdout.write(esc(accum)); -} - -CodeMirror.runMode(code, lang, function(text, style) { - if (style != curStyle) { - flush(); - curStyle = style; accum = text; - } else { - accum += text; - } -}); -flush(); diff --git a/ajax/libs/codemirror/3.24.0/package/bower.json b/ajax/libs/codemirror/3.24.0/package/bower.json deleted file mode 100644 index 66e049dfb..000000000 --- a/ajax/libs/codemirror/3.24.0/package/bower.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "CodeMirror", - "main": ["lib/codemirror.js", "lib/codemirror.css"], - "ignore": [ - "**/.*", - "node_modules", - "components", - "bin", - "demo", - "doc", - "test", - "index.html", - "package.json" - ] -} diff --git a/ajax/libs/codemirror/3.24.0/package/demo/activeline.html b/ajax/libs/codemirror/3.24.0/package/demo/activeline.html deleted file mode 100644 index 14851c35e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/activeline.html +++ /dev/null @@ -1,78 +0,0 @@ - - -CodeMirror: Active Line Demo - - - - - - - - - - -
-

Active Line Demo

-
- - - -

Styling the current cursor line.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/anywordhint.html b/ajax/libs/codemirror/3.24.0/package/demo/anywordhint.html deleted file mode 100644 index 851f43000..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/anywordhint.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: Any Word Completion Demo - - - - - - - - - - - -
-

Any Word Completion Demo

-
- -

Press ctrl-space to activate autocompletion. The -completion uses -the anyword-hint.js -module, which simply looks at nearby words in the buffer and completes -to those.

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/bidi.html b/ajax/libs/codemirror/3.24.0/package/demo/bidi.html deleted file mode 100644 index 569693c87..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/bidi.html +++ /dev/null @@ -1,74 +0,0 @@ - - -CodeMirror: Bi-directional Text Demo - - - - - - - - - -
-

Bi-directional Text Demo

-
- - - -

Demonstration of bi-directional text support. See - the related - blog post for more background.

- -

Note: There is - a known - bug with cursor motion and mouse clicks in bi-directional lines - that are line wrapped.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/btree.html b/ajax/libs/codemirror/3.24.0/package/demo/btree.html deleted file mode 100644 index 7635ca1bb..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/btree.html +++ /dev/null @@ -1,86 +0,0 @@ - - -CodeMirror: B-Tree visualization - - - - - - - - -
-

B-Tree visualization

-
- -
- - - - -

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/buffers.html b/ajax/libs/codemirror/3.24.0/package/demo/buffers.html deleted file mode 100644 index 951209cad..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/buffers.html +++ /dev/null @@ -1,109 +0,0 @@ - - -CodeMirror: Multiple Buffer & Split View Demo - - - - - - - - - - -
-

Multiple Buffer & Split View Demo

- - -
-
- Select buffer: -     -
-
-
- Select buffer: -     -
- - - -

Demonstration of - using linked documents - to provide a split view on a document, and - using swapDoc - to use a single editor to display multiple documents.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/changemode.html b/ajax/libs/codemirror/3.24.0/package/demo/changemode.html deleted file mode 100644 index ad4c9d1b2..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/changemode.html +++ /dev/null @@ -1,58 +0,0 @@ - - -CodeMirror: Mode-Changing Demo - - - - - - - - - - -
-

Mode-Changing Demo

-
- -

On changes to the content of the above editor, a (crude) script -tries to auto-detect the language used, and switches the editor to -either JavaScript or Scheme mode based on that.

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/closebrackets.html b/ajax/libs/codemirror/3.24.0/package/demo/closebrackets.html deleted file mode 100644 index 8c0dc1cc3..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/closebrackets.html +++ /dev/null @@ -1,63 +0,0 @@ - - -CodeMirror: Closebrackets Demo - - - - - - - - - - -
-

Closebrackets Demo

-
- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/closetag.html b/ajax/libs/codemirror/3.24.0/package/demo/closetag.html deleted file mode 100644 index 39ca8b3f5..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/closetag.html +++ /dev/null @@ -1,41 +0,0 @@ - - -CodeMirror: Close-Tag Demo - - - - - - - - - - - - - - -
-

Close-Tag Demo

-
- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/complete.html b/ajax/libs/codemirror/3.24.0/package/demo/complete.html deleted file mode 100644 index 047a7ecca..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/complete.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: Autocomplete Demo - - - - - - - - - - - - -
-

Autocomplete Demo

-
- -

Press ctrl-space to activate autocompletion. Built -on top of the show-hint -and javascript-hint -addons.

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/emacs.html b/ajax/libs/codemirror/3.24.0/package/demo/emacs.html deleted file mode 100644 index 5b622a999..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/emacs.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Emacs bindings demo - - - - - - - - - - - - - - - - -
-

Emacs bindings demo

-
- -

The emacs keybindings are enabled by -including keymap/emacs.js and setting -the keyMap option to "emacs". Because -CodeMirror's internal API is quite different from Emacs, they are only -a loose approximation of actual emacs bindings, though.

- -

Also note that a lot of browsers disallow certain keys from being -captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the -result that idiomatic use of Emacs keys will constantly close your tab -or open a new window.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/folding.html b/ajax/libs/codemirror/3.24.0/package/demo/folding.html deleted file mode 100644 index 84ef510f7..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/folding.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - CodeMirror: Code Folding Demo - - - - - - - - - - - - - - - - - - - - - -
-

Code Folding Demo

-
-
JavaScript:
-
-
HTML:
-
-
Markdown:
-
-
- -
- diff --git a/ajax/libs/codemirror/3.24.0/package/demo/fullscreen.html b/ajax/libs/codemirror/3.24.0/package/demo/fullscreen.html deleted file mode 100644 index 0a11f3192..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/fullscreen.html +++ /dev/null @@ -1,83 +0,0 @@ - - -CodeMirror: Full Screen Editing - - - - - - - - - - - - -
-

Full Screen Editing

-
- - -

Demonstration of - the fullscreen - addon. Press F11 when cursor is in the editor to - toggle full screen editing. Esc can also be used - to exit full screen editing.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/hardwrap.html b/ajax/libs/codemirror/3.24.0/package/demo/hardwrap.html deleted file mode 100644 index 598bf957d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/hardwrap.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: Hard-wrapping Demo - - - - - - - - - - -
-

Hard-wrapping Demo

-
- -

Demonstration of -the hardwrap addon. -The above editor has its change event hooked up to -the wrapParagraphsInRange method, so that the paragraphs -are reflown as you are typing.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/html5complete.html b/ajax/libs/codemirror/3.24.0/package/demo/html5complete.html deleted file mode 100644 index 94ced527d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/html5complete.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - CodeMirror: HTML completion demo - - - - - - - - - - - - - - - - - - - -
-

HTML completion demo

- -

Shows the XML completer - parameterized with information about the tags in HTML. - Press ctrl-space to activate completion.

- -
- - -
- diff --git a/ajax/libs/codemirror/3.24.0/package/demo/indentwrap.html b/ajax/libs/codemirror/3.24.0/package/demo/indentwrap.html deleted file mode 100644 index efdba5d59..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/indentwrap.html +++ /dev/null @@ -1,59 +0,0 @@ - - -CodeMirror: Indented wrapped line demo - - - - - - - - - -
-

Indented wrapped line demo

-
- -

This page uses a hack on top of the "renderLine" - event to make wrapped text line up with the base indentation of - the line.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/lint.html b/ajax/libs/codemirror/3.24.0/package/demo/lint.html deleted file mode 100644 index 8372c52c4..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/lint.html +++ /dev/null @@ -1,171 +0,0 @@ - - -CodeMirror: Linter Demo - - - - - - - - - - - - - - - - - - -
-

Linter Demo

- - -

- -

- -

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/loadmode.html b/ajax/libs/codemirror/3.24.0/package/demo/loadmode.html deleted file mode 100644 index be28c7a81..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/loadmode.html +++ /dev/null @@ -1,49 +0,0 @@ - - -CodeMirror: Lazy Mode Loading Demo - - - - - - - - - -
-

Lazy Mode Loading Demo

-
-

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/marker.html b/ajax/libs/codemirror/3.24.0/package/demo/marker.html deleted file mode 100644 index ac4dfda89..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/marker.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: Breakpoint Demo - - - - - - - - - -
-

Breakpoint Demo

-
- -

Click the line-number gutter to add or remove 'breakpoints'.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/markselection.html b/ajax/libs/codemirror/3.24.0/package/demo/markselection.html deleted file mode 100644 index 454933264..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/markselection.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: Match Selection Demo - - - - - - - - - - -
-

Match Selection Demo

-
- - - -

Simple addon to easily mark (and style) selected text.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/matchhighlighter.html b/ajax/libs/codemirror/3.24.0/package/demo/matchhighlighter.html deleted file mode 100644 index 170213bfc..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/matchhighlighter.html +++ /dev/null @@ -1,47 +0,0 @@ - - -CodeMirror: Match Highlighter Demo - - - - - - - - - - -
-

Match Highlighter Demo

-
- - - -

Search and highlight occurences of the selected text.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/matchtags.html b/ajax/libs/codemirror/3.24.0/package/demo/matchtags.html deleted file mode 100644 index 9a3797e59..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/matchtags.html +++ /dev/null @@ -1,49 +0,0 @@ - - -CodeMirror: Tag Matcher Demo - - - - - - - - - - - -
-

Tag Matcher Demo

- - -
- - - -

Put the cursor on or inside a pair of tags to highlight them. - Press Ctrl-J to jump to the tag that matches the one under the - cursor.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/merge.html b/ajax/libs/codemirror/3.24.0/package/demo/merge.html deleted file mode 100644 index fc272f065..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/merge.html +++ /dev/null @@ -1,81 +0,0 @@ - - -CodeMirror: merge view demo - - - - - - - - - - - - -
-

merge view demo

- - -
- -

The merge -addon provides an interface for displaying and merging diffs, -either two-way -or three-way. The left -(or center) pane is editable, and the differences with the other -pane(s) are optionally shown live as you edit it.

- -

This addon depends on -the google-diff-match-patch -library to compute the diffs.

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/multiplex.html b/ajax/libs/codemirror/3.24.0/package/demo/multiplex.html deleted file mode 100644 index 2ad9608a8..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/multiplex.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Multiplexing Parser Demo - - - - - - - - - - -
-

Multiplexing Parser Demo

-
- - - -

Demonstration of a multiplexing mode, which, at certain - boundary strings, switches to one or more inner modes. The out - (HTML) mode does not get fed the content of the << - >> blocks. See - the manual and - the source for more - information.

- -

- Parsing/Highlighting Tests: - normal, - verbose. -

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/mustache.html b/ajax/libs/codemirror/3.24.0/package/demo/mustache.html deleted file mode 100644 index cb0291598..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/mustache.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Overlay Parser Demo - - - - - - - - - - -
-

Overlay Parser Demo

-
- - - -

Demonstration of a mode that parses HTML, highlighting - the Mustache templating - directives inside of it by using the code - in overlay.js. View - source to see the 15 lines of code needed to accomplish this.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/placeholder.html b/ajax/libs/codemirror/3.24.0/package/demo/placeholder.html deleted file mode 100644 index 6cf098b01..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/placeholder.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: Placeholder demo - - - - - - - - - -
-

Placeholder demo

-
- -

The placeholder - plug-in adds an option placeholder that can be set to - make text appear in the editor when it is empty and not focused. - If the source textarea has a placeholder attribute, - it will automatically be inherited.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/preview.html b/ajax/libs/codemirror/3.24.0/package/demo/preview.html deleted file mode 100644 index d2aada3c8..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/preview.html +++ /dev/null @@ -1,87 +0,0 @@ - - -CodeMirror: HTML5 preview - - - - - - - - - - - - -
-

HTML5 preview

- - - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/resize.html b/ajax/libs/codemirror/3.24.0/package/demo/resize.html deleted file mode 100644 index 10326ef66..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/resize.html +++ /dev/null @@ -1,58 +0,0 @@ - - -CodeMirror: Autoresize Demo - - - - - - - - - -
-

Autoresize Demo

-
- -

By setting a few CSS properties, and giving -the viewportMargin -a value of Infinity, CodeMirror can be made to -automatically resize to fit its content.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/rulers.html b/ajax/libs/codemirror/3.24.0/package/demo/rulers.html deleted file mode 100644 index d75fd080e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/rulers.html +++ /dev/null @@ -1,54 +0,0 @@ - - -CodeMirror: Ruler Demo - - - - - - - - - -
-

Ruler Demo

- - - -

Demonstration of -the rulers addon, which -displays vertical lines at given column offsets.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/runmode.html b/ajax/libs/codemirror/3.24.0/package/demo/runmode.html deleted file mode 100644 index 144783d34..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/runmode.html +++ /dev/null @@ -1,62 +0,0 @@ - - -CodeMirror: Mode Runner Demo - - - - - - - - - -
-

Mode Runner Demo

- - -
- -

-
-    
-
-    

Running a CodeMirror mode outside of the editor. - The CodeMirror.runMode function, defined - in lib/runmode.js takes the following arguments:

- -
-
text (string)
-
The document to run through the highlighter.
-
mode (mode spec)
-
The mode to use (must be loaded as normal).
-
output (function or DOM node)
-
If this is a function, it will be called for each token with - two arguments, the token's text and the token's style class (may - be null for unstyled tokens). If it is a DOM node, - the tokens will be converted to span elements as in - an editor, and inserted into the node - (through innerHTML).
-
- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/search.html b/ajax/libs/codemirror/3.24.0/package/demo/search.html deleted file mode 100644 index 21c9b278a..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/search.html +++ /dev/null @@ -1,87 +0,0 @@ - - -CodeMirror: Search/Replace Demo - - - - - - - - - - - - - -
-

Search/Replace Demo

-
- - - -

Demonstration of primitive search/replace functionality. The - keybindings (which can be overridden by custom keymaps) are:

-
-
Ctrl-F / Cmd-F
Start searching
-
Ctrl-G / Cmd-G
Find next
-
Shift-Ctrl-G / Shift-Cmd-G
Find previous
-
Shift-Ctrl-F / Cmd-Option-F
Replace
-
Shift-Ctrl-R / Shift-Cmd-Option-F
Replace all
-
-

Searching is enabled by - including addon/search/search.js - and addon/search/searchcursor.js. - For good-looking input dialogs, you also want to include - addon/dialog/dialog.js - and addon/dialog/dialog.css.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/spanaffectswrapping_shim.html b/ajax/libs/codemirror/3.24.0/package/demo/spanaffectswrapping_shim.html deleted file mode 100644 index e598221c0..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/spanaffectswrapping_shim.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Automatically derive odd wrapping behavior for your browser - - - - - -
-

Automatically derive odd wrapping behavior for your browser

- - -

This is a hack to automatically derive - a spanAffectsWrapping regexp for a browser. See the - comments above that variable - in lib/codemirror.js - for some more details.

- -
-

-
-    
-  
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/tern.html b/ajax/libs/codemirror/3.24.0/package/demo/tern.html deleted file mode 100644 index 6843c7f5e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/tern.html +++ /dev/null @@ -1,129 +0,0 @@ - - -CodeMirror: Tern Demo - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Tern Demo

-

- -

Demonstrates integration of Tern -and CodeMirror. The following keys are bound:

- -
-
Ctrl-Space
Autocomplete
-
Ctrl-I
Find type at cursor
-
Alt-.
Jump to definition (Alt-, to jump back)
-
Ctrl-Q
Rename variable
-
- -

Documentation is sparse for now. See the top of -the script for a rough API -overview.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/theme.html b/ajax/libs/codemirror/3.24.0/package/demo/theme.html deleted file mode 100644 index 29b55df2e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/theme.html +++ /dev/null @@ -1,125 +0,0 @@ - - -CodeMirror: Theme Demo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Theme Demo

- - -

Select a theme: -

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/trailingspace.html b/ajax/libs/codemirror/3.24.0/package/demo/trailingspace.html deleted file mode 100644 index c3e9c3763..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/trailingspace.html +++ /dev/null @@ -1,48 +0,0 @@ - - -CodeMirror: Trailing Whitespace Demo - - - - - - - - - -
-

Trailing Whitespace Demo

-
- - - -

Uses -the trailingspace -addon to highlight trailing whitespace.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/variableheight.html b/ajax/libs/codemirror/3.24.0/package/demo/variableheight.html deleted file mode 100644 index 98f2fd29d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/variableheight.html +++ /dev/null @@ -1,67 +0,0 @@ - - -CodeMirror: Variable Height Demo - - - - - - - - - - -
-

Variable Height Demo

-
- -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/vim.html b/ajax/libs/codemirror/3.24.0/package/demo/vim.html deleted file mode 100644 index 0918bce45..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/vim.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: Vim bindings demo - - - - - - - - - - - - - -
-

Vim bindings demo

-
- -
- -

The vim keybindings are enabled by -including keymap/vim.js and setting -the vimMode option to true. This will also -automatically change the keyMap option to "vim".

- -

Note that while the vim mode tries to emulate the most useful features of -vim as faithfully as possible, it does not strive to become a complete vim -implementation

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/visibletabs.html b/ajax/libs/codemirror/3.24.0/package/demo/visibletabs.html deleted file mode 100644 index 5a5a19aa0..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/visibletabs.html +++ /dev/null @@ -1,62 +0,0 @@ - - -CodeMirror: Visible tabs demo - - - - - - - - - -
-

Visible tabs demo

-
- -

Tabs inside the editor are spans with the -class cm-tab, and can be styled.

- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/widget.html b/ajax/libs/codemirror/3.24.0/package/demo/widget.html deleted file mode 100644 index 6c4685396..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/widget.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Inline Widget Demo - - - - - - - - - - -
-

Inline Widget Demo

- - -
- -

This demo runs JSHint over the code -in the editor (which is the script used on this page), and -inserts line widgets to -display the warnings that JSHint comes up with.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/demo/xmlcomplete.html b/ajax/libs/codemirror/3.24.0/package/demo/xmlcomplete.html deleted file mode 100644 index dea23adf8..000000000 --- a/ajax/libs/codemirror/3.24.0/package/demo/xmlcomplete.html +++ /dev/null @@ -1,120 +0,0 @@ - - -CodeMirror: XML Autocomplete Demo - - - - - - - - - - - - -
-

XML Autocomplete Demo

-
- -

Press ctrl-space, or type a '<' character to - activate autocompletion. This demo defines a simple schema that - guides completion. The schema can be customized—see - the manual.

- -

Development of the xml-hint addon was kindly - sponsored - by www.xperiment.mobi.

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/doc/activebookmark.js b/ajax/libs/codemirror/3.24.0/package/doc/activebookmark.js deleted file mode 100644 index 88c879cf4..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/activebookmark.js +++ /dev/null @@ -1,48 +0,0 @@ -// Kludge in HTML5 tag recognition in IE8 -document.createElement("section"); -document.createElement("article"); - -(function() { - var pending = false, prevVal = null; - - function updateSoon() { - if (!pending) { - pending = true; - setTimeout(update, 250); - } - } - - function update() { - pending = false; - var marks = document.getElementById("nav").getElementsByTagName("a"), found; - for (var i = 0; i < marks.length; ++i) { - var mark = marks[i], m; - if (mark.getAttribute("data-default")) { - if (found == null) found = i; - } else if (m = mark.href.match(/#(.*)/)) { - var ref = document.getElementById(m[1]); - if (ref && ref.getBoundingClientRect().top < 50) - found = i; - } - } - if (found != null && found != prevVal) { - prevVal = found; - var lis = document.getElementById("nav").getElementsByTagName("li"); - for (var i = 0; i < lis.length; ++i) lis[i].className = ""; - for (var i = 0; i < marks.length; ++i) { - if (found == i) { - marks[i].className = "active"; - for (var n = marks[i]; n; n = n.parentNode) - if (n.nodeName == "LI") n.className = "active"; - } else { - marks[i].className = ""; - } - } - } - } - - if (window.addEventListener) { - window.addEventListener("scroll", updateSoon); - window.addEventListener("load", updateSoon); - } -})(); diff --git a/ajax/libs/codemirror/3.24.0/package/doc/compress.html b/ajax/libs/codemirror/3.24.0/package/doc/compress.html deleted file mode 100644 index 7c32192eb..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/compress.html +++ /dev/null @@ -1,244 +0,0 @@ - - -CodeMirror: Compression Helper - - - - - -
- -

Script compression helper

- -

To optimize loading CodeMirror, especially when including a - bunch of different modes, it is recommended that you combine and - minify (and preferably also gzip) the scripts. This page makes - those first two steps very easy. Simply select the version and - scripts you need in the form below, and - click Compress to download the minified script - file.

- -
- -

Version:

- - - -

- with UglifyJS -

- -

Custom code to add to the compressed file:

-
- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/doc/docs.css b/ajax/libs/codemirror/3.24.0/package/doc/docs.css deleted file mode 100644 index 86e61d7b9..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/docs.css +++ /dev/null @@ -1,228 +0,0 @@ -@font-face { - font-family: 'Source Sans Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff'); -} - -body, html { margin: 0; padding: 0; height: 100%; } -section, article { display: block; padding: 0; } - -body { - background: #f8f8f8; - font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; - line-height: 1.5; -} - -p { margin-top: 0; } - -h2, h3 { - font-weight: normal; - margin-bottom: .7em; -} -h2 { font-size: 120%; } -h3 { font-size: 110%; } -article > h2:first-child, section:first-child > h2 { margin-top: 0; } - -a, a:visited, a:link, .quasilink { - color: #A21313; - text-decoration: none; -} - -em { - padding-right: 2px; -} - -.quasilink { - cursor: pointer; -} - -article { - max-width: 700px; - margin: 0 0 0 160px; - border-left: 2px solid #E30808; - border-right: 1px solid #ddd; - padding: 30px 50px 100px 50px; - background: white; - z-index: 2; - position: relative; - min-height: 100%; - box-sizing: border-box; - -moz-box-sizing: border-box; -} - -#nav { - position: fixed; - padding-top: 30px; - max-height: 100%; - overflow-y:scroll; - left: 0; right: none; - width: 160px; - padding-right: 350px; - text-align: right; - z-index: 1; -} - -@media screen and (min-width: 1000px) { - article { - margin: 0 auto; - } - #nav { - right: 50%; - width: auto; - } -} - -#nav ul { - display: block; - margin: 0; padding: 0; - margin-bottom: 32px; -} - -#nav li { - display: block; - margin-bottom: 4px; -} - -#nav li ul { - font-size: 80%; - margin-bottom: 0; - display: none; -} - -#nav li.active ul { - display: block; -} - -#nav li li a { - padding-right: 20px; -} - -#nav ul a { - color: black; - padding: 0 7px 1px 11px; -} - -#nav ul a.active, #nav ul a:hover { - border-bottom: 1px solid #E30808; - color: #E30808; -} - -#logo { - border: 0; - margin-right: 7px; - margin-bottom: 25px; -} - -section { - border-top: 1px solid #E30808; - margin: 1.5em 0; -} - -section.first { - border: none; - margin-top: 0; -} - -#demo { - position: relative; -} - -#demolist { - position: absolute; - right: 5px; - top: 5px; - z-index: 25; -} - -#bankinfo { - text-align: left; - display: none; - padding: 0 .5em; - position: absolute; - border: 2px solid #aaa; - border-radius: 5px; - background: #eee; - top: 10px; - left: 30px; -} - -#bankinfo_close { - position: absolute; - top: 0; right: 6px; - font-weight: bold; - cursor: pointer; -} - -.bigbutton { - cursor: pointer; - text-align: center; - padding: 0 1em; - display: inline-block; - color: white; - position: relative; - line-height: 1.9; - color: white !important; - background: #A21313; -} - -.bigbutton.right { - border-bottom-left-radius: 100px; - border-top-left-radius: 100px; -} - -.bigbutton.left { - border-bottom-right-radius: 100px; - border-top-right-radius: 100px; -} - -.bigbutton:hover { - background: #E30808; -} - -th { - text-decoration: underline; - font-weight: normal; - text-align: left; -} - -#features ul { - list-style: none; - margin: 0 0 1em; - padding: 0 0 0 1.2em; -} - -#features li:before { - content: "-"; - width: 1em; - display: inline-block; - padding: 0; - margin: 0; - margin-left: -1em; -} - -.rel { - margin-bottom: 0; -} -.rel-note { - margin-top: 0; - color: #555; -} - -pre { - padding-left: 15px; - border-left: 2px solid #ddd; -} - -code { - padding: 0 2px; -} - -strong { - text-decoration: underline; - font-weight: normal; -} - -.field { - border: 1px solid #A21313; -} diff --git a/ajax/libs/codemirror/3.24.0/package/doc/internals.html b/ajax/libs/codemirror/3.24.0/package/doc/internals.html deleted file mode 100644 index 3f1b7de86..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/internals.html +++ /dev/null @@ -1,503 +0,0 @@ - - -CodeMirror: Internals - - - - - - - -
- -

(Re-) Implementing A Syntax-Highlighting Editor in JavaScript

- -

- Topic: JavaScript, code editor implementation
- Author: Marijn Haverbeke
- Date: March 2nd 2011 (updated November 13th 2011) -

- -

Caution: this text was written briefly after -version 2 was initially written. It no longer (even including the -update at the bottom) fully represents the current implementation. I'm -leaving it here as a historic document. For more up-to-date -information, look at the entries -tagged cm-internals -on my blog.

- -

This is a followup to -my Brutal Odyssey to the -Dark Side of the DOM Tree story. That one describes the -mind-bending process of implementing (what would become) CodeMirror 1. -This one describes the internals of CodeMirror 2, a complete rewrite -and rethink of the old code base. I wanted to give this piece another -Hunter Thompson copycat subtitle, but somehow that would be out of -place—the process this time around was one of straightforward -engineering, requiring no serious mind-bending whatsoever.

- -

So, what is wrong with CodeMirror 1? I'd estimate, by mailing list -activity and general search-engine presence, that it has been -integrated into about a thousand systems by now. The most prominent -one, since a few weeks, -being Google -code's project hosting. It works, and it's being used widely.

- -

Still, I did not start replacing it because I was bored. CodeMirror -1 was heavily reliant on designMode -or contentEditable (depending on the browser). Neither of -these are well specified (HTML5 tries -to specify -their basics), and, more importantly, they tend to be one of the more -obscure and buggy areas of browser functionality—CodeMirror, by using -this functionality in a non-typical way, was constantly running up -against browser bugs. WebKit wouldn't show an empty line at the end of -the document, and in some releases would suddenly get unbearably slow. -Firefox would show the cursor in the wrong place. Internet Explorer -would insist on linkifying everything that looked like a URL or email -address, a behaviour that can't be turned off. Some bugs I managed to -work around (which was often a frustrating, painful process), others, -such as the Firefox cursor placement, I gave up on, and had to tell -user after user that they were known problems, but not something I -could help.

- -

Also, there is the fact that designMode (which seemed -to be less buggy than contentEditable in Webkit and -Firefox, and was thus used by CodeMirror 1 in those browsers) requires -a frame. Frames are another tricky area. It takes some effort to -prevent getting tripped up by domain restrictions, they don't -initialize synchronously, behave strangely in response to the back -button, and, on several browsers, can't be moved around the DOM -without having them re-initialize. They did provide a very nice way to -namespace the library, though—CodeMirror 1 could freely pollute the -namespace inside the frame.

- -

Finally, working with an editable document means working with -selection in arbitrary DOM structures. Internet Explorer (8 and -before) has an utterly different (and awkward) selection API than all -of the other browsers, and even among the different implementations of -document.selection, details about how exactly a selection -is represented vary quite a bit. Add to that the fact that Opera's -selection support tended to be very buggy until recently, and you can -imagine why CodeMirror 1 contains 700 lines of selection-handling -code.

- -

And that brings us to the main issue with the CodeMirror 1 -code base: The proportion of browser-bug-workarounds to real -application code was getting dangerously high. By building on top of a -few dodgy features, I put the system in a vulnerable position—any -incompatibility and bugginess in these features, I had to paper over -with my own code. Not only did I have to do some serious stunt-work to -get it to work on older browsers (as detailed in the -previous story), things -also kept breaking in newly released versions, requiring me to come up -with new scary hacks in order to keep up. This was starting -to lose its appeal.

- -
-

General Approach

- -

What CodeMirror 2 does is try to sidestep most of the hairy hacks -that came up in version 1. I owe a lot to the -ACE editor for inspiration on how to -approach this.

- -

I absolutely did not want to be completely reliant on key events to -generate my input. Every JavaScript programmer knows that key event -information is horrible and incomplete. Some people (most awesomely -Mihai Bazon with Ymacs) have been able -to build more or less functioning editors by directly reading key -events, but it takes a lot of work (the kind of never-ending, fragile -work I described earlier), and will never be able to properly support -things like multi-keystoke international character -input. [see below for caveat]

- -

So what I do is focus a hidden textarea, and let the browser -believe that the user is typing into that. What we show to the user is -a DOM structure we built to represent his document. If this is updated -quickly enough, and shows some kind of believable cursor, it feels -like a real text-input control.

- -

Another big win is that this DOM representation does not have to -span the whole document. Some CodeMirror 1 users insisted that they -needed to put a 30 thousand line XML document into CodeMirror. Putting -all that into the DOM takes a while, especially since, for some -reason, an editable DOM tree is slower than a normal one on most -browsers. If we have full control over what we show, we must only -ensure that the visible part of the document has been added, and can -do the rest only when needed. (Fortunately, the onscroll -event works almost the same on all browsers, and lends itself well to -displaying things only as they are scrolled into view.)

-
-
-

Input

- -

ACE uses its hidden textarea only as a text input shim, and does -all cursor movement and things like text deletion itself by directly -handling key events. CodeMirror's way is to let the browser do its -thing as much as possible, and not, for example, define its own set of -key bindings. One way to do this would have been to have the whole -document inside the hidden textarea, and after each key event update -the display DOM to reflect what's in that textarea.

- -

That'd be simple, but it is not realistic. For even medium-sized -document the editor would be constantly munging huge strings, and get -terribly slow. What CodeMirror 2 does is put the current selection, -along with an extra line on the top and on the bottom, into the -textarea.

- -

This means that the arrow keys (and their ctrl-variations), home, -end, etcetera, do not have to be handled specially. We just read the -cursor position in the textarea, and update our cursor to match it. -Also, copy and paste work pretty much for free, and people get their -native key bindings, without any special work on my part. For example, -I have emacs key bindings configured for Chrome and Firefox. There is -no way for a script to detect this. [no longer the case]

- -

Of course, since only a small part of the document sits in the -textarea, keys like page up and ctrl-end won't do the right thing. -CodeMirror is catching those events and handling them itself.

-
-
-

Selection

- -

Getting and setting the selection range of a textarea in modern -browsers is trivial—you just use the selectionStart -and selectionEnd properties. On IE you have to do some -insane stuff with temporary ranges and compensating for the fact that -moving the selection by a 'character' will treat \r\n as a single -character, but even there it is possible to build functions that -reliably set and get the selection range.

- -

But consider this typical case: When I'm somewhere in my document, -press shift, and press the up arrow, something gets selected. Then, if -I, still holding shift, press the up arrow again, the top of my -selection is adjusted. The selection remembers where its head -and its anchor are, and moves the head when we shift-move. -This is a generally accepted property of selections, and done right by -every editing component built in the past twenty years.

- -

But not something that the browser selection APIs expose.

- -

Great. So when someone creates an 'upside-down' selection, the next -time CodeMirror has to update the textarea, it'll re-create the -selection as an 'upside-up' selection, with the anchor at the top, and -the next cursor motion will behave in an unexpected way—our second -up-arrow press in the example above will not do anything, since it is -interpreted in exactly the same way as the first.

- -

No problem. We'll just, ehm, detect that the selection is -upside-down (you can tell by the way it was created), and then, when -an upside-down selection is present, and a cursor-moving key is -pressed in combination with shift, we quickly collapse the selection -in the textarea to its start, allow the key to take effect, and then -combine its new head with its old anchor to get the real -selection.

- -

In short, scary hacks could not be avoided entirely in CodeMirror -2.

- -

And, the observant reader might ask, how do you even know that a -key combo is a cursor-moving combo, if you claim you support any -native key bindings? Well, we don't, but we can learn. The editor -keeps a set known cursor-movement combos (initialized to the -predictable defaults), and updates this set when it observes that -pressing a certain key had (only) the effect of moving the cursor. -This, of course, doesn't work if the first time the key is used was -for extending an inverted selection, but it works most of the -time.

-
-
-

Intelligent Updating

- -

One thing that always comes up when you have a complicated internal -state that's reflected in some user-visible external representation -(in this case, the displayed code and the textarea's content) is -keeping the two in sync. The naive way is to just update the display -every time you change your state, but this is not only error prone -(you'll forget), it also easily leads to duplicate work on big, -composite operations. Then you start passing around flags indicating -whether the display should be updated in an attempt to be efficient -again and, well, at that point you might as well give up completely.

- -

I did go down that road, but then switched to a much simpler model: -simply keep track of all the things that have been changed during an -action, and then, only at the end, use this information to update the -user-visible display.

- -

CodeMirror uses a concept of operations, which start by -calling a specific set-up function that clears the state and end by -calling another function that reads this state and does the required -updating. Most event handlers, and all the user-visible methods that -change state are wrapped like this. There's a method -called operation that accepts a function, and returns -another function that wraps the given function as an operation.

- -

It's trivial to extend this (as CodeMirror does) to detect nesting, -and, when an operation is started inside an operation, simply -increment the nesting count, and only do the updating when this count -reaches zero again.

- -

If we have a set of changed ranges and know the currently shown -range, we can (with some awkward code to deal with the fact that -changes can add and remove lines, so we're dealing with a changing -coordinate system) construct a map of the ranges that were left -intact. We can then compare this map with the part of the document -that's currently visible (based on scroll offset and editor height) to -determine whether something needs to be updated.

- -

CodeMirror uses two update algorithms—a full refresh, where it just -discards the whole part of the DOM that contains the edited text and -rebuilds it, and a patch algorithm, where it uses the information -about changed and intact ranges to update only the out-of-date parts -of the DOM. When more than 30 percent (which is the current heuristic, -might change) of the lines need to be updated, the full refresh is -chosen (since it's faster to do than painstakingly finding and -updating all the changed lines), in the other case it does the -patching (so that, if you scroll a line or select another character, -the whole screen doesn't have to be -re-rendered). [the full-refresh -algorithm was dropped, it wasn't really faster than the patching -one]

- -

All updating uses innerHTML rather than direct DOM -manipulation, since that still seems to be by far the fastest way to -build documents. There's a per-line function that combines the -highlighting, marking, and -selection info for that line into a snippet of HTML. The patch updater -uses this to reset individual lines, the refresh updater builds an -HTML chunk for the whole visible document at once, and then uses a -single innerHTML update to do the refresh.

-
-
-

Parsers can be Simple

- -

When I wrote CodeMirror 1, I -thought interruptable -parsers were a hugely scary and complicated thing, and I used a -bunch of heavyweight abstractions to keep this supposed complexity -under control: parsers -were iterators -that consumed input from another iterator, and used funny -closure-resetting tricks to copy and resume themselves.

- -

This made for a rather nice system, in that parsers formed strictly -separate modules, and could be composed in predictable ways. -Unfortunately, it was quite slow (stacking three or four iterators on -top of each other), and extremely intimidating to people not used to a -functional programming style.

- -

With a few small changes, however, we can keep all those -advantages, but simplify the API and make the whole thing less -indirect and inefficient. CodeMirror -2's mode API uses explicit state -objects, and makes the parser/tokenizer a function that simply takes a -state and a character stream abstraction, advances the stream one -token, and returns the way the token should be styled. This state may -be copied, optionally in a mode-defined way, in order to be able to -continue a parse at a given point. Even someone who's never touched a -lambda in his life can understand this approach. Additionally, far -fewer objects are allocated in the course of parsing now.

- -

The biggest speedup comes from the fact that the parsing no longer -has to touch the DOM though. In CodeMirror 1, on an older browser, you -could see the parser work its way through the document, -managing some twenty lines in each 50-millisecond time slice it got. It -was reading its input from the DOM, and updating the DOM as it went -along, which any experienced JavaScript programmer will immediately -spot as a recipe for slowness. In CodeMirror 2, the parser usually -finishes the whole document in a single 100-millisecond time slice—it -manages some 1500 lines during that time on Chrome. All it has to do -is munge strings, so there is no real reason for it to be slow -anymore.

-
-
-

What Gives?

- -

Given all this, what can you expect from CodeMirror 2?

- -
    - -
  • Small. the base library is -some 45k when minified -now, 17k when gzipped. It's smaller than -its own logo.
  • - -
  • Lightweight. CodeMirror 2 initializes very -quickly, and does almost no work when it is not focused. This means -you can treat it almost like a textarea, have multiple instances on a -page without trouble.
  • - -
  • Huge document support. Since highlighting is -really fast, and no DOM structure is being built for non-visible -content, you don't have to worry about locking up your browser when a -user enters a megabyte-sized document.
  • - -
  • Extended API. Some things kept coming up in the -mailing list, such as marking pieces of text or lines, which were -extremely hard to do with CodeMirror 1. The new version has proper -support for these built in.
  • - -
  • Tab support. Tabs inside editable documents were, -for some reason, a no-go. At least six different people announced they -were going to add tab support to CodeMirror 1, none survived (I mean, -none delivered a working version). CodeMirror 2 no longer removes tabs -from your document.
  • - -
  • Sane styling. iframe nodes aren't -really known for respecting document flow. Now that an editor instance -is a plain div element, it is much easier to size it to -fit the surrounding elements. You don't even have to make it scroll if -you do not want to.
  • - -
- -

On the downside, a CodeMirror 2 instance is not a native -editable component. Though it does its best to emulate such a -component as much as possible, there is functionality that browsers -just do not allow us to hook into. Doing select-all from the context -menu, for example, is not currently detected by CodeMirror.

- -

[Updates from November 13th 2011] Recently, I've made -some changes to the codebase that cause some of the text above to no -longer be current. I've left the text intact, but added markers at the -passages that are now inaccurate. The new situation is described -below.

-
-
-

Content Representation

- -

The original implementation of CodeMirror 2 represented the -document as a flat array of line objects. This worked well—splicing -arrays will require the part of the array after the splice to be -moved, but this is basically just a simple memmove of a -bunch of pointers, so it is cheap even for huge documents.

- -

However, I recently added line wrapping and code folding (line -collapsing, basically). Once lines start taking up a non-constant -amount of vertical space, looking up a line by vertical position -(which is needed when someone clicks the document, and to determine -the visible part of the document during scrolling) can only be done -with a linear scan through the whole array, summing up line heights as -you go. Seeing how I've been going out of my way to make big documents -fast, this is not acceptable.

- -

The new representation is based on a B-tree. The leaves of the tree -contain arrays of line objects, with a fixed minimum and maximum size, -and the non-leaf nodes simply hold arrays of child nodes. Each node -stores both the amount of lines that live below them and the vertical -space taken up by these lines. This allows the tree to be indexed both -by line number and by vertical position, and all access has -logarithmic complexity in relation to the document size.

- -

I gave line objects and tree nodes parent pointers, to the node -above them. When a line has to update its height, it can simply walk -these pointers to the top of the tree, adding or subtracting the -difference in height from each node it encounters. The parent pointers -also make it cheaper (in complexity terms, the difference is probably -tiny in normal-sized documents) to find the current line number when -given a line object. In the old approach, the whole document array had -to be searched. Now, we can just walk up the tree and count the sizes -of the nodes coming before us at each level.

- -

I chose B-trees, not regular binary trees, mostly because they -allow for very fast bulk insertions and deletions. When there is a big -change to a document, it typically involves adding, deleting, or -replacing a chunk of subsequent lines. In a regular balanced tree, all -these inserts or deletes would have to be done separately, which could -be really expensive. In a B-tree, to insert a chunk, you just walk -down the tree once to find where it should go, insert them all in one -shot, and then break up the node if needed. This breaking up might -involve breaking up nodes further up, but only requires a single pass -back up the tree. For deletion, I'm somewhat lax in keeping things -balanced—I just collapse nodes into a leaf when their child count goes -below a given number. This means that there are some weird editing -patterns that may result in a seriously unbalanced tree, but even such -an unbalanced tree will perform well, unless you spend a day making -strangely repeating edits to a really big document.

-
-
-

Keymaps

- -

Above, I claimed that directly catching key -events for things like cursor movement is impractical because it -requires some browser-specific kludges. I then proceeded to explain -some awful hacks that were needed to make it -possible for the selection changes to be detected through the -textarea. In fact, the second hack is about as bad as the first.

- -

On top of that, in the presence of user-configurable tab sizes and -collapsed and wrapped lines, lining up cursor movement in the textarea -with what's visible on the screen becomes a nightmare. Thus, I've -decided to move to a model where the textarea's selection is no longer -depended on.

- -

So I moved to a model where all cursor movement is handled by my -own code. This adds support for a goal column, proper interaction of -cursor movement with collapsed lines, and makes it possible for -vertical movement to move through wrapped lines properly, instead of -just treating them like non-wrapped lines.

- -

The key event handlers now translate the key event into a string, -something like Ctrl-Home or Shift-Cmd-R, and -use that string to look up an action to perform. To make keybinding -customizable, this lookup goes through -a table, using a scheme that -allows such tables to be chained together (for example, the default -Mac bindings fall through to a table named 'emacsy', which defines -basic Emacs-style bindings like Ctrl-F, and which is also -used by the custom Emacs bindings).

- -

A new -option extraKeys -allows ad-hoc keybindings to be defined in a much nicer way than what -was possible with the -old onKeyEvent -callback. You simply provide an object mapping key identifiers to -functions, instead of painstakingly looking at raw key events.

- -

Built-in commands map to strings, rather than functions, for -example "goLineUp" is the default action bound to the up -arrow key. This allows new keymaps to refer to them without -duplicating any code. New commands can be defined by assigning to -the CodeMirror.commands object, which maps such commands -to functions.

- -

The hidden textarea now only holds the current selection, with no -extra characters around it. This has a nice advantage: polling for -input becomes much, much faster. If there's a big selection, this text -does not have to be read from the textarea every time—when we poll, -just noticing that something is still selected is enough to tell us -that no new text was typed.

- -

The reason that cheap polling is important is that many browsers do -not fire useful events on IME (input method engine) input, which is -the thing where people inputting a language like Japanese or Chinese -use multiple keystrokes to create a character or sequence of -characters. Most modern browsers fire input when the -composing is finished, but many don't fire anything when the character -is updated during composition. So we poll, whenever the -editor is focused, to provide immediate updates of the display.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/doc/logo.png b/ajax/libs/codemirror/3.24.0/package/doc/logo.png deleted file mode 100644 index 2334f5e0999358985862f477ce812805dd66d08d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12003 zcmXY11yof{7riu6(%sV1-617NcZYO$*8@Qs1nGDnh)8#LBi&EBq@+t4{`;-MIIB46b%3XOojI{8sO(w@bv{18GOfZ({BSm5Ix>0XrY2XfvA>I z;P0A!N$TKQ;*p#EPEwcD!dFKm%_M0u?{`X3 z6(`uSm^yzT9}IOPfk~oZyGcEAQRn9$F@@DegwxZ6JI*V-r~crho4ZamPa(XTi<#`n zcpe13)PfmLc6i;dc}%Vn<9vJjiEFU9sOV|dj5DsXq(nWop!xjjV73ZJy`;+T(ALaY zA;bUrFCQZ-t7C#n@hog^&Zx!nV8)L&CSWhu$C;eRI*t&)q7qlS+#MffVPRRypSPb4 z3k&n)&sH889W^x2(fQXQTYK8jr9&H7PSYhxKAdzzu!byn&{Hf&J*{ zXh3;&wX2WA_toj?gYaKwoEW5nt{X&o!S{BP)z#GueY#p&8)KO~!y_Z5Y%DCLiV6zR z@87>S6ASnkZcyROTRCpsNA+?$6!!FRBaxe$dhO0qM`^sKEAuqbdJ4qA`WY+rbVpRSm@dQ;OMs6rP+Tr%>GKanq6H^ zN~~A-oUUQ+3VH5N6{28~@2~4v{bf?S%L-jUv{2%)8cDHq3DYt*j=xz8s0vh;8;lr! zeEg(YRwj|BYtZ_OZ;VAMqoQ`%G@a#bg=N$FK=j8cXnFZXi-?anWmeA0Qx_q790{L& zio6G3;H|5e1#4zh?NYUGaH7gI_x0a-2OVGE+fQlxl{7Tz@yPTFA|JpoX zq!%t-?yYA~VV}iYHp$!hbsjwz6wtz49WXxADJ08%h&xut8Gzrg8Z79^_}1+#ack~- z`_qJ(*+aL=B$pcXopHOz-o$1!BXoFTe0=;Z3(I}|&!7A2GIUL<2T!P-lyF8I|2@G! zFbJk5#>UDgU#v0-*^Tsaa&jJ#$wP7u>4DXU>%*Hqs8~Sx$(??Mj{nW7PZ=IA?(@N+ z|2fiKPUzud^-2`Zn~CNSEm~T2e7oN8S3+D|Tt1Cbouz;N{7DUYSYBscy9nM0MTr5f z&b^-MA8yY05MX!e5%QFNf7&00SlQT$LJ?4`;iCdbHgsg=60Qg(jH{@WWo~_LPNb+% z-`RRx^2y68k444AM90Pk*gikr$)4O*>DLV+Z}6MKR0A|4wYy0y3_46+TqmJopNv+W z_{mN>4=Z!t$R{Y#6#+CPANGQddl6n zWlo#DXp3R({ctL&#mYn24@XnSmd25b%Zg{5Qopp+WzzD|&u4ou-lgcfQr^v;M5Ksc zR6>Hz!S#J+T+OPCXGxI5pwC9&cy|Le8{6>s!Xw9!txzw5+>l7+>e7z14n~_ z`i8ofFHxwdsOzyaKR+DUuFT1aNb*D9&3G@Vofa$IQ&^Kw`1f zSVgd2*cZPWC%65l>v4ypEHCKaBC1c9Y%F1FV4M3+S(}H)%ciGc$?Ww`sB7|fc#RS{ zyy?Wa8u!fYD|-c8s{}H9Z0zce*4BFyAzshb6^}jptkF@$+!I19Go8VawYV665sSXh zaNyo=cgQ&He3;<(IazrT0pBiRx))f0=}jG5k<=&T<0bzKwGuuohB_)UKpQ~^v6f=k|K8J5tuggFT1*T1I+kIF-iP`nszVD3By~!Z!v8FQc^vGS65es^z`)C zDU6Mw5v2NB|Uw+qiKC2c*I_;#h^GA&LUcL zDCqB1y5F-;-G>jbs+oh6%}~64w+@B0uTobCLzmmYks1Fo6Ks0L{}avk&$eg?XmE&l z*!H*sUK7t_l{zjTllyJ(Oc^B~a`@%WaG0?7b47e6P8KSHRkif>qm$mq2Va5+qsl2S8;`;CR>W7fDlyB@$Y>wqQoYI9f5M(Z ziwwJ3q}!f?r9^9J*tu$x7#(ZDofKMJtMG{KCSpHWQ{fh=h-O_z<* zmxa$43|+M4WMm#EV2^%&)AB*%hKA~q`@16}Bb_T90Zpr`LE~9` zL||2I5@3u6b4jnY$IK`xWzHVCAEP6f5U?c1C={PL_}lPqZz4A!2t-qYN@pu8E2g(^ zMP?1|9>|2l;VU&tN(EfjjJSdyZ<&e>t*seKV`BbQ;f7BGod}TYnwrpgZEc_5NB^Ac zp;V#yHmC;d5HFgc^?W{Mc^vv=MrD|?QGmf!VWB{vm z+#v}L&Y(jBzoz*nfh1QjcY$Cw9R;dooMpTmBVGvr5j??nX?l(PW$(}FOwot+I1(O) z(lMv#}pI^AVvAQ=~_9o^z3wjUy{N}-}NL(Esbstv4?Yd$vm%`Ij zUQP~_@9gN(nSC-&yO}$OH?kCUF(>zde%-<8&lu+No-2o~QyOY%p$%%x2HaqAqW9+I zy4BX!KHr`Ctd-b!`h!KSmyp9m6yy|R&ev#{e1R49d~!keSAHTQBFoazV9_nAudjby zNk85YHnmy~OQfYO#|@{c826CV(#kq~7`GVmFK?<{bmX<2$~W$;Twh=aIo<6oEGQ5q zzd2cT5D9sHOot`s_aS@X07~@q5++mu&SC(Gm9HTJlLZT@kocMWhOyvh%2w zo=w=Qk(=B3MbU?J!nQV-_0Enz7dxXSH>DMEF{Cw6uC?qukr~X-p(J6PUJWWlb=<`nwUpw-%wY7}=&=*$u_i@G=I7K7f zG{YD9k_BwDA3kuv0UQc-(Y6R$rE8*U=Tg4DDLNI<-l$G`Gg^dyBc$UL8d_TXkV#-b z?bp%2^{~Ckadwt_5&+)bo`Hv&f7MK{EP2Op*m)hP!2m@8ZC_JUv)%z#`4+^!s%7rW zi&2i)#l^+9OH~ZZD8Z}TAf$I(SA{&iozVVLuJab$-0Zk#WY`CP5npxtcZlmH?<5Nm z5D@Ao%Y9)b)0QdWo(A4)z-yNI2qL`#x_@(N+8sEz{MZd=9j!5_;8#rE;i+RyL+^Lf z#vPKya~&CRGt5;VcGkti?m7A=Sxlzt8RHvVjEssjeeicY!nkx??0**axkMS$UK$4A;)x_0-R= zsX8Y+$dl=&K`!onpVhQL*EOH%3q9R)`p`J=@f#>i&@l%*49cHgfqcB-#F>1EhLx3d zhUl@L;IT2gti1d&5KJh_!q(GtgQKQ&D@@?j0>M5=AG*J4zHybh%pp^ zYQ^FXGl=i#Y?6JshevSvl>-R$^5|9~kTjL+(r zMOF<4Wyk;SHDmq!{IF%Yid!B%5pSJFQ}Xg&{)Hi-pQtD*lCD>ob_w6~_V$tj6Gb)K zJ->atbDeo{&X-0;TIuWPMqlx;rFoGEuYMvQDgq0R$}l+$z57{Pcr}*W;&3nKBLh%A zbNH3S)uKVJ?tJs{v6K%7C+WM!^|lZ@akm=)4AJA6)$3>HjllQ328FyQmIFPA~T~1jiC!#^n2eT7T2LGDf!k*K6jrl#$4Yz81 zS-pR)4P5-a#4eDOaS7#P5XxC2wjNI~>q z$xh+RGKIHX49dvu8nlf|k6z%`Kfwh0e}@ha4^xXwy0~EqwtcrOK74pQI$GjG?xSqb z3D6eUzMK4Iy-a`E9`SWY5YyuNnqPtCvz$k;in)2sqAhDWJu_iLgAm`hZ}WQ<3;iGn zw|ecfq@t0KkZ`?`i_;q*CR4h8L8Kr8MGdbE9)r>u`3TN*xqjURP=B{jwD3JVJX|&s zi{gT5bXHX&_jP_`)tv*|#i(-v*C1(D8#ie@3*aP-w)88*K7N|`HIqYj7TT$B>K0qO zTp`zAPfBzuY&<+X#BPs^noqqPZ9=pK&rc7!OOE`Bg+QCvAt69*&t*ZhRal6CV42zD zyjKwyF;T0>9#{_ZX*z$TFOJ?Y9-K4yM8h8S6P2ERfg3U>XA$1mx+GrLzG9I`23W$e z4m;;zZ8Z3H1aB=>SAVKCa7vy33uu~~yL~oUck)(H2-PnRh;dsXz)WJ0u6j{=8#C}q zc(pt?u7c!)B??ey5)zQ#gMF%;@$YC+6Km+ZhYiHEQ3)`s(Sv63*i6XkS9ZN+5*8Ll zm7Mz^!%b&rT|qbg^CRnL;)gPQY>ngEz%ngEL&nh1u(Re7YxL5joq*Eo`%bu|q!Rlw zFDO2?8j*ET59d-jY*MdcHUh4@Plg{p27u5pr@+J0S`8|VIp={Jj{$qS7bExN)u3Ah zA~u{9;)?!TROFAWKh>}?ChAGlF^1f5PFmN&k~Eq?DRz&8qd%pv(bNlW#jdAim#(0f zj+?bIo3q)&>#V3KR0IH9olme5g2I5EH2kYpk#@wL-5mj781>HF3*ahX!B#edu=1o? zu&`d~#c!a&AC)0(G9+v#{I>F=CH`ueAc97nK|K0Z$e9Oc07hXiMQ2N267%bV1kfWO z;Ios}NKS)jh8j4DWzTK)MV{XuR=s%sohx~<%U!y_yEU+LhyoBno8_?{locrpRKd5Q zxVX5`3L;9gy#9Vf{*;A_ei=5L%^gCOx+6eKCOibeUe{;ufe}yz-aw84Evkd-!Blm1 z)ev~w;hpcT(}i+R@0~M1oJRsWf{Z6C?#BbiC8g<5d#O4fFFqt{Qlp`xmzZ`1A9U_k z(et`(^()=DXjg7n7&Md9JZ$I~ z73DQ$y^gLfm50yiFo-+RQ3=j#?RV&Pi-C))F8xtBNs$oV;fwbSqlJR{33U3Dy4u+pr=V2$xC=ff^bG(wP?XU{MIy zL%p8+qw!|I5`wk2yUXtIsq~WMQ6~e~`19*)BD+!Z*^||1+Pt9-xAj;?)a~u90{It4 zj};v30j@zsA%)T{$i2<`5%;v1{Rtt$Q2~s73!CyBE`BJnNDmw%@VJ3d+PFBO*o|!6 zl;_>L==WUCI*MnRfEUfAxYdk1_}d!5Wxm$!i9&;e{JNk~D9mKX$xRVr54O^pLk*9N zl#??#-tj(OqF05A-nDHHB_=XPvX#zu!xRlQQ_|8JX*f8lpce+3n$ne==@91Q-P?8;g^pQ~0aQ~^C;fN@ld-Bh2_Q$JA=g`p5=7*Cu3lfW`=>7D6yCrNO zNhQZwbmY&5y>X@tJnJF;)Z?nEX_pZ{xZ(M!$G1YXoSPWA0ylh}m(aR_dL_r16T`@Y zchCm4SF1QcNonjc;G~6dSS--Ws)#_cxF%3!6UK%I;1dz$iMVaaXc!n6i1l=VLn4?4 z95)PY2%>jKV@PEP8{!KHuKQ7ESqh0uSDj)NeB-W8;^Nn*T^c|T;L1<7)c+$`se>%Y zxj>bC)lgD@B?^o&GYchun-xRbpa#kp4nA6L=s@?n(vSYx0uVWmlsW^HNme$ok2+X0 zfCa1n$x6$)fzy+;F6hagjSH+B(H1-|RI#o1Rv9t?f*^BR1@-c2V^!yU>C(J$+5E?i z?$8bri)#alw-)QoonOZpO6iylk)7c!P^d?RX=^7M^i*&xr1~>(MDtkiu0O`nFKL%z z_Wwq-dBl+7466~|tUqs8^GOh#EDqbo1zlY3p-Xb$%Qj~$DCvr!ffv90pDqt(i|rn7 z&xb%D6D_&69}d~L>6MY02g!Z*?Vqoz&O)9)JC}GsnQ;R0z7RJr%~AIb%|+h?^dw*L zsPrA8*b zkJ`kgu9&LRguPD(AqjZHqLdhSR0KP8A>%ZYH2yv^qNoHF6}p`ICf!9p6nc}3^49^xnd@2gZZfYC>{|GYD1V0h}^TuW8(JQ_XCxzhk zaUpe3EvV`2wxk{JX1nMV|M)Rs9mnVUtxmrxuZ4xhUc=w=`w#(%bw}`z!+_Qv&M8Au z5L1Pk#4F|wob?F^cUzV)CEva44I79hVzlLjqRX-o#tuEVOdxhqjSD4#whU}%G(9o! zpeS85t%cpRvwd%|&gKPk;{+qudC4($ho^WQBwR|xno@;#(7Hv2iiLwl+#xaP2os?jy21@=-5cLP-)zD@N~0Y z<>|@j1(LeH6lP61&5f{HeNR($O`JwRL}@hoTWU~` z*K*Ny%J%V4V%>kV??;2ny7hWF1Z{-dXFo$wd6w%16GAxIS3c!-8XSH-FJ(N4M~tO9Oj!c zPH#1xlJdB{7tDMBh_XHQq%BiQAt5Iq820V72mL=fMg=Md%a*)(Yr{5!!UL~E5Zp2{ zGW61YOiU;T6RAR+LE`ix4whYF_uXmzO^2dm($p10Sh@bTTf;24gv@+=UL09mtq#g) zuU?V34^j9SeX(kxlmI;wFjDmbfySoCvJ|CO?xADtj?8~o+XTcP&-!SBRPhddCASj4HjJvMi; zT{`t?W40J6DRc2DtapAI$qbIy$<21jP?8 zuH@C3Uafv+<*d?GlcJ0+ zsf_)HIzgnRsnvh0v$=Ul;^on!kb2IL7*NMQe||XCbzZ7JINaLW65FTU|I&*HfU=Dw zu0{-G@BWI|;o0fz##w^SE6u{&6Pl`G1bn_{8v#^7SJS-S7k?<;rs@c4rR^-Glk0ja z_;u5fT#eJ*pX+ z*xlWw6!F*{TQ4gs^J%c7za;}bod)EH$jJ3ByIBS@KPhu_nt0Gc+hZ?ui+<4h1^VFv zmAaL|-)FD&D`1Q`I67#(_^@hgspf5dY9?mpgT8dr;Ki*SNO`0UJO??Oa-QV9onk`lhxa-$7Z(6onZS|T5TOXpSDH*qkBt1PG z>@iUpJM?0dlI;c+(3K{abv95DjEQ(3=@r_6?L{?v`@gb)oGC1_>Zi1k$!}s}i^2bV z(ctp|qOZlu*}FBRH8hW)tMa?eW-=ALvsTXJuNsre@^;6viqv;upQJy%d82JtQX=() zf`!qxlV&)#=B#k``FOc$*~E7{f5=J{w&f)q%NF23mV9AA@Zt9KG)F^2 zMYUZJV?K@s6)4bPK(Xr}zC=c0kP)@Nb+X!~3KjMmftAno*f(s=>za;(2AfFG_=kW( z9;S_V8X7b5Qc_a)V9@sC$prqnuj9;6`uv?{f6 z;rrCo6i%YVvu|jm&dT8JQQc%ICu_M_gCMZ@1quz0ULpq5xb`*3rig%=PWC2=FW?fsReb;6*LxyIh-flT zLbW13CI-#_=^8ewp`jrTmw)Z0{}dtI4!;I2%P-Kxekqzg_^gt_`R(CovF^?G_I4F> z#b`PQ*onc^2IVjkxLs_}(9m>1miOGHW8GrW2b)N_;G9S<#A5}Dk79E>Fmr- z&&c?Ki-W^O02zc?o$G>K-(v$kYVV`pHEhrTu=ir4C@n3`_>dJ6!U$GbXi9SONAZAv ztPS`&WvR%Rr1db^E9QHS#$P$px*@5YALC~@5TYLl?wLVEF?uBaIWmdSN=8% z=ruQBv7N}~cQPn7IepS&r0pH$=*r0kJJg}GD_xD8MfKPw@UOUzzy*y)q>Vp`4jWG`QU#fM>++<%S>h)>5~13iz-l6b~mP+FGtb z=S*R*znx%1yx$l7vL8F0%Nvv-m37vYv&KrK#1q%>7Fk# z+ABED2Bycr541o(|u0!!Q7-Tl*Q;LGz9 zf)l@?McL7bXZ;3dFDohrq~w+OF2XH-cSyEOjkF8BE*wN3`yHI)z&yhvAHb0zQ*&|^ zQb%nI*N(QK0yr#ZPBuy^ySde{D&YFAd63+JPPCq~va)m&m6nv9!U@Wm_Zz=B1Zr(M*BLTyRFDHU^A*!g$INFUT_n3S1^he@0y=;*`eOz76`8Xe#b2|G!-=|}7XbxJ zl*eVQ-QA~4Rs62M)p4=b3*4^vwW0fl>5q;Db+3BfgiOc^(2 z3!E%mx;p9=L^EQD6fgpi!=Hh-&L%g>Mxw#)Mg-o#p#s6k)dO@f`qom_h0)W+`q;c` z2A{qG_W<^{z*{y3^_11VGObd|uMEl;wp<`q{dk3rez@>n2MI`kzm3<&o>40B?M3J4 z0e(mcnbX(dKpy~N)cnCe?sZ{(99Z2haDTv=cJ(=7;~Q6qK&%+lMI8wd-#}`B3+005 zQJfQG;07)VZr#AqPI%rwu<3y5hYCpI6!a51WqkhF8tTI`ogt3+Vy|4U}3P}R5ge4~p;F8m!ob_kM5 z?+OAn@rZ2&*XmytAmo#~;T^I-*Jc8DkR4%oTRziMrSVok!X6;sd3*H8`@u)6wmri;U1B@iR-9S;C>@fuWa7np>+HCt&@CZ zqICW~h1pB0&b3pV7bJ-y*q?h-`K3M7?l9gc#K8h1w;!(0k>9fAGzV ztf)<3wv;&p>ZggdO6aF$&rF9Y7x*r)qPFFG65xG{^UW0^(Dz@LbwZf1r5GS~1OIluSOm4XN4J?;eYrPSeEyA-d2nS`+b(Os7J z3AYWvb1@E~weVKD$kwuvm~ue|(#{(o=Bb==n9F<*O(9tnaSU@}hv`%V>aqH$tcFo> znk|!L)NA?{K0m|mc`k|?E~fPYFGV7yjoJ>b{lxcaMfnT<4_P-P$cv!Kx^4adQp!b! z5z;HQ@LzU0?F$wWkqBziN&g7e-~|!?nkK-K5*GTSxf1qXePwz^VH;u^@(6e{i!-tC zGp|h^flX7h_s^dYu@vV!tUBsu%2aNY5eb2gXitMM*)?Pwlj`3=bSIMBz~0W{iz8j< zEJ!O(k$WG_a0lW~5?Gktu!}*U<7RVYIVg%IU=Z!zY$gapLlfHFSGHaPSq4n1`QqT zH+Rcc5K}KNdJNpGA5pBlz?KD_2s9l;o023~S)g3azx=yguOH-70X4iNxZ0Igxbuq* zyuu9|yQfPOLdQBV;Vrku&(=(eE*89NVi(u-O27s&+zX;vxIQ*+e!W@?(Ae-3-|4kY zZls`&Id3?%k#>+leT)>6Y@RQ^BpoDj3bHnfsv->S$U@y)sh0cc(m(2TJJ85!%2=D9 z6M=7uJCMs3U#?NoPQqh2!wskS_KH76r<5$KYQ3H@XFWQSdtg>gb!zlOj&Ee1yBgWF*^8A;ks@@eMz*qMbh6q(soy4f3p)5TUg;gx?1lAJ6|Q zQe$D&Gpwj@jBokWV`D-pWln zlstAy6q}fM-y8!}Kl2-g!ZAKVQ%*2BX zoP`z|jej0VnkKEIjtl=7d4~y+1|gdfzwC-bEvvIf?MUGl;0#uK)2~d)3i$MO)S~bM zBf`YpKGsscq%ja#Nv?giNba2HSGvlG6YoxV(R;C&gvVd9kZ3Sso;~1Vp7!0C2py|9 zqql@2t)2(~RS_0DoJ#)fS85DK#hFN(axi9sL1KxZd(XrLPB2)+Bg0ksBwqXdhH8IH zYRsFe&UsV(co857;I@w}6TW=UWbB0q!8LL+%ZeA49ixl691Bwe2I`%|xe2x~B@i+; zIR}NdpTYSFsj)5!NM+X17&Qz5G1cStW)pknOqUu#6n9{ys9 zV~T_WdAkyq)E(Z0eec*d!F5*fS0?t*kG}(ElYVMOr@)a%UL;cebuRMmH$IMfpn>2e z2&R8ST`&dWc%ut+izc}=#qdYE?wL~VIurp@gbeUR&Coa2?OUvosd=%^aU5$=dYKWaM7)LPETH5dj;V+_o@ zL<*4wzzS)*%9a7VjD&;~59PK}{M7qj{~r|$M`>vwRNUQk&?{ODEA;OxoQ zC?TzFeL)lOR4_-wz##VlkD>DasZamGy^3_x5Qmls*x9P`vpI5QpH9|3_iUyDn+SKT0!t~_1q zcsN~7E>=M>RmEy#Jn(Ft{>rF2QBmP^Avo%PJDc~c^}EgIRO0UcqQn^qX%5sqA{KRv z`vzv*nP_lyx2@#QO2$93(Xp^7Z>FSQlW3JXhzwpX+T_J2Bqp9>MCLS*w8n7`3=XQ0 z@K`Iw3Xls64XJJ>Ta4o zN>wuJ;{kf<-$YK^FSFVNe6Eg{iEwamwhi8POoXd&D1kk7)6qg zMW06hY#CzoQNC@pb9B)to5$0wFql6oN(0>+d@8D!#;Us$)Hy2y21ZBz&B-Y%HwI%)e~q2}M|m)yvk=_ixPNt`(J(0yDOoZ^09*NuY)n z>+MU;t~~M - - - - - - - - - - - - - image/svg+xml - - - - - - - if (unit == "char") moveOnce(); else if (unit == "column") moveOnce(true); else if (unit == "word" || unit == "group") { var sawType = null, group = unit == "group"; for (var first = true;; first = false) { if (dir < 0 && !moveOnce(!first)) break; var cur = lineObj.text.charAt(ch) || "\n"; var type = isWordChar(cur) ? "w" : !group ? null : /\s/.test(cur) ? null : "p"; // punctuation if (sawType && sawType - - Code Mirror - - diff --git a/ajax/libs/codemirror/3.24.0/package/doc/manual.html b/ajax/libs/codemirror/3.24.0/package/doc/manual.html deleted file mode 100644 index cd4e0d649..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/manual.html +++ /dev/null @@ -1,2808 +0,0 @@ - - -CodeMirror: User Manual - - - - - - - - - - - - - - - - -
- -
-

- User manual and reference guide - version 3.24.0 -

- -

CodeMirror is a code-editor component that can be embedded in - Web pages. The core library provides only the editor - component, no accompanying buttons, auto-completion, or other IDE - functionality. It does provide a rich API on top of which such - functionality can be straightforwardly implemented. See - the addons included in the distribution, - and the list - of externally hosted addons, for reusable - implementations of extra features.

- -

CodeMirror works with language-specific modes. Modes are - JavaScript programs that help color (and optionally indent) text - written in a given language. The distribution comes with a number - of modes (see the mode/ - directory), and it isn't hard to write new - ones for other languages.

-
- -
-

Basic Usage

- -

The easiest way to use CodeMirror is to simply load the script - and style sheet found under lib/ in the distribution, - plus a mode script from one of the mode/ directories. - (See the compression helper for an - easy way to combine scripts.) For example:

- -
<script src="lib/codemirror.js"></script>
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="mode/javascript/javascript.js"></script>
- -

Having done this, an editor instance can be created like - this:

- -
var myCodeMirror = CodeMirror(document.body);
- -

The editor will be appended to the document body, will start - empty, and will use the mode that we loaded. To have more control - over the new editor, a configuration object can be passed - to CodeMirror as a second - argument:

- -
var myCodeMirror = CodeMirror(document.body, {
-  value: "function myScript(){return 100;}\n",
-  mode:  "javascript"
-});
- -

This will initialize the editor with a piece of code already in - it, and explicitly tell it to use the JavaScript mode (which is - useful when multiple modes are loaded). - See below for a full discussion of the - configuration options that CodeMirror accepts.

- -

In cases where you don't want to append the editor to an - element, and need more control over the way it is inserted, the - first argument to the CodeMirror function can also - be a function that, when given a DOM element, inserts it into the - document somewhere. This could be used to, for example, replace a - textarea with a real editor:

- -
var myCodeMirror = CodeMirror(function(elt) {
-  myTextArea.parentNode.replaceChild(elt, myTextArea);
-}, {value: myTextArea.value});
- -

However, for this use case, which is a common way to use - CodeMirror, the library provides a much more powerful - shortcut:

- -
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
- -

This will, among other things, ensure that the textarea's value - is updated with the editor's contents when the form (if it is part - of a form) is submitted. See the API - reference for a full description of this method.

- -
-
-

Configuration

- -

Both the CodeMirror - function and its fromTextArea method take as second - (optional) argument an object containing configuration options. - Any option not supplied like this will be taken - from CodeMirror.defaults, an - object containing the default options. You can update this object - to change the defaults on your page.

- -

Options are not checked in any way, so setting bogus option - values is bound to lead to odd errors.

- -

These are the supported options:

- -
-
value: string|CodeMirror.Doc
-
The starting value of the editor. Can be a string, or - a document object.
- -
mode: string|object
-
The mode to use. When not given, this will default to the - first mode that was loaded. It may be a string, which either - simply names the mode or is - a MIME type - associated with the mode. Alternatively, it may be an object - containing configuration options for the mode, with - a name property that names the mode (for - example {name: "javascript", json: true}). The demo - pages for each mode contain information about what configuration - parameters the mode supports. You can ask CodeMirror which modes - and MIME types have been defined by inspecting - the CodeMirror.modes - and CodeMirror.mimeModes objects. The first maps - mode names to their constructors, and the second maps MIME types - to mode specs.
- -
theme: string
-
The theme to style the editor with. You must make sure the - CSS file defining the corresponding .cm-s-[name] - styles is loaded (see - the theme directory in the - distribution). The default is "default", for which - colors are included in codemirror.css. It is - possible to use multiple theming classes at once—for - example "foo bar" will assign both - the cm-s-foo and the cm-s-bar classes - to the editor.
- -
indentUnit: integer
-
How many spaces a block (whatever that means in the edited - language) should be indented. The default is 2.
- -
smartIndent: boolean
-
Whether to use the context-sensitive indentation that the - mode provides (or just indent the same as the line before). - Defaults to true.
- -
tabSize: integer
-
The width of a tab character. Defaults to 4.
- -
indentWithTabs: boolean
-
Whether, when indenting, the first N*tabSize - spaces should be replaced by N tabs. Default is false.
- -
electricChars: boolean
-
Configures whether the editor should re-indent the current - line when a character is typed that might change its proper - indentation (only works if the mode supports indentation). - Default is true.
- -
specialChars: RegExp
-
A regular expression used to determine which characters - should be replaced by a - special placeholder. - Mostly useful for non-printing special characters. The default - is /[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/.
-
specialCharPlaceholder: function(char) → Element
-
A function that, given a special character identified by - the specialChars - option, produces a DOM node that is used to represent the - character. By default, a red dot () - is shown, with a title tooltip to indicate the character code.
- -
rtlMoveVisually: boolean
-
Determines whether horizontal cursor movement through - right-to-left (Arabic, Hebrew) text is visual (pressing the left - arrow moves the cursor left) or logical (pressing the left arrow - moves to the next lower index in the string, which is visually - right in right-to-left text). The default is false - on Windows, and true on other platforms.
- -
keyMap: string
-
Configures the keymap to use. The default - is "default", which is the only keymap defined - in codemirror.js itself. Extra keymaps are found in - the keymap directory. See - the section on keymaps for more - information.
- -
extraKeys: object
-
Can be used to specify extra keybindings for the editor, - alongside the ones defined - by keyMap. Should be - either null, or a valid keymap value.
- -
lineWrapping: boolean
-
Whether CodeMirror should scroll or wrap for long lines. - Defaults to false (scroll).
- -
lineNumbers: boolean
-
Whether to show line numbers to the left of the editor.
- -
firstLineNumber: integer
-
At which number to start counting lines. Default is 1.
- -
lineNumberFormatter: function(line: integer) → string
-
A function used to format line numbers. The function is - passed the line number, and should return a string that will be - shown in the gutter.
- -
gutters: array<string>
-
Can be used to add extra gutters (beyond or instead of the - line number gutter). Should be an array of CSS class names, each - of which defines a width (and optionally a - background), and which will be used to draw the background of - the gutters. May include - the CodeMirror-linenumbers class, in order to - explicitly set the position of the line number gutter (it will - default to be to the right of all other gutters). These class - names are the keys passed - to setGutterMarker.
- -
fixedGutter: boolean
-
Determines whether the gutter scrolls along with the content - horizontally (false) or whether it stays fixed during horizontal - scrolling (true, the default).
- -
coverGutterNextToScrollbar: boolean
-
When fixedGutter - is on, and there is a horizontal scrollbar, by default the - gutter will be visible to the left of this scrollbar. If this - option is set to true, it will be covered by an element with - class CodeMirror-gutter-filler.
- -
readOnly: boolean|string
-
This disables editing of the editor content by the user. If - the special value "nocursor" is given (instead of - simply true), focusing of the editor is also - disallowed.
- -
showCursorWhenSelecting: boolean
-
Whether the cursor should be drawn when a selection is - active. Defaults to false.
- -
undoDepth: integer
-
The maximum number of undo levels that the editor stores. - Defaults to 40.
- -
historyEventDelay: integer
-
The period of inactivity (in milliseconds) that will cause a - new history event to be started when typing or deleting. - Defaults to 500.
- -
tabindex: integer
-
The tab - index to assign to the editor. If not given, no tab index - will be assigned.
- -
autofocus: boolean
-
Can be used to make CodeMirror focus itself on - initialization. Defaults to off. - When fromTextArea is - used, and no explicit value is given for this option, it will be - set to true when either the source textarea is focused, or it - has an autofocus attribute and no other element is - focused.
-
- -

Below this a few more specialized, low-level options are - listed. These are only useful in very specific situations, you - might want to skip them the first time you read this manual.

- -
-
dragDrop: boolean
-
Controls whether drag-and-drop is enabled. On by default.
- -
onDragEvent: function(instance: CodeMirror, event: Event) → boolean
-
Deprecated! See these event - handlers for the current recommended approach.
When given, - this will be called when the editor is handling - a dragenter, dragover, - or drop event. It will be passed the editor - instance and the event object as arguments. The callback can - choose to handle the event itself, in which case it should - return true to indicate that CodeMirror should not - do anything further.
- -
onKeyEvent: function(instance: CodeMirror, event: Event) → boolean
-
Deprecated! See these event - handlers for the current recommended approach.
This - provides a rather low-level hook into CodeMirror's key handling. - If provided, this function will be called on - every keydown, keyup, - and keypress event that CodeMirror captures. It - will be passed two arguments, the editor instance and the key - event. This key event is pretty much the raw key event, except - that a stop() method is always added to it. You - could feed it to, for example, jQuery.Event to - further normalize it.
This function can inspect the key - event, and handle it if it wants to. It may return true to tell - CodeMirror to ignore the event. Be wary that, on some browsers, - stopping a keydown does not stop - the keypress from firing, whereas on others it - does. If you respond to an event, you should probably inspect - its type property and only do something when it - is keydown (or keypress for actions - that need character data).
- -
cursorBlinkRate: number
-
Half-period in milliseconds used for cursor blinking. The default blink - rate is 530ms. By setting this to zero, blinking can be disabled.
- -
cursorScrollMargin: number
-
How much extra space to always keep above and below the - cursor when approaching the top or bottom of the visible view in - a scrollable document. Default is 0.
- -
cursorHeight: number
-
Determines the height of the cursor. Default is 1, meaning - it spans the whole height of the line. For some fonts (and by - some tastes) a smaller height (for example 0.85), - which causes the cursor to not reach all the way to the bottom - of the line, looks better
- -
resetSelectionOnContextMenu: boolean
-
Controls whether, when the context menu is opened with a - click outside of the current selection, the cursor is moved to - the point of the click. Defaults to true.
- -
workTime, workDelay: number
-
Highlighting is done by a pseudo background-thread that will - work for workTime milliseconds, and then use - timeout to sleep for workDelay milliseconds. The - defaults are 200 and 300, you can change these options to make - the highlighting more or less aggressive.
- -
workDelay: number
-
See workTime.
- -
pollInterval: number
-
Indicates how quickly CodeMirror should poll its input - textarea for changes (when focused). Most input is captured by - events, but some things, like IME input on some browsers, don't - generate events that allow CodeMirror to properly detect it. - Thus, it polls. Default is 100 milliseconds.
- -
flattenSpans: boolean
-
By default, CodeMirror will combine adjacent tokens into a - single span if they have the same class. This will result in a - simpler DOM tree, and thus perform better. With some kinds of - styling (such as rounded corners), this will change the way the - document looks. You can set this option to false to disable this - behavior.
- -
addModeClass: boolean
-
When enabled (off by default), an extra CSS class will be - added to each token, indicating the - (inner) mode that produced it, prefixed - with "cm-m-". For example, tokens from the XML mode - will get the cm-m-xml class.
- -
maxHighlightLength: number
-
When highlighting long lines, in order to stay responsive, - the editor will give up and simply style the rest of the line as - plain text when it reaches a certain position. The default is - 10 000. You can set this to Infinity to turn off - this behavior.
- -
crudeMeasuringFrom: number
-
When measuring the character positions in long lines, any - line longer than this number (default is 10 000), - when line wrapping - is off, will simply be assumed to consist of - same-sized characters. This means that, on the one hand, - measuring will be inaccurate when characters of varying size, - right-to-left text, markers, or other irregular elements are - present. On the other hand, it means that having such a line - won't freeze the user interface because of the expensiveness of - the measurements.
- -
viewportMargin: integer
-
Specifies the amount of lines that are rendered above and - below the part of the document that's currently scrolled into - view. This affects the amount of updates needed when scrolling, - and the amount of work that such an update does. You should - usually leave it at its default, 10. Can be set - to Infinity to make sure the whole document is - always rendered, and thus the browser's text search works on it. - This will have bad effects on performance of big - documents.
-
-
- -
-

Events

- -

Various CodeMirror-related objects emit events, which allow - client code to react to various situations. Handlers for such - events can be registered with the on - and off methods on the objects - that the event fires on. To fire your own events, - use CodeMirror.signal(target, name, args...), - where target is a non-DOM-node object.

- -

An editor instance fires the following events. - The instance argument always refers to the editor - itself.

- -
-
"change" (instance: CodeMirror, changeObj: object)
-
Fires every time the content of the editor is changed. - The changeObj is a {from, to, text, removed, - next} object containing information about the changes - that occurred as second argument. from - and to are the positions (in the pre-change - coordinate system) where the change started and ended (for - example, it might be {ch:0, line:18} if the - position is at the beginning of line #19). text is - an array of strings representing the text that replaced the - changed range (split by line). removed is the text - that used to be between from and to, - which is overwritten by this change. If multiple changes - happened during a single operation, the object will have - a next property pointing to another change object - (which may point to another, etc).
- -
"beforeChange" (instance: CodeMirror, changeObj: object)
-
This event is fired before a change is applied, and its - handler may choose to modify or cancel the change. - The changeObj object - has from, to, and text - properties, as with - the "change" event, but - never a next property, since this is fired for each - individual change, and not batched per operation. It also has - a cancel() method, which can be called to cancel - the change, and, if the change isn't coming - from an undo or redo event, an update(from, to, - text) method, which may be used to modify the change. - Undo or redo changes can't be modified, because they hold some - metainformation for restoring old marked ranges that is only - valid for that specific change. All three arguments - to update are optional, and can be left off to - leave the existing value for that field - intact. Note: you may not do anything from - a "beforeChange" handler that would cause changes - to the document or its visualization. Doing so will, since this - handler is called directly from the bowels of the CodeMirror - implementation, probably cause the editor to become - corrupted.
- -
"cursorActivity" (instance: CodeMirror)
-
Will be fired when the cursor or selection moves, or any - change is made to the editor content.
- -
"keyHandled" (instance: CodeMirror, name: string, event: Event)
-
Fired after a key is handled through a - keymap. name is the name of the handled key (for - example "Ctrl-X" or "'q'"), - and event is the DOM keydown - or keypress event.
- -
"inputRead" (instance: CodeMirror, changeObj: object)
-
Fired whenever new input is read from the hidden textarea - (typed or pasted by the user).
- -
"beforeSelectionChange" (instance: CodeMirror, selection: {head, anchor})
-
This event is fired before the selection is moved. Its - handler may modify the resulting selection head and anchor. - The selection parameter is an object - with head and anchor properties - holding {line, ch} objects, which the handler can - read and update. Handlers for this event have the same - restriction - as "beforeChange" - handlers — they should not do anything to directly update the - state of the editor.
- -
"viewportChange" (instance: CodeMirror, from: number, to: number)
-
Fires whenever the view port of - the editor changes (due to scrolling, editing, or any other - factor). The from and to arguments - give the new start and end of the viewport.
- -
"swapDoc" (instance: CodeMirror, oldDoc: Doc)
-
This is signalled when the editor's document is replaced - using the swapDoc - method.
- -
"gutterClick" (instance: CodeMirror, line: integer, gutter: string, clickEvent: Event)
-
Fires when the editor gutter (the line-number area) is - clicked. Will pass the editor instance as first argument, the - (zero-based) number of the line that was clicked as second - argument, the CSS class of the gutter that was clicked as third - argument, and the raw mousedown event object as - fourth argument.
- -
"gutterContextMenu" (instance: CodeMirror, line: integer, gutter: string, contextMenu: Event: Event)
-
Fires when the editor gutter (the line-number area) - receives a contextmenu event. Will pass the editor - instance as first argument, the (zero-based) number of the line - that was clicked as second argument, the CSS class of the - gutter that was clicked as third argument, and the raw - contextmenu mouse event object as fourth argument. - You can preventDefault the event, to signal that - CodeMirror should do no further handling.
- -
"focus" (instance: CodeMirror)
-
Fires whenever the editor is focused.
- -
"blur" (instance: CodeMirror)
-
Fires whenever the editor is unfocused.
- -
"scroll" (instance: CodeMirror)
-
Fires when the editor is scrolled.
- -
"update" (instance: CodeMirror)
-
Will be fired whenever CodeMirror updates its DOM display.
- -
"renderLine" (instance: CodeMirror, line: LineHandle, element: Element)
-
Fired whenever a line is (re-)rendered to the DOM. Fired - right after the DOM element is built, before it is - added to the document. The handler may mess with the style of - the resulting element, or add event handlers, but - should not try to change the state of the editor.
- -
"mousedown", - "dblclick", "contextmenu", "keydown", "keypress", - "keyup", "dragstart", "dragenter", - "dragover", "drop" - (instance: CodeMirror, event: Event)
-
Fired when CodeMirror is handling a DOM event of this type. - You can preventDefault the event, or give it a - truthy codemirrorIgnore property, to signal that - CodeMirror should do no further handling.
-
- -

Document objects (instances - of CodeMirror.Doc) emit the - following events:

- -
-
"change" (doc: CodeMirror.Doc, changeObj: object)
-
Fired whenever a change occurs to the - document. changeObj has a similar type as the - object passed to the - editor's "change" - event, but it never has a next property, because - document change events are not batched (whereas editor change - events are).
- -
"beforeChange" (doc: CodeMirror.Doc, change: object)
-
See the description of the - same event on editor instances.
- -
"cursorActivity" (doc: CodeMirror.Doc)
-
Fired whenever the cursor or selection in this document - changes.
- -
"beforeSelectionChange" (doc: CodeMirror.Doc, selection: {head, anchor})
-
Equivalent to - the event by the same - name as fired on editor instances.
-
- -

Line handles (as returned by, for - example, getLineHandle) - support these events:

- -
-
"delete" ()
-
Will be fired when the line object is deleted. A line object - is associated with the start of the line. Mostly useful - when you need to find out when your gutter - markers on a given line are removed.
-
"change" (line: LineHandle, changeObj: object)
-
Fires when the line's text content is changed in any way - (but the line is not deleted outright). The change - object is similar to the one passed - to change event on the editor - object.
-
- -

Marked range handles (CodeMirror.TextMarker), as returned - by markText - and setBookmark, emit the - following events:

- -
-
"beforeCursorEnter" ()
-
Fired when the cursor enters the marked range. From this - event handler, the editor state may be inspected - but not modified, with the exception that the range on - which the event fires may be cleared.
-
"clear" (from: {line, ch}, to: {line, ch})
-
Fired when the range is cleared, either through cursor - movement in combination - with clearOnEnter - or through a call to its clear() method. Will only - be fired once per handle. Note that deleting the range through - text editing does not fire this event, because an undo action - might bring the range back into existence. from - and to give the part of the document that the range - spanned when it was cleared.
-
"hide" ()
-
Fired when the last part of the marker is removed from the - document by editing operations.
-
"unhide" ()
-
Fired when, after the marker was removed by editing, a undo - operation brought the marker back.
-
- -

Line widgets (CodeMirror.LineWidget), returned - by addLineWidget, fire - these events:

- -
-
"redraw" ()
-
Fired whenever the editor re-adds the widget to the DOM. - This will happen once right after the widget is added (if it is - scrolled into view), and then again whenever it is scrolled out - of view and back in again, or when changes to the editor options - or the line the widget is on require the widget to be - redrawn.
-
-
- -
-

Keymaps

- -

Keymaps are ways to associate keys with functionality. A keymap - is an object mapping strings that identify the keys to functions - that implement their functionality.

- -

Keys are identified either by name or by character. - The CodeMirror.keyNames object defines names for - common keys and associates them with their key codes. Examples of - names defined here are Enter, F5, - and Q. These can be prefixed - with Shift-, Cmd-, Ctrl-, - and Alt- (in that order!) to specify a modifier. So - for example, Shift-Ctrl-Space would be a valid key - identifier.

- -

Common example: map the Tab key to insert spaces instead of a tab - character.

- -
-{
-  Tab: function(cm) {
-    var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
-    cm.replaceSelection(spaces, "end", "+input");
-  }
-}
- -

Alternatively, a character can be specified directly by - surrounding it in single quotes, for example '$' - or 'q'. Due to limitations in the way browsers fire - key events, these may not be prefixed with modifiers.

- -

The CodeMirror.keyMap object associates keymaps - with names. User code and keymap definitions can assign extra - properties to this object. Anywhere where a keymap is expected, a - string can be given, which will be looked up in this object. It - also contains the "default" keymap holding the - default bindings.

- -

The values of properties in keymaps can be either functions of - a single argument (the CodeMirror instance), strings, or - false. Such strings refer to properties of the - CodeMirror.commands object, which defines a number of - common commands that are used by the default keybindings, and maps - them to functions. If the property is set to false, - CodeMirror leaves handling of the key up to the browser. A key - handler function may return CodeMirror.Pass to indicate - that it has decided not to handle the key, and other handlers (or - the default behavior) should be given a turn.

- -

Keys mapped to command names that start with the - characters "go" (which should be used for - cursor-movement actions) will be fired even when an - extra Shift modifier is present (i.e. "Up": - "goLineUp" matches both up and shift-up). This is used to - easily implement shift-selection.

- -

Keymaps can defer to each other by defining - a fallthrough property. This indicates that when a - key is not found in the map itself, one or more other maps should - be searched. It can hold either a single keymap or an array of - keymaps.

- -

When a keymap contains a nofallthrough property - set to true, keys matched against that map will be - ignored if they don't match any of the bindings in the map (no - further child maps will be tried). When - the disableInput property is set - to true, the default effect of inserting a character - will be suppressed when the keymap is active as the top-level - map.

-
- -<<<<<<< HEAD -======= -
-

Commands

- -

Commands are parameter-less actions that can be performed on an - editor. Their main use is for key bindings. Commands are defined by - adding properties to the CodeMirror.commands object. - A number of common commands are defined by the library itself, - most of them used by the default key bindings. The value of a - command property must be a function of one argument (an editor - instance).

- -

Some of the commands below are referenced in the default - key map, but not defined by the core library. These are intended to - be defined by user code or addons.

- -

Commands can also be run with - the execCommand - method.

- -
-
selectAllCtrl-A (PC), Cmd-A (Mac)
-
Select the whole content of the editor.
- -
singleSelectionEsc
-
When multiple selections are present, this deselects all but - the primary selection.
- -
killLineCtrl-K (Mac)
-
Emacs-style line killing. Deletes the part of the line after - the cursor. If that consists only of whitespace, the newline at - the end of the line is also deleted.
- -
deleteLineCtrl-D (PC), Cmd-D (Mac)
-
Deletes the whole line under the cursor, including newline at the end.
- -
delLineLeftCmd-Backspace (Mac)
-
Delete the part of the line before the cursor.
- -
undoCtrl-Z (PC), Cmd-Z (Mac)
-
Undo the last change.
- -
redoCtrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)
-
Redo the last undone change.
- -
undoSelectionCtrl-U (PC), Cmd-U (Mac)
-
Undo the last change to the selection, or if there are no - selection-only changes at the top of the history, undo the last - change.
- -
redoSelectionAlt-U (PC), Shift-Cmd-U (Mac)
-
Redo the last change to the selection, or the last text change if - no selection changes remain.
- -
goDocStartCtrl-Up (PC), Cmd-Up (Mac)
-
Move the cursor to the start of the document.
- -
goDocEndCtrl-Down (PC), Cmd-End (Mac), Cmd-Down (Mac)
-
Move the cursor to the end of the document.
- -
goLineStartAlt-Left (PC), Cmd-Left (Mac), Ctrl-A (Mac)
-
Move the cursor to the start of the line.
- -
goLineStartSmartHome
-
Move to the start of the text on the line, or if we are - already there, to the actual start of the line (including - whitespace).
- -
goLineEndAlt-Right (PC), Cmd-Right (Mac), Ctrl-E (Mac)
-
Move the cursor to the end of the line.
- -
goLineLeft
-
Move the cursor to the left side of the visual line it is on. If - this line is wrapped, that may not be the start of the line.
- -
goLineRight
-
Move the cursor to the right side of the visual line it is on.
- -
goLineUpUp, Ctrl-P (Mac)
-
Move the cursor up one line.
- -
goLineDownDown, Ctrl-N (Mac)
-
Move down one line.
- -
goPageUpPageUp, Shift-Ctrl-V (Mac)
-
Move the cursor up one screen, and scroll up by the same distance.
- -
goPageDownPageDown, Ctrl-V (Mac)
-
Move the cursor down one screen, and scroll down by the same distance.
- -
goCharLeftLeft, Ctrl-B (Mac)
-
Move the cursor one character left, going to the previous line - when hitting the start of line.
- -
goCharRightRight, Ctrl-F (Mac)
-
Move the cursor one character right, going to the next line - when hitting the end of line.
- -
goColumnLeft
-
Move the cursor one character left, but don't cross line boundaries.
- -
goColumnRight
-
Move the cursor one character right, don't cross line boundaries.
- -
goWordLeftAlt-B (Mac)
-
Move the cursor to the start of the previous word.
- -
goWordRightAlt-F (Mac)
-
Move the cursor to the end of the next word.
- -
goGroupLeftCtrl-Left (PC), Alt-Left (Mac)
-
Move to the left of the group before the cursor. A group is - a stretch of word characters, a stretch of punctuation - characters, a newline, or a stretch of more than one - whitespace character.
- -
goGroupRightCtrl-Right (PC), Alt-Right (Mac)
-
Move to the right of the group after the cursor - (see above).
- -
delCharBeforeShift-Backspace, Ctrl-H (Mac)
-
Delete the character before the cursor.
- -
delCharAfterDelete, Ctrl-D (Mac)
-
Delete the character after the cursor.
- -
delWordBeforeAlt-Backspace (Mac)
-
Delete up to the start of the word before the cursor.
- -
delWordAfterAlt-D (Mac)
-
Delete up to the end of the word after the cursor.
- -
delGroupBeforeCtrl-Backspace (PC), Alt-Backspace (Mac)
-
Delete to the left of the group before the cursor.
- -
delGroupAfterCtrl-Delete (PC), Ctrl-Alt-Backspace (Mac), Alt-Delete (Mac)
-
Delete to the start of the group after the cursor.
- -
indentAutoShift-Tab
-
Auto-indent the current line or selection.
- -
indentMoreCtrl-] (PC), Cmd-] (Mac)
-
Indent the current line or selection by one indent unit.
- -
indentLessCtrl-[ (PC), Cmd-[ (Mac)
-
Dedent the current line or selection by one indent unit.
- -
insertTab
-
Insert a tab character at the cursor.
- -
insertSoftTab
-
Insert the amount of spaces that match the width a tab at - the cursor position would have.
- -
defaultTabTab
-
If something is selected, indent it by - one indent unit. If nothing is - selected, insert a tab character.
- -
transposeCharsCtrl-T (Mac)
-
Swap the characters before and after the cursor.
- -
newlineAndIndentEnter
-
Insert a newline and auto-indent the new line.
- -
toggleOverwriteInsert
-
Flip the overwrite flag.
- -
saveCtrl-S (PC), Cmd-S (Mac)
-
Not defined by the core library, only referred to in - key maps. Intended to provide an easy way for user code to define - a save command.
- -
findCtrl-F (PC), Cmd-F (Mac)
-
findNextCtrl-G (PC), Cmd-G (Mac)
-
findPrevShift-Ctrl-G (PC), Shift-Cmd-G (Mac)
-
replaceShift-Ctrl-F (PC), Cmd-Alt-F (Mac)
-
replaceAllShift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)
-
Not defined by the core library, but defined in - the search addon (or custom client - addons).
- -
- -
- ->>>>>>> 97b1153... Add insertSoftTab command -
-

Customized Styling

- -

Up to a certain extent, CodeMirror's look can be changed by - modifying style sheet files. The style sheets supplied by modes - simply provide the colors for that mode, and can be adapted in a - very straightforward way. To style the editor itself, it is - possible to alter or override the styles defined - in codemirror.css.

- -

Some care must be taken there, since a lot of the rules in this - file are necessary to have CodeMirror function properly. Adjusting - colors should be safe, of course, and with some care a lot of - other things can be changed as well. The CSS classes defined in - this file serve the following roles:

- -
-
CodeMirror
-
The outer element of the editor. This should be used for the - editor width, height, borders and positioning. Can also be used - to set styles that should hold for everything inside the editor - (such as font and font size), or to set a background.
- -
CodeMirror-scroll
-
Whether the editor scrolls (overflow: auto + - fixed height). By default, it does. Setting - the CodeMirror class to have height: - auto and giving this class overflow-x: auto; - overflow-y: hidden; will cause the editor - to resize to fit its - content.
- -
CodeMirror-focused
-
Whenever the editor is focused, the top element gets this - class. This is used to hide the cursor and give the selection a - different color when the editor is not focused.
- -
CodeMirror-gutters
-
This is the backdrop for all gutters. Use it to set the - default gutter background color, and optionally add a border on - the right of the gutters.
- -
CodeMirror-linenumbers
-
Use this for giving a background or width to the line number - gutter.
- -
CodeMirror-linenumber
-
Used to style the actual individual line numbers. These - won't be children of the CodeMirror-linenumbers - (plural) element, but rather will be absolutely positioned to - overlay it. Use this to set alignment and text properties for - the line numbers.
- -
CodeMirror-lines
-
The visible lines. This is where you specify vertical - padding for the editor content.
- -
CodeMirror-cursor
-
The cursor is a block element that is absolutely positioned. - You can make it look whichever way you want.
- -
CodeMirror-selected
-
The selection is represented by span elements - with this class.
- -
CodeMirror-matchingbracket, - CodeMirror-nonmatchingbracket
-
These are used to style matched (or unmatched) brackets.
-
- -

If your page's style sheets do funky things to - all div or pre elements (you probably - shouldn't do that), you'll have to define rules to cancel these - effects out again for elements under the CodeMirror - class.

- -

Themes are also simply CSS files, which define colors for - various syntactic elements. See the files in - the theme directory.

-
- -
-

Programming API

- -

A lot of CodeMirror features are only available through its - API. Thus, you need to write code (or - use addons) if you want to expose them to - your users.

- -

Whenever points in the document are represented, the API uses - objects with line and ch properties. - Both are zero-based. CodeMirror makes sure to 'clip' any positions - passed by client code so that they fit inside the document, so you - shouldn't worry too much about sanitizing your coordinates. If you - give ch a value of null, or don't - specify it, it will be replaced with the length of the specified - line.

- -

Methods prefixed with doc. can, unless otherwise - specified, be called both on CodeMirror (editor) - instances and CodeMirror.Doc instances. Methods - prefixed with cm. are only available - on CodeMirror instances.

- -

Constructor

- -

Constructing an editor instance is done with - the CodeMirror(place: Element|fn(Element), - ?option: object) constructor. If the place - argument is a DOM element, the editor will be appended to it. If - it is a function, it will be called, and is expected to place the - editor into the document. options may be an element - mapping option names to values. The options - that it doesn't explicitly specify (or all options, if it is not - passed) will be taken - from CodeMirror.defaults.

- -

Note that the options object passed to the constructor will be - mutated when the instance's options - are changed, so you shouldn't share such - objects between instances.

- -

See CodeMirror.fromTextArea - for another way to construct an editor instance.

- -

Content manipulation methods

- -
-
doc.getValue(?separator: string) → string
-
Get the current editor content. You can pass it an optional - argument to specify the string to be used to separate lines - (defaults to "\n").
-
doc.setValue(content: string)
-
Set the editor content.
- -
doc.getRange(from: {line, ch}, to: {line, ch}, ?separator: string) → string
-
Get the text between the given points in the editor, which - should be {line, ch} objects. An optional third - argument can be given to indicate the line separator string to - use (defaults to "\n").
-
doc.replaceRange(replacement: string, from: {line, ch}, to: {line, ch})
-
Replace the part of the document between from - and to with the given string. from - and to must be {line, ch} - objects. to can be left off to simply insert the - string at position from.
- -
doc.getLine(n: integer) → string
-
Get the content of line n.
-
doc.setLine(n: integer, text: string)
-
Set the content of line n.
-
doc.removeLine(n: integer)
-
Remove the given line from the document.
- -
doc.lineCount() → integer
-
Get the number of lines in the editor.
-
doc.firstLine() → integer
-
Get the first line of the editor. This will - usually be zero but for linked sub-views, - or documents instantiated with a non-zero - first line, it might return other values.
-
doc.lastLine() → integer
-
Get the last line of the editor. This will - usually be doc.lineCount() - 1, - but for linked sub-views, - it might return other values.
- -
doc.getLineHandle(num: integer) → LineHandle
-
Fetches the line handle for the given line number.
-
doc.getLineNumber(handle: LineHandle) → integer
-
Given a line handle, returns the current position of that - line (or null when it is no longer in the - document).
-
doc.eachLine(f: (line: LineHandle))
-
doc.eachLine(start: integer, end: integer, f: (line: LineHandle))
-
Iterate over the whole document, or if start - and end line numbers are given, the range - from start up to (not including) end, - and call f for each line, passing the line handle. - This is a faster way to visit a range of line handlers than - calling getLineHandle - for each of them. Note that line handles have - a text property containing the line's content (as a - string).
- -
doc.markClean()
-
Set the editor content as 'clean', a flag that it will - retain until it is edited, and which will be set again when such - an edit is undone again. Useful to track whether the content - needs to be saved. This function is deprecated in favor - of changeGeneration, - which allows multiple subsystems to track different notions of - cleanness without interfering.
-
doc.changeGeneration(?closeEvent: boolean) → integer
-
Returns a number that can later be passed - to isClean to test whether - any edits were made (and not undone) in the meantime. - If closeEvent is true, the current history event - will be ‘closed’, meaning it can't be combined with further - changes (rapid typing or deleting events are typically - combined).
-
doc.isClean(?generation: integer) → boolean
-
Returns whether the document is currently clean — not - modified since initialization or the last call - to markClean if no - argument is passed, or since the matching call - to changeGeneration - if a generation value is given.
-
- -

Cursor and selection methods

- -
-
doc.getSelection() → string
-
Get the currently selected code.
-
doc.replaceSelection(replacement: string, ?collapse: string)
-
Replace the selection with the given string. By default, the - new selection will span the inserted text. The - optional collapse argument can be used to change - this—passing "start" or "end" will - collapse the selection to the start or end of the inserted - text.
- -
doc.getCursor(?start: string) → {line, ch}
-
start is a an optional string indicating which - end of the selection to return. It may - be "start", "end", "head" - (the side of the selection that moves when you press - shift+arrow), or "anchor" (the fixed side of the - selection). Omitting the argument is the same as - passing "head". A {line, ch} object - will be returned.
-
doc.somethingSelected() → boolean
-
Return true if any text is selected.
-
doc.setCursor(pos: {line, ch})
-
Set the cursor position. You can either pass a - single {line, ch} object, or the line and the - character as two separate parameters.
-
doc.setSelection(anchor: {line, ch}, ?head: {line, ch})
-
Set the selection range. anchor - and head should be {line, ch} - objects. head defaults to anchor when - not given.
-
doc.extendSelection(from: {line, ch}, ?to: {line, ch})
-
Similar - to setSelection, but - will, if shift is held or - the extending flag is set, move the - head of the selection while leaving the anchor at its current - place. to is optional, and can be passed to - ensure a region (for example a word or paragraph) will end up - selected (in addition to whatever lies between that region and - the current anchor).
-
doc.setExtending(value: boolean)
-
Sets or clears the 'extending' flag, which acts similar to - the shift key, in that it will cause cursor movement and calls - to extendSelection - to leave the selection anchor in place.
-
doc.getExtending() → boolean
-
Get the value of the 'extending' flag.
- -
cm.hasFocus() → boolean
-
Tells you whether the editor currently has focus.
- -
cm.findPosH(start: {line, ch}, amount: integer, unit: string, visually: boolean) → {line, ch, ?hitSide: boolean}
-
Used to find the target position for horizontal cursor - motion. start is a {line, ch} - object, amount an integer (may be negative), - and unit one of the - string "char", "column", - or "word". Will return a position that is produced - by moving amount times the distance specified - by unit. When visually is true, motion - in right-to-left text will be visual rather than logical. When - the motion was clipped by hitting the end or start of the - document, the returned value will have a hitSide - property set to true.
-
cm.findPosV(start: {line, ch}, amount: integer, unit: string) → {line, ch, ?hitSide: boolean}
-
Similar to findPosH, - but used for vertical motion. unit may - be "line" or "page". The other - arguments and the returned value have the same interpretation as - they have in findPosH.
-
- -

Configuration methods

- -
-
cm.setOption(option: string, value: any)
-
Change the configuration of the editor. option - should the name of an option, - and value should be a valid value for that - option.
-
cm.getOption(option: string) → any
-
Retrieves the current value of the given option for this - editor instance.
- -
cm.addKeyMap(map: object, bottom: boolean)
-
Attach an additional keymap to the - editor. This is mostly useful for addons that need to register - some key handlers without trampling on - the extraKeys - option. Maps added in this way have a higher precedence than - the extraKeys - and keyMap options, - and between them, the maps added earlier have a lower precedence - than those added later, unless the bottom argument - was passed, in which case they end up below other keymaps added - with this method.
-
cm.removeKeyMap(map: object)
-
Disable a keymap added - with addKeyMap. Either - pass in the keymap object itself, or a string, which will be - compared against the name property of the active - keymaps.
- -
cm.addOverlay(mode: string|object, ?options: object)
-
Enable a highlighting overlay. This is a stateless mini-mode - that can be used to add extra highlighting. For example, - the search addon uses it to - highlight the term that's currently being - searched. mode can be a mode - spec or a mode object (an object with - a token method). - The options parameter is optional. If given, it - should be an object. Currently, only the opaque - option is recognized. This defaults to off, but can be given to - allow the overlay styling, when not null, to - override the styling of the base mode entirely, instead of the - two being applied together.
-
cm.removeOverlay(mode: string|object)
-
Pass this the exact value passed for the mode - parameter to addOverlay, - or a string that corresponds to the name propery of - that value, to remove an overlay again.
- -
cm.on(type: string, func: (...args))
-
Register an event handler for the given event type (a - string) on the editor instance. There is also - a CodeMirror.on(object, type, func) version - that allows registering of events on any object.
-
cm.off(type: string, func: (...args))
-
Remove an event handler on the editor instance. An - equivalent CodeMirror.off(object, type, - func) also exists.
-
- -

Document management methods

- -

Each editor is associated with an instance - of CodeMirror.Doc, its document. A document - represents the editor content, plus a selection, an undo history, - and a mode. A document can only be - associated with a single editor at a time. You can create new - documents by calling the CodeMirror.Doc(text, mode, - firstLineNumber) constructor. The last two arguments are - optional and can be used to set a mode for the document and make - it start at a line number other than 0, respectively.

- -
-
cm.getDoc() → Doc
-
Retrieve the currently active document from an editor.
-
doc.getEditor() → CodeMirror
-
Retrieve the editor associated with a document. May - return null.
- -
cm.swapDoc(doc: CodeMirror.Doc) → Doc
-
Attach a new document to the editor. Returns the old - document, which is now no longer associated with an editor.
- -
doc.copy(copyHistory: boolean) → Doc
-
Create an identical copy of the given doc. - When copyHistory is true, the history will also be - copied. Can not be called directly on an editor.
- -
doc.linkedDoc(options: object) → Doc
-
Create a new document that's linked to the target document. - Linked documents will stay in sync (changes to one are also - applied to the other) until unlinked. - These are the options that are supported: -
-
sharedHist: boolean
-
When turned on, the linked copy will share an undo - history with the original. Thus, something done in one of - the two can be undone in the other, and vice versa.
-
from: integer
-
to: integer
-
Can be given to make the new document a subview of the - original. Subviews only show a given range of lines. Note - that line coordinates inside the subview will be consistent - with those of the parent, so that for example a subview - starting at line 10 will refer to its first line as line 10, - not 0.
-
mode: string|object
-
By default, the new document inherits the mode of the - parent. This option can be set to - a mode spec to give it a - different mode.
-
-
doc.unlinkDoc(doc: CodeMirror.Doc)
-
Break the link between two documents. After calling this, - changes will no longer propagate between the documents, and, if - they had a shared history, the history will become - separate.
-
doc.iterLinkedDocs(function: (doc: CodeMirror.Doc, sharedHist: boolean))
-
Will call the given function for all documents linked to the - target document. It will be passed two arguments, the linked document - and a boolean indicating whether that document shares history - with the target.
-
- -

History-related methods

- -
-
doc.undo()
-
Undo one edit (if any undo events are stored).
-
doc.redo()
-
Redo one undone edit.
- -
doc.historySize() → {undo: integer, redo: integer}
-
Returns an object with {undo, redo} properties, - both of which hold integers, indicating the amount of stored - undo and redo operations.
-
doc.clearHistory()
-
Clears the editor's undo history.
-
doc.getHistory() → object
-
Get a (JSON-serializeable) representation of the undo history.
-
doc.setHistory(history: object)
-
Replace the editor's undo history with the one provided, - which must be a value as returned - by getHistory. Note that - this will have entirely undefined results if the editor content - isn't also the same as it was when getHistory was - called.
-
- -

Text-marking methods

- -
-
doc.markText(from: {line, ch}, to: {line, ch}, ?options: object) → TextMarker
-
Can be used to mark a range of text with a specific CSS - class name. from and to should - be {line, ch} objects. The options - parameter is optional. When given, it should be an object that - may contain the following configuration options: -
-
className: string
-
Assigns a CSS class to the marked stretch of text.
-
inclusiveLeft: boolean
-
Determines whether - text inserted on the left of the marker will end up inside - or outside of it.
-
inclusiveRight: boolean
-
Like inclusiveLeft, - but for the right side.
-
atomic: boolean
-
Atomic ranges act as a single unit when cursor movement is - concerned—i.e. it is impossible to place the cursor inside of - them. In atomic ranges, inclusiveLeft - and inclusiveRight have a different meaning—they - will prevent the cursor from being placed respectively - directly before and directly after the range.
-
collapsed: boolean
-
Collapsed ranges do not show up in the display. Setting a - range to be collapsed will automatically make it atomic.
-
clearOnEnter: boolean
-
When enabled, will cause the mark to clear itself whenever - the cursor enters its range. This is mostly useful for - text-replacement widgets that need to 'snap open' when the - user tries to edit them. The - "clear" event - fired on the range handle can be used to be notified when this - happens.
-
clearWhenEmpty: boolean
-
Determines whether the mark is automatically cleared when - it becomes empty. Default is true.
-
replacedWith: Element
-
Use a given node to display this range. Implies both - collapsed and atomic. The given DOM node must be an - inline element (as opposed to a block element).
-
handleMouseEvents: boolean
-
When replacedWith is given, this determines - whether the editor will capture mouse and drag events - occurring in this widget. Default is false—the events will be - left alone for the default browser handler, or specific - handlers on the widget, to capture.
-
readOnly: boolean
-
A read-only span can, as long as it is not cleared, not be - modified except by - calling setValue to reset - the whole document. Note: adding a read-only span - currently clears the undo history of the editor, because - existing undo events being partially nullified by read-only - spans would corrupt the history (in the current - implementation).
-
addToHistory: boolean
-
When set to true (default is false), adding this marker - will create an event in the undo history that can be - individually undone (clearing the marker).
-
startStyle: string
Can be used to specify - an extra CSS class to be applied to the leftmost span that - is part of the marker.
-
endStyle: string
Equivalent - to startStyle, but for the rightmost span.
-
title: - string
When given, will give the nodes created - for this span a HTML title attribute with the - given value.
-
shared: boolean
When the - target document is linked to other - documents, you can set shared to true to make the - marker appear in all documents. By default, a marker appears - only in its target document.
-
- The method will return an object that represents the marker - (with constructor CodeMirror.TextMarker), which - exposes three methods: - clear(), to remove the mark, - find(), which returns - a {from, to} object (both holding document - positions), indicating the current position of the marked range, - or undefined if the marker is no longer in the - document, and finally changed(), - which you can call if you've done something that might change - the size of the marker (for example changing the content of - a replacedWith - node), and want to cheaply update the display.
- -
doc.setBookmark(pos: {line, ch}, ?options: object) → TextMarker
-
Inserts a bookmark, a handle that follows the text around it - as it is being edited, at the given position. A bookmark has two - methods find() and clear(). The first - returns the current position of the bookmark, if it is still in - the document, and the second explicitly removes the bookmark. - The options argument is optional. If given, the following - properties are recognized: -
-
widget: Element
Can be used to display a DOM - node at the current location of the bookmark (analogous to - the replacedWith - option to markText).
-
insertLeft: boolean
By default, text typed - when the cursor is on top of the bookmark will end up to the - right of the bookmark. Set this option to true to make it go - to the left instead.
-
- -
doc.findMarks(from: {line, ch}, to: {line, ch}) → array<TextMarker>
-
Returns an array of all the bookmarks and marked ranges - found between the given positions.
-
doc.findMarksAt(pos: {line, ch}) → array<TextMarker>
-
Returns an array of all the bookmarks and marked ranges - present at the given position.
-
doc.getAllMarks() → array<TextMarker>
-
Returns an array containing all marked ranges in the document.
-
- -

Widget, gutter, and decoration methods

- -
-
cm.setGutterMarker(line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
-
Sets the gutter marker for the given gutter (identified by - its CSS class, see - the gutters option) - to the given value. Value can be either null, to - clear the marker, or a DOM element, to set it. The DOM element - will be shown in the specified gutter next to the specified - line.
- -
cm.clearGutter(gutterID: string)
-
Remove all gutter markers in - the gutter with the given ID.
- -
cm.addLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
-
Set a CSS class name for the given line. line - can be a number or a line handle. where determines - to which element this class should be applied, can can be one - of "text" (the text element, which lies in front of - the selection), "background" (a background element - that will be behind the selection), or "wrap" (the - wrapper node that wraps all of the line's elements, including - gutter elements). class should be the name of the - class to apply.
- -
cm.removeLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
-
Remove a CSS class from a line. line can be a - line handle or number. where should be one - of "text", "background", - or "wrap" - (see addLineClass). class - can be left off to remove all classes for the specified node, or - be a string to remove only a specific class.
- -
cm.lineInfo(line: integer|LineHandle) → object
-
Returns the line number, text content, and marker status of - the given line, which can be either a number or a line handle. - The returned object has the structure {line, handle, text, - gutterMarkers, textClass, bgClass, wrapClass, widgets}, - where gutterMarkers is an object mapping gutter IDs - to marker elements, and widgets is an array - of line widgets attached to this - line, and the various class properties refer to classes added - with addLineClass.
- -
cm.addWidget(pos: {line, ch}, node: Element, scrollIntoView: boolean)
-
Puts node, which should be an absolutely - positioned DOM node, into the editor, positioned right below the - given {line, ch} position. - When scrollIntoView is true, the editor will ensure - that the entire node is visible (if possible). To remove the - widget again, simply use DOM methods (move it somewhere else, or - call removeChild on its parent).
- -
cm.addLineWidget(line: integer|LineHandle, node: Element, ?options: object) → LineWidget
-
Adds a line widget, an element shown below a line, spanning - the whole of the editor's width, and moving the lines below it - downwards. line should be either an integer or a - line handle, and node should be a DOM node, which - will be displayed below the given line. options, - when given, should be an object that configures the behavior of - the widget. The following options are supported (all default to - false): -
-
coverGutter: boolean
-
Whether the widget should cover the gutter.
-
noHScroll: boolean
-
Whether the widget should stay fixed in the face of - horizontal scrolling.
-
above: boolean
-
Causes the widget to be placed above instead of below - the text of the line.
-
showIfHidden: boolean
-
When true, will cause the widget to be rendered even if - the line it is associated with is hidden.
-
handleMouseEvents: boolean
-
Determines whether the editor will capture mouse and - drag events occurring in this widget. Default is false—the - events will be left alone for the default browser handler, - or specific handlers on the widget, to capture.
-
insertAt: integer
-
By default, the widget is added below other widgets for - the line. This option can be used to place it at a different - position (zero for the top, N to put it after the Nth other - widget). Note that this only has effect once, when the - widget is created. -
- Note that the widget node will become a descendant of nodes with - CodeMirror-specific CSS classes, and those classes might in some - cases affect it. This method returns an object that represents - the widget placement. It'll have a line property - pointing at the line handle that it is associated with, and the following methods: -
-
clear()
Removes the widget.
-
changed()
Call - this if you made some change to the widget's DOM node that - might affect its height. It'll force CodeMirror to update - the height of the line that contains the widget.
-
-
-
- -

Sizing, scrolling and positioning methods

- -
-
cm.setSize(width: number|string, height: number|string)
-
Programatically set the size of the editor (overriding the - applicable CSS - rules). width and height - can be either numbers (interpreted as pixels) or CSS units - ("100%", for example). You can - pass null for either of them to indicate that that - dimension should not be changed.
- -
cm.scrollTo(x: number, y: number)
-
Scroll the editor to a given (pixel) position. Both - arguments may be left as null - or undefined to have no effect.
-
cm.getScrollInfo() → {left, top, width, height, clientWidth, clientHeight}
-
Get an {left, top, width, height, clientWidth, - clientHeight} object that represents the current scroll - position, the size of the scrollable area, and the size of the - visible area (minus scrollbars).
-
cm.scrollIntoView(what: {line, ch}|{left, top, right, bottom}|{from, to}|null, ?margin: number)
-
Scrolls the given position into view. what may - be null to scroll the cursor into view, - a {line, ch} position to scroll a character into - view, a {left, top, right, bottom} pixel range (in - editor-local coordinates), or a range {from, to} - containing either two character positions or two pixel squares. - The margin parameter is optional. When given, it - indicates the amount of vertical pixels around the given area - that should be made visible as well.
- -
cm.cursorCoords(where: boolean|{line, ch}, mode: string) → {left, top, bottom}
-
Returns an {left, top, bottom} object - containing the coordinates of the cursor position. - If mode is "local", they will be - relative to the top-left corner of the editable document. If it - is "page" or not given, they are relative to the - top-left corner of the page. where can be a boolean - indicating whether you want the start (true) or the - end (false) of the selection, or, if a {line, - ch} object is given, it specifies the precise position at - which you want to measure.
-
cm.charCoords(pos: {line, ch}, ?mode: string) → {left, right, top, bottom}
-
Returns the position and dimensions of an arbitrary - character. pos should be a {line, ch} - object. This differs from cursorCoords in that - it'll give the size of the whole character, rather than just the - position that the cursor would have when it would sit at that - position.
-
cm.coordsChar(object: {left, top}, ?mode: string) → {line, ch}
-
Given an {left, top} object, returns - the {line, ch} position that corresponds to it. The - optional mode parameter determines relative to what - the coordinates are interpreted. It may - be "window", "page" (the default), - or "local".
-
cm.lineAtHeight(height: number, ?mode: string) → number
-
Computes the line at the given pixel - height. mode can be one of the same strings - that coordsChar - accepts.
-
cm.heightAtLine(line: number, ?mode: string) → number
-
Computes the height of the top of a line, in the coordinate - system specified by mode - (see coordsChar), which - defaults to "page". When a line below the bottom of - the document is specified, the returned value is the bottom of - the last line in the document.
-
cm.defaultTextHeight() → number
-
Returns the line height of the default font for the editor.
-
cm.defaultCharWidth() → number
-
Returns the pixel width of an 'x' in the default font for - the editor. (Note that for non-monospace fonts, this is mostly - useless, and even for monospace fonts, non-ascii characters - might have a different width).
- -
cm.getViewport() → {from: number, to: number}
-
Returns a {from, to} object indicating the - start (inclusive) and end (exclusive) of the currently rendered - part of the document. In big documents, when most content is - scrolled out of view, CodeMirror will only render the visible - part, and a margin around it. See also - the viewportChange - event.
- -
cm.refresh()
-
If your code does something to change the size of the editor - element (window resizes are already listened for), or unhides - it, you should probably follow up by calling this method to - ensure CodeMirror is still looking as intended.
-
- -

Mode, state, and token-related methods

- -

When writing language-aware functionality, it can often be - useful to hook into the knowledge that the CodeMirror language - mode has. See the section on modes for a - more detailed description of how these work.

- -
-
doc.getMode() → object
-
Gets the (outer) mode object for the editor. Note that this - is distinct from getOption("mode"), which gives you - the mode specification, rather than the resolved, instantiated - mode object.
- -
doc.getModeAt(pos: {line, ch}) → object
-
Gets the inner mode at a given position. This will return - the same as getMode for - simple modes, but will return an inner mode for nesting modes - (such as htmlmixed).
- -
cm.getTokenAt(pos: {line, ch}, ?precise: boolean) → object
-
Retrieves information about the token the current mode found - before the given position (a {line, ch} object). The - returned object has the following properties: -
-
start
The character (on the given line) at which the token starts.
-
end
The character at which the token ends.
-
string
The token's string.
-
type
The token type the mode assigned - to the token, such as "keyword" - or "comment" (may also be null).
-
state
The mode's state at the end of this token.
-
- If precise is true, the token will be guaranteed to be accurate based on recent edits. If false or - not specified, the token will use cached state information, which will be faster but might not be accurate if - edits were recently made and highlighting has not yet completed. -
- -
cm.getTokenTypeAt(pos: {line, ch}) → string
-
This is a (much) cheaper version - of getTokenAt useful for - when you just need the type of the token at a given position, - and no other information. Will return null for - unstyled tokens, and a string, potentially containing multiple - space-separated style names, otherwise.
- -
cm.getHelpers(pos: {line, ch}, type: string) → array<helper>
-
Fetch the set of applicable helper values for the given - position. Helpers provide a way to look up functionality - appropriate for a mode. The type argument provides - the helper namespace (see - registerHelper), in - which the values will be looked up. When the mode itself has a - property that corresponds to the type, that - directly determines the keys that are used to look up the helper - values (it may be either a single string, or an array of - strings). Failing that, the mode's helperType - property and finally the mode's name are used.
-
For example, the JavaScript mode has a - property fold containing "brace". When - the brace-fold addon is loaded, that defines a - helper named brace in the fold - namespace. This is then used by - the foldcode addon to - figure out that it can use that folding function to fold - JavaScript code.
-
When any 'global' - helpers are defined for the given namespace, their predicates - are called on the current mode and editor, and all those that - declare they are applicable will also be added to the array that - is returned.
- -
cm.getHelper(pos: {line, ch}, type: string) → helper
-
Returns the first applicable helper value. - See getHelpers.
- -
cm.getStateAfter(?line: integer, ?precise: boolean) → object
-
Returns the mode's parser state, if any, at the end of the - given line number. If no line number is given, the state at the - end of the document is returned. This can be useful for storing - parsing errors in the state, or getting other kinds of - contextual information for a line. precise is defined - as in getTokenAt().
-
- -

Miscellaneous methods

- -
-
cm.operation(func: () → any) → any
-
CodeMirror internally buffers changes and only updates its - DOM structure after it has finished performing some operation. - If you need to perform a lot of operations on a CodeMirror - instance, you can call this method with a function argument. It - will call the function, buffering up all changes, and only doing - the expensive update after the function returns. This can be a - lot faster. The return value from this method will be the return - value of your function.
- -
cm.indentLine(line: integer, ?dir: string|integer)
-
Adjust the indentation of the given line. The second - argument (which defaults to "smart") may be one of: -
-
"prev"
-
Base indentation on the indentation of the previous line.
-
"smart"
-
Use the mode's smart indentation if available, behave - like "prev" otherwise.
-
"add"
-
Increase the indentation of the line by - one indent unit.
-
"subtract"
-
Reduce the indentation of the line.
-
<integer>
-
Add (positive number) or reduce (negative number) the - indentation by the given amount of spaces.
-
- -
cm.toggleOverwrite(?value: bool)
-
Switches between overwrite and normal insert mode (when not - given an argument), or sets the overwrite mode to a specific - state (when given an argument).
- -
cm.execCommand(name: string)
-
Runs the command with the given name on the editor.
- -
doc.posFromIndex(index: integer) → {line, ch}
-
Calculates and returns a {line, ch} object for a - zero-based index who's value is relative to the start of the - editor's text. If the index is out of range of the text then - the returned object is clipped to start or end of the text - respectively.
-
doc.indexFromPos(object: {line, ch}) → integer
-
The reverse of posFromIndex.
- -
cm.focus()
-
Give the editor focus.
- -
cm.getInputField() → TextAreaElement
-
Returns the hidden textarea used to read input.
-
cm.getWrapperElement() → Element
-
Returns the DOM node that represents the editor, and - controls its size. Remove this from your tree to delete an - editor instance.
-
cm.getScrollerElement() → Element
-
Returns the DOM node that is responsible for the scrolling - of the editor.
-
cm.getGutterElement() → Element
-
Fetches the DOM node that contains the editor gutters.
-
- -

Static properties

-

The CodeMirror object itself provides - several useful properties.

- -
-
CodeMirror.version: string
-
It contains a string that indicates the version of the - library. This is a triple of - integers "major.minor.patch", - where patch is zero for releases, and something - else (usually one) for dev snapshots.
- -
CodeMirror.fromTextArea(textArea: TextAreaElement, ?config: object)
-
- The method provides another way to initialize an editor. It - takes a textarea DOM node as first argument and an optional - configuration object as second. It will replace the textarea - with a CodeMirror instance, and wire up the form of that - textarea (if any) to make sure the editor contents are put - into the textarea when the form is submitted. The text in the - textarea will provide the content for the editor. A CodeMirror - instance created this way has three additional methods: -
-
cm.save()
-
Copy the content of the editor into the textarea.
- -
cm.toTextArea()
-
Remove the editor, and restore the original textarea (with - the editor's current content).
- -
cm.getTextArea() → TextAreaElement
-
Returns the textarea that the instance was based on.
-
-
- -
CodeMirror.defaults: object
-
An object containing default values for - all options. You can assign to its - properties to modify defaults (though this won't affect editors - that have already been created).
- -
CodeMirror.defineExtension(name: string, value: any)
-
If you want to define extra methods in terms of the - CodeMirror API, it is possible to - use defineExtension. This will cause the given - value (usually a method) to be added to all CodeMirror instances - created from then on.
- -
CodeMirror.defineDocExtension(name: string, value: any)
-
Like defineExtension, - but the method will be added to the interface - for Doc objects instead.
- -
CodeMirror.defineOption(name: string, - default: any, updateFunc: function)
-
Similarly, defineOption can be used to define new options for - CodeMirror. The updateFunc will be called with the - editor instance and the new value when an editor is initialized, - and whenever the option is modified - through setOption.
- -
CodeMirror.defineInitHook(func: function)
-
If your extention just needs to run some - code whenever a CodeMirror instance is initialized, - use CodeMirror.defineInitHook. Give it a function as - its only argument, and from then on, that function will be called - (with the instance as argument) whenever a new CodeMirror instance - is initialized.
- -
CodeMirror.registerHelper(type: string, name: string, value: helper)
-
Registers a helper value with the given name in - the given namespace (type). This is used to define - functionality that may be looked up by mode. Will create (if it - doesn't already exist) a property on the CodeMirror - object for the given type, pointing to an object - that maps names to values. I.e. after - doing CodeMirror.registerHelper("hint", "foo", - myFoo), the value CodeMirror.hint.foo will - point to myFoo.
- -
CodeMirror.registerGlobalHelper(type: string, name: string, predicate: fn(mode, CodeMirror), value: helper)
-
Acts - like registerHelper, - but also registers this helper as 'global', meaning that it will - be included by getHelpers - whenever the given predicate returns true when - called with the local mode and editor.
- -
CodeMirror.Pos(line: integer, ?ch: integer)
-
A constructor for the {line, ch} objects that - are used to represent positions in editor documents.
- -
CodeMirror.changeEnd(change: object) → {line, ch}
-
Utility function that computes an end position from a change - (an object with from, to, - and text properties, as passed to - various event handlers). The - returned position will be the end of the changed - range, after the change is applied.
-
-
- -
-

Addons

- -

The addon directory in the distribution contains a - number of reusable components that implement extra editor - functionality (on top of extension functions - like defineOption, defineExtension, - and registerHelper). In - brief, they are:

- -
-
dialog/dialog.js
-
Provides a very simple way to query users for text input. - Adds an openDialog method to - CodeMirror instances, which can be called with an HTML fragment - or a detached DOM node that provides the prompt (should include - an input tag), and a callback function that is called - when text has been entered. Also adds - an openNotification function that - simply shows an HTML fragment as a notification. Depends - on addon/dialog/dialog.css.
- -
search/searchcursor.js
-
Adds the getSearchCursor(query, start, caseFold) → - cursor method to CodeMirror instances, which can be used - to implement search/replace functionality. query - can be a regular expression or a string (only strings will match - across lines—if they contain newlines). start - provides the starting position of the search. It can be - a {line, ch} object, or can be left off to default - to the start of the document. caseFold is only - relevant when matching a string. It will cause the search to be - case-insensitive. A search cursor has the following methods: -
-
findNext() → boolean
-
findPrevious() → boolean
-
Search forward or backward from the current position. - The return value indicates whether a match was found. If - matching a regular expression, the return value will be the - array returned by the match method, in case you - want to extract matched groups.
-
from() → {line, ch}
-
to() → {line, ch}
-
These are only valid when the last call - to findNext or findPrevious did - not return false. They will return {line, ch} - objects pointing at the start and end of the match.
-
replace(text: string)
-
Replaces the currently found match with the given text - and adjusts the cursor position to reflect the - replacement.
-
- - -
Implements the search commands. CodeMirror has keys bound to - these by default, but will not do anything with them unless an - implementation is provided. Depends - on searchcursor.js, and will make use - of openDialog when - available to make prompting for search queries less ugly.
- -
edit/matchbrackets.js
-
Defines an option matchBrackets which, when set - to true, causes matching brackets to be highlighted whenever the - cursor is next to them. It also adds a - method matchBrackets that forces this to happen - once, and a method findMatchingBracket that can be - used to run the bracket-finding algorithm that this uses - internally.
- -
edit/closebrackets.js
-
Defines an option autoCloseBrackets that will - auto-close brackets and quotes when typed. By default, it'll - auto-close ()[]{}''"", but you can pass it a string - similar to that (containing pairs of matching characters), or an - object with pairs and - optionally explode properties to customize - it. explode should be a similar string that gives - the pairs of characters that, when enter is pressed between - them, should have the second character also moved to its own - line. Demo here.
- -
edit/matchtags.js
-
Defines an option matchTags that, when enabled, - will cause the tags around the cursor to be highlighted (using - the CodeMirror-matchingtag class). Also - defines - a command toMatchingTag, - which you can bind a key to in order to jump to the tag mathing - the one under the cursor. Depends on - the addon/fold/xml-fold.js - addon. Demo here.
- -
edit/trailingspace.js
-
Adds an option showTrailingSpace which, when - enabled, adds the CSS class cm-trailingspace to - stretches of whitespace at the end of lines. - The demo has a nice - squiggly underline style for this class.
- -
edit/closetag.js
-
Provides utility functions for adding automatic tag closing - to XML modes. See - the demo.
- -
edit/continuelist.js
-
Markdown specific. Defines - a "newlineAndIndentContinueMarkdownList" command - command that can be bound to enter to automatically - insert the leading characters for continuing a list. See - the Markdown mode - demo.
- -
comment/comment.js
-
Addon for commenting and uncommenting code. Adds three - methods to CodeMirror instances: -
-
lineComment(from: {line, ch}, to: {line, ch}, ?options: object)
-
Set the lines in the given range to be line comments. Will - fall back to blockComment when no line comment - style is defined for the mode.
-
blockComment(from: {line, ch}, to: {line, ch}, ?options: object)
-
Wrap the code in the given range in a block comment. Will - fall back to lineComment when no block comment - style is defined for the mode.
-
uncomment(from: {line, ch}, to: {line, ch}, ?options: object) → boolean
-
Try to uncomment the given range. - Returns true if a comment range was found and - removed, false otherwise.
-
- The options object accepted by these methods may - have the following properties: -
-
blockCommentStart, blockCommentEnd, blockCommentLead, lineComment: string
-
Override the comment string - properties of the mode with custom comment strings.
-
padding: string
-
A string that will be inserted after opening and before - closing comment markers. Defaults to a single space.
-
commentBlankLines: boolean
-
Whether, when adding line comments, to also comment lines - that contain only whitespace.
-
indent: boolean
-
When adding line comments and this is turned on, it will - align the comment block to the current indentation of the - first line of the block.
-
fullLines: boolean
-
When block commenting, this controls whether the whole - lines are indented, or only the precise range that is given. - Defaults to true.
-
- The addon also defines - a toggleComment command, - which will try to uncomment the current selection, and if that - fails, line-comments it.
- -
fold/foldcode.js
-
Helps with code folding. Adds a foldCode method - to editor instances, which will try to do a code fold starting - at the given line, or unfold the fold that is already present. - The method takes as first argument the position that should be - folded (may be a line number or - a Pos), and as second optional - argument either a range-finder function, or an options object, - supporting the following properties: -
-
rangeFinder: fn(CodeMirror, Pos)
-
The function that is used to find - foldable ranges. If this is not directly passed, it will - default to CodeMirror.fold.auto, which - uses getHelpers with - a "fold" type to find folding functions - appropriate for the local mode. There are files in - the addon/fold/ - directory providing CodeMirror.fold.brace, which - finds blocks in brace languages (JavaScript, C, Java, - etc), CodeMirror.fold.indent, for languages where - indentation determines block structure (Python, Haskell), - and CodeMirror.fold.xml, for XML-style languages, - and CodeMirror.fold.comment, for folding comment - blocks.
-
widget: string|Element
-
The widget to show for folded ranges. Can be either a - string, in which case it'll become a span with - class CodeMirror-foldmarker, or a DOM node.
-
scanUp: boolean
-
When true (default is false), the addon will try to find - foldable ranges on the lines above the current one if there - isn't an eligible one on the given line.
-
minFoldSize: integer
-
The minimum amount of lines that a fold should span to be - accepted. Defaults to 0, which also allows single-line - folds.
-
- See the demo for an - example.
- -
fold/foldgutter.js
-
Provides an option foldGutter, which can be - used to create a gutter with markers indicating the blocks that - can be folded. Create a gutter using - the gutters option, - giving it the class CodeMirror-foldgutter or - something else if you configure the addon to use a different - class, and this addon will show markers next to folded and - foldable blocks, and handle clicks in this gutter. Note that - CSS styles should be applied to make the gutter, and the fold - markers within it, visible. A default set of CSS styles are - available in: - - addon/fold/foldgutter.css - . - The option - can be either set to true, or an object containing - the following optional option fields: -
-
gutter: string
-
The CSS class of the gutter. Defaults - to "CodeMirror-foldgutter". You will have to - style this yourself to give it a width (and possibly a - background). See the default gutter style rules above.
-
indicatorOpen: string | Element
-
A CSS class or DOM element to be used as the marker for - open, foldable blocks. Defaults - to "CodeMirror-foldgutter-open".
-
indicatorFolded: string | Element
-
A CSS class or DOM element to be used as the marker for - folded blocks. Defaults to "CodeMirror-foldgutter-folded".
-
rangeFinder: fn(CodeMirror, Pos)
-
The range-finder function to use when determining whether - something can be folded. When not - given, CodeMirror.fold.auto - will be used as default.
-
- Demo here.
- -
runmode/runmode.js
-
Can be used to run a CodeMirror mode over text without - actually opening an editor instance. - See the demo for an example. - There are alternate versions of the file avaible for - running stand-alone - (without including all of CodeMirror) and - for running under - node.js.
- -
runmode/colorize.js
-
Provides a convenient way to syntax-highlight code snippets - in a webpage. Depends on - the runmode addon (or - its standalone variant). Provides - a CodeMirror.colorize function that can be called - with an array (or other array-ish collection) of DOM nodes that - represent the code snippets. By default, it'll get - all pre tags. Will read the data-lang - attribute of these nodes to figure out their language, and - syntax-color their content using the relevant CodeMirror mode - (you'll have to load the scripts for the relevant modes - yourself). A second argument may be provided to give a default - mode, used when no language attribute is found for a node. Used - in this manual to highlight example code.
- -
mode/overlay.js
-
Mode combinator that can be used to extend a mode with an - 'overlay' — a secondary mode is run over the stream, along with - the base mode, and can color specific pieces of text without - interfering with the base mode. - Defines CodeMirror.overlayMode, which is used to - create such a mode. See this - demo for a detailed example.
- -
mode/multiplex.js
-
Mode combinator that can be used to easily 'multiplex' - between several modes. - Defines CodeMirror.multiplexingMode which, when - given as first argument a mode object, and as other arguments - any number of {open, close, mode [, delimStyle, innerStyle]} - objects, will return a mode object that starts parsing using the - mode passed as first argument, but will switch to another mode - as soon as it encounters a string that occurs in one of - the open fields of the passed objects. When in a - sub-mode, it will go back to the top mode again when - the close string is encountered. - Pass "\n" for open or close - if you want to switch on a blank line. -
  • When delimStyle is specified, it will be the token - style returned for the delimiter tokens.
  • -
  • When innerStyle is specified, it will be the token - style added for each inner mode token.
- The outer mode will not see the content between the delimiters. - See this demo for an - example.
- -
hint/show-hint.js
-
Provides a framework for showing autocompletion hints. - Defines CodeMirror.showHint, which takes a - CodeMirror instance, a hinting function, and optionally an - options object, and pops up a widget that allows the user to - select a completion. Hinting functions are function that take an - editor instance and an optional options object, and return - a {list, from, to} object, where list - is an array of strings or objects (the completions), - and from and to give the start and end - of the token that is being completed as {line, ch} - objects.
-
If no hinting function is given, the addon will - use CodeMirror.hint.auto, with - calls getHelpers with - the "hint" type to find applicable hinting - functions, and tries them one by one. If that fails, it looks - for a "hintWords" helper to fetch a list of - completable words for the mode, and - uses CodeMirror.hint.fromList to complete from - those.
-
When completions - aren't simple strings, they should be objects with the following - properties: -
-
text: string
-
The completion text. This is the only required - property.
-
displayText: string
-
The text that should be displayed in the menu.
-
className: string
-
A CSS class name to apply to the completion's line in the - menu.
-
render: fn(Element, self, data)
-
A method used to create the DOM structure for showing the - completion by appending it to its first argument.
-
hint: fn(CodeMirror, self, data)
-
A method used to actually apply the completion, instead of - the default behavior.
-
from: {line, ch}
-
Optional from position that will be used by pick() instead - of the global one passed with the full list of completions.
-
to: {line, ch}
-
Optional to position that will be used by pick() instead - of the global one passed with the full list of completions.
-
- The plugin understands the following options (the options object - will also be passed along to the hinting function, which may - understand additional options): -
-
async: boolean
-
When set to true, the hinting function's signature should - be (cm, callback, ?options), and the completion - interface will only be popped up when the hinting function - calls the callback, passing it the object holding the - completions.
-
completeSingle: boolean
-
Determines whether, when only a single completion is - available, it is completed without showing the dialog. - Defaults to true.
-
alignWithWord: boolean
-
Whether the pop-up should be horizontally aligned with the - start of the word (true, default), or with the cursor (false).
-
closeOnUnfocus: boolean
-
When enabled (which is the default), the pop-up will close - when the editor is unfocused.
-
customKeys: keymap
-
Allows you to provide a custom keymap of keys to be active - when the pop-up is active. The handlers will be called with an - extra argument, a handle to the completion menu, which - has moveFocus(n), setFocus(n), pick(), - and close() methods (see the source for details), - that can be used to change the focused element, pick the - current element or close the menu. Additionnaly menuSize() - can give you access to the size of the current dropdown menu, - length give you the number of availlable completions, and - data give you full access to the completion returned by the - hinting function.
-
extraKeys: keymap
-
Like customKeys above, but the bindings will - be added to the set of default bindings, instead of replacing - them.
-
- The following events will be fired on the completions object - during completion: -
-
"shown" ()
-
Fired when the pop-up is shown.
-
"select" (completion, Element)
-
Fired when a completion is selected. Passed the completion - value (string or object) and the DOM node that represents it - in the menu.
-
"pick" (completion)
-
Fired when a completion is picked. Passed the completion value - (string or object).
-
"close" ()
-
Fired when the completion is finished.
-
- This addon depends styles - from addon/hint/show-hint.css. Check - out the demo for an - example.
- -
hint/javascript-hint.js
-
Defines a simple hinting function for JavaScript - (CodeMirror.hint.javascript) and CoffeeScript - (CodeMirror.hint.coffeescript) code. This will - simply use the JavaScript environment that the editor runs in as - a source of information about objects and their properties.
- -
hint/xml-hint.js
-
Defines CodeMirror.hint.xml, which produces - hints for XML tagnames, attribute names, and attribute values, - guided by a schemaInfo option (a property of the - second argument passed to the hinting function, or the third - argument passed to CodeMirror.showHint).
The - schema info should be an object mapping tag names to information - about these tags, with optionally a "!top" property - containing a list of the names of valid top-level tags. The - values of the properties should be objects with optional - properties children (an array of valid child - element names, omit to simply allow all tags to appear) - and attrs (an object mapping attribute names - to null for free-form attributes, and an array of - valid values for restricted - attributes). Demo - here.
- -
hint/html-hint.js
-
Provides schema info to - the xml-hint addon for HTML - documents. Defines a schema - object CodeMirror.htmlSchema that you can pass to - as a schemaInfo option, and - a CodeMirror.hint.html hinting function that - automatically calls CodeMirror.hint.xml with this - schema data. See - the demo.
- -
hint/css-hint.js
-
A hinting function for CSS, SCSS, or LESS code. - Defines CodeMirror.hint.css.
- -
hint/python-hint.js
-
A very simple hinting function for Python code. - Defines CodeMirror.hint.python.
- -
hint/anyword-hint.js
-
A very simple hinting function - (CodeMirror.hint.anyword) that simply looks for - words in the nearby code and completes to those. Takes two - optional options, word, a regular expression that - matches words (sequences of one or more character), - and range, which defines how many lines the addon - should scan when completing (defaults to 500).
- -
hint/sql-hint.js
-
A simple SQL hinter. Defines CodeMirror.hint.sql.
- -
search/match-highlighter.js
-
Adds a highlightSelectionMatches option that - can be enabled to highlight all instances of a currently - selected word. Can be set either to true or to an object - containing the following options: minChars, for the - minimum amount of selected characters that triggers a highlight - (default 2), style, for the style to be used to - highlight the matches (default "matchhighlight", - which will correspond to CSS - class cm-matchhighlight), - and showToken which can be set to true - or to a regexp matching the characters that make up a word. When - enabled, it causes the current word to be highlighted when - nothing is selected (defaults to off). - Demo here.
- -
lint/lint.js
-
Defines an interface component for showing linting warnings, - with pluggable warning sources - (see json-lint.js, - javascript-lint.js, - and css-lint.js - in the same directory). Defines a lint option that - can be set to a warning source (for - example CodeMirror.lint.javascript), or - to true, in which - case getHelper with - type "lint" is used to determined a validator - function. Depends on addon/lint/lint.css. A demo - can be found here.
- -
selection/mark-selection.js
-
Causes the selected text to be marked with the CSS class - CodeMirror-selectedtext when the styleSelectedText option - is enabled. Useful to change the colour of the selection (in addition to the background), - like in this demo.
- -
selection/active-line.js
-
Defines a styleActiveLine option that, when enabled, - gives the wrapper of the active line the class CodeMirror-activeline, - and adds a background with the class CodeMirror-activeline-background. - is enabled. See the demo.
- -
mode/loadmode.js
-
Defines a CodeMirror.requireMode(modename, - callback) function that will try to load a given mode and - call the callback when it succeeded. You'll have to - set CodeMirror.modeURL to a string that mode paths - can be constructed from, for - example "mode/%N/%N.js"—the %N's will - be replaced with the mode name. Also - defines CodeMirror.autoLoadMode(instance, mode), - which will ensure the given mode is loaded and cause the given - editor instance to refresh its mode when the loading - succeeded. See the demo.
- -
comment/continuecomment.js
-
Adds a continueComments option, which sets whether the - editor will make the next line continue a comment when you press Enter - inside a comment block. Can be set to a boolean to enable/disable this - functionality. Set to a string, it will continue comments using a custom - shortcut. Set to an object, it will use the key property for - a custom shortcut and the boolean continueLineComment - property to determine whether single-line comments should be continued - (defaulting to true).
- -
display/placeholder.js
-
Adds a placeholder option that can be used to - make text appear in the editor when it is empty and not focused. - Also gives the editor a CodeMirror-empty CSS class - whenever it doesn't contain any text. - See the demo.
- -
display/fullscreen.js
-
Defines an option fullScreen that, when set - to true, will make the editor full-screen (as in, - taking up the whole browser window). Depends - on fullscreen.css. Demo - here.
- -
display/rulers.js
-
Adds a rulers option, which can be used to show - one or more vertical rulers in the editor. The option, if - defined, should be given an array of {column, - className} objects or numbers. The ruler will be - displayed at the column indicated by the number or - the column property. The className - property can be used to assign a custom style to a - ruler. Demo here.
- -
wrap/hardwrap.js
-
Addon to perform hard line wrapping/breaking for paragraphs - of text. Adds these methods to editor instances: -
-
wrapParagraph(?pos: {line, ch}, ?options: object)
-
Wraps the paragraph at the given position. - If pos is not given, it defaults to the cursor - position.
-
wrapRange(from: {line, ch}, to: {line, ch}, ?options: object)
-
Wraps the given range as one big paragraph.
-
wrapParagraphsInRange(from: {line, ch}, to: {line, ch}, ?options: object)
-
Wrapps the paragraphs in (and overlapping with) the - given range individually.
-
- The following options are recognized: -
-
paragraphStart, paragraphEnd: RegExp
-
Blank lines are always considered paragraph boundaries. - These options can be used to specify a pattern that causes - lines to be considered the start or end of a paragraph.
-
column: number
-
The column to wrap at. Defaults to 80.
-
wrapOn: RegExp
-
A regular expression that matches only those - two-character strings that allow wrapping. By default, the - addon wraps on whitespace and after dash characters.
-
killTrailingSpace: boolean
-
Whether trailing space caused by wrapping should be - preserved, or deleted. Defaults to true.
-
- A demo of the addon is available here. -
- -
merge/merge.js
-
Implements an interface for merging changes, using either a - 2-way or a 3-way view. The CodeMirror.MergeView - constructor takes arguments similar to - the CodeMirror - constructor, first a node to append the interface to, and then - an options object. Two extra optional options are - recognized, origLeft and origRight, - which may be strings that provide original versions of the - document, which will be shown to the left and right of the - editor in non-editable CodeMirror instances. The merge interface - will highlight changes between the editable document and the - original(s) (demo).
- -
tern/tern.js
-
Provides integration with - the Tern JavaScript analysis - engine, for completion, definition finding, and minor - refactoring help. See the demo - for a very simple integration. For more involved scenarios, see - the comments at the top of - the addon and the - implementation of the - (multi-file) demonstration - on the Tern website.
-
-
- -
-

Writing CodeMirror Modes

- -

Modes typically consist of a single JavaScript file. This file - defines, in the simplest case, a lexer (tokenizer) for your - language—a function that takes a character stream as input, - advances it past a token, and returns a style for that token. More - advanced modes can also handle indentation for the language.

- -

The mode script should - call CodeMirror.defineMode to - register itself with CodeMirror. This function takes two - arguments. The first should be the name of the mode, for which you - should use a lowercase string, preferably one that is also the - name of the files that define the mode (i.e. "xml" is - defined in xml.js). The second argument should be a - function that, given a CodeMirror configuration object (the thing - passed to the CodeMirror function) and an optional - mode configuration object (as in - the mode option), returns - a mode object.

- -

Typically, you should use this second argument - to defineMode as your module scope function (modes - should not leak anything into the global scope!), i.e. write your - whole mode inside this function.

- -

The main responsibility of a mode script is parsing - the content of the editor. Depending on the language and the - amount of functionality desired, this can be done in really easy - or extremely complicated ways. Some parsers can be stateless, - meaning that they look at one element (token) of the code - at a time, with no memory of what came before. Most, however, will - need to remember something. This is done by using a state - object, which is an object that is always passed when - reading a token, and which can be mutated by the tokenizer.

- -

Modes that use a state must define - a startState method on their mode - object. This is a function of no arguments that produces a state - object to be used at the start of a document.

- -

The most important part of a mode object is - its token(stream, state) method. All - modes must define this method. It should read one token from the - stream it is given as an argument, optionally update its state, - and return a style string, or null for tokens that do - not have to be styled. For your styles, you are encouraged to use - the 'standard' names defined in the themes (without - the cm- prefix). If that fails, it is also possible - to come up with your own and write your own CSS theme file.

- -

A typical token string would - be "variable" or "comment". Multiple - styles can be returned (separated by spaces), for - example "string error" for a thing that looks like a - string but is invalid somehow (say, missing its closing quote). - When a style is prefixed by "line-" - or "line-background-", the style will be applied to - the whole line, analogous to what - the addLineClass method - does—styling the "text" in the simple case, and - the "background" element - when "line-background-" is prefixed.

- -

The stream object that's passed - to token encapsulates a line of code (tokens may - never span lines) and our current position in that line. It has - the following API:

- -
-
eol() → boolean
-
Returns true only if the stream is at the end of the - line.
-
sol() → boolean
-
Returns true only if the stream is at the start of the - line.
- -
peek() → string
-
Returns the next character in the stream without advancing - it. Will return an null at the end of the - line.
-
next() → string
-
Returns the next character in the stream and advances it. - Also returns null when no more characters are - available.
- -
eat(match: string|regexp|function(char: string) → boolean) → string
-
match can be a character, a regular expression, - or a function that takes a character and returns a boolean. If - the next character in the stream 'matches' the given argument, - it is consumed and returned. Otherwise, undefined - is returned.
-
eatWhile(match: string|regexp|function(char: string) → boolean) → boolean
-
Repeatedly calls eat with the given argument, - until it fails. Returns true if any characters were eaten.
-
eatSpace() → boolean
-
Shortcut for eatWhile when matching - white-space.
-
skipToEnd()
-
Moves the position to the end of the line.
-
skipTo(ch: string) → boolean
-
Skips to the next occurrence of the given character, if - found on the current line (doesn't advance the stream if the - character does not occur on the line). Returns true if the - character was found.
-
match(pattern: string, ?consume: boolean, ?caseFold: boolean) → boolean
-
match(pattern: regexp, ?consume: boolean) → array<string>
-
Act like a - multi-character eat—if consume is true - or not given—or a look-ahead that doesn't update the stream - position—if it is false. pattern can be either a - string or a regular expression starting with ^. - When it is a string, caseFold can be set to true to - make the match case-insensitive. When successfully matching a - regular expression, the returned value will be the array - returned by match, in case you need to extract - matched groups.
- -
backUp(n: integer)
-
Backs up the stream n characters. Backing it up - further than the start of the current token will cause things to - break, so be careful.
-
column() → integer
-
Returns the column (taking into account tabs) at which the - current token starts.
-
indentation() → integer
-
Tells you how far the current line has been indented, in - spaces. Corrects for tab characters.
- -
current() → string
-
Get the string between the start of the current token and - the current stream position.
-
- -

By default, blank lines are simply skipped when - tokenizing a document. For languages that have significant blank - lines, you can define - a blankLine(state) method on your - mode that will get called whenever a blank line is passed over, so - that it can update the parser state.

- -

Because state object are mutated, and CodeMirror - needs to keep valid versions of a state around so that it can - restart a parse at any line, copies must be made of state objects. - The default algorithm used is that a new state object is created, - which gets all the properties of the old object. Any properties - which hold arrays get a copy of these arrays (since arrays tend to - be used as mutable stacks). When this is not correct, for example - because a mode mutates non-array properties of its state object, a - mode object should define - a copyState method, which is given a - state and should return a safe copy of that state.

- -

If you want your mode to provide smart indentation - (through the indentLine - method and the indentAuto - and newlineAndIndent commands, to which keys can be - bound), you must define - an indent(state, textAfter) method - on your mode object.

- -

The indentation method should inspect the given state object, - and optionally the textAfter string, which contains - the text on the line that is being indented, and return an - integer, the amount of spaces to indent. It should usually take - the indentUnit - option into account. An indentation method may - return CodeMirror.Pass to indicate that it - could not come up with a precise indentation.

- -

To work well with - the commenting addon, a mode may - define lineComment (string that - starts a line - comment), blockCommentStart, blockCommentEnd - (strings that start and end block comments), - and blockCommentLead (a string to put at the start of - continued lines in a block comment). All of these are - optional.

- -

Finally, a mode may define - an electricChars property, which should hold a string - containing all the characters that should trigger the behaviour - described for - the electricChars - option.

- -

So, to summarize, a mode must provide - a token method, and it may - provide startState, copyState, - and indent methods. For an example of a trivial mode, - see the diff mode, for a more - involved example, see the C-like - mode.

- -

Sometimes, it is useful for modes to nest—to have one - mode delegate work to another mode. An example of this kind of - mode is the mixed-mode HTML - mode. To implement such nesting, it is usually necessary to - create mode objects and copy states yourself. To create a mode - object, there are CodeMirror.getMode(options, - parserConfig), where the first argument is a configuration - object as passed to the mode constructor function, and the second - argument is a mode specification as in - the mode option. To copy a - state object, call CodeMirror.copyState(mode, state), - where mode is the mode that created the given - state.

- -

In a nested mode, it is recommended to add an - extra method, innerMode which, given - a state object, returns a {state, mode} object with - the inner mode and its state for the current position. These are - used by utility scripts such as the tag - closer to get context information. Use - the CodeMirror.innerMode helper function to, starting - from a mode and a state, recursively walk down to the innermost - mode and state.

- -

To make indentation work properly in a nested parser, it is - advisable to give the startState method of modes that - are intended to be nested an optional argument that provides the - base indentation for the block of code. The JavaScript and CSS - parser do this, for example, to allow JavaScript and CSS code - inside the mixed-mode HTML mode to be properly indented.

- -

It is possible, and encouraged, to associate - your mode, or a certain configuration of your mode, with - a MIME type. For - example, the JavaScript mode associates itself - with text/javascript, and its JSON variant - with application/json. To do this, - call CodeMirror.defineMIME(mime, - modeSpec), where modeSpec can be a string or - object specifying a mode, as in - the mode option.

- -

If a mode specification wants to add some properties to the - resulting mode object, typically for use - with getHelpers, it may - contain a modeProps property, which holds an object. - This object's properties will be copied to the actual mode - object.

- -

Sometimes, it is useful to add or override mode - object properties from external code. - The CodeMirror.extendMode function - can be used to add properties to mode objects produced for a - specific mode. Its first argument is the name of the mode, its - second an object that specifies the properties that should be - added. This is mostly useful to add utilities that can later be - looked up through getMode.

-
- -
- - diff --git a/ajax/libs/codemirror/3.24.0/package/doc/realworld.html b/ajax/libs/codemirror/3.24.0/package/doc/realworld.html deleted file mode 100644 index 08f026785..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/realworld.html +++ /dev/null @@ -1,145 +0,0 @@ - - -CodeMirror: Real-world Uses - - - - - -
- -

CodeMirror real-world uses

- -

Contact me if you'd like - your project to be added to this list.

- - - -
- diff --git a/ajax/libs/codemirror/3.24.0/package/doc/reporting.html b/ajax/libs/codemirror/3.24.0/package/doc/reporting.html deleted file mode 100644 index 47e37a554..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/reporting.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Reporting Bugs - - - - - -
- -

Reporting bugs effectively

- -
- -

So you found a problem in CodeMirror. By all means, report it! Bug -reports from users are the main drive behind improvements to -CodeMirror. But first, please read over these points:

- -
    -
  1. CodeMirror is maintained by volunteers. They don't owe you - anything, so be polite. Reports with an indignant or belligerent - tone tend to be moved to the bottom of the pile.
  2. - -
  3. Include information about the browser in which the - problem occurred. Even if you tested several browsers, and - the problem occurred in all of them, mention this fact in the bug - report. Also include browser version numbers and the operating - system that you're on.
  4. - -
  5. Mention which release of CodeMirror you're using. Preferably, - try also with the current development snapshot, to ensure the - problem has not already been fixed.
  6. - -
  7. Mention very precisely what went wrong. "X is broken" is not a - good bug report. What did you expect to happen? What happened - instead? Describe the exact steps a maintainer has to take to make - the problem occur. We can not fix something that we can not - observe.
  8. - -
  9. If the problem can not be reproduced in any of the demos - included in the CodeMirror distribution, please provide an HTML - document that demonstrates the problem. The best way to do this is - to go to jsbin.com, enter - it there, press save, and include the resulting link in your bug - report.
  10. -
- -
- -
diff --git a/ajax/libs/codemirror/3.24.0/package/doc/upgrade_v2.2.html b/ajax/libs/codemirror/3.24.0/package/doc/upgrade_v2.2.html deleted file mode 100644 index a2dddef76..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/upgrade_v2.2.html +++ /dev/null @@ -1,96 +0,0 @@ - - -CodeMirror: Version 2.2 upgrade guide - - - - - -
- -

Upgrading to v2.2

- -

There are a few things in the 2.2 release that require some care -when upgrading.

- -

No more default.css

- -

The default theme is now included -in codemirror.css, so -you do not have to included it separately anymore. (It was tiny, so -even if you're not using it, the extra data overhead is negligible.) - -

Different key customization

- -

CodeMirror has moved to a system -where keymaps are used to -bind behavior to keys. This means custom -bindings are now possible.

- -

Three options that influenced key -behavior, tabMode, enterMode, -and smartHome, are no longer supported. Instead, you can -provide custom bindings to influence the way these keys act. This is -done through the -new extraKeys -option, which can hold an object mapping key names to functionality. A -simple example would be:

- -
  extraKeys: {
-    "Ctrl-S": function(instance) { saveText(instance.getValue()); },
-    "Ctrl-/": "undo"
-  }
- -

Keys can be mapped either to functions, which will be given the -editor instance as argument, or to strings, which are mapped through -functions through the CodeMirror.commands table, which -contains all the built-in editing commands, and can be inspected and -extended by external code.

- -

By default, the Home key is bound to -the "goLineStartSmart" command, which moves the cursor to -the first non-whitespace character on the line. You can set do this to -make it always go to the very start instead:

- -
  extraKeys: {"Home": "goLineStart"}
- -

Similarly, Enter is bound -to "newlineAndIndent" by default. You can bind it to -something else to get different behavior. To disable special handling -completely and only get a newline character inserted, you can bind it -to false:

- -
  extraKeys: {"Enter": false}
- -

The same works for Tab. If you don't want CodeMirror -to handle it, bind it to false. The default behaviour is -to indent the current line more ("indentMore" command), -and indent it less when shift is held ("indentLess"). -There are also "indentAuto" (smart indent) -and "insertTab" commands provided for alternate -behaviors. Or you can write your own handler function to do something -different altogether.

- -

Tabs

- -

Handling of tabs changed completely. The display width of tabs can -now be set with the tabSize option, and tabs can -be styled by setting CSS rules -for the cm-tab class.

- -

The default width for tabs is now 4, as opposed to the 8 that is -hard-wired into browsers. If you are relying on 8-space tabs, make -sure you explicitly set tabSize: 8 in your options.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/doc/upgrade_v3.html b/ajax/libs/codemirror/3.24.0/package/doc/upgrade_v3.html deleted file mode 100644 index 19757924c..000000000 --- a/ajax/libs/codemirror/3.24.0/package/doc/upgrade_v3.html +++ /dev/null @@ -1,230 +0,0 @@ - - -CodeMirror: Version 3 upgrade guide - - - - - - - - - - - - - - -
- -

Upgrading to version 3

- -

Version 3 does not depart too much from 2.x API, and sites that use -CodeMirror in a very simple way might be able to upgrade without -trouble. But it does introduce a number of incompatibilities. Please -at least skim this text before upgrading.

- -

Note that version 3 drops full support for Internet -Explorer 7. The editor will mostly work on that browser, but -it'll be significantly glitchy.

- -
-

DOM structure

- -

This one is the most likely to cause problems. The internal -structure of the editor has changed quite a lot, mostly to implement a -new scrolling model.

- -

Editor height is now set on the outer wrapper element (CSS -class CodeMirror), not on the scroller element -(CodeMirror-scroll).

- -

Other nodes were moved, dropped, and added. If you have any code -that makes assumptions about the internal DOM structure of the editor, -you'll have to re-test it and probably update it to work with v3.

- -

See the styling section of the -manual for more information.

-
-
-

Gutter model

- -

In CodeMirror 2.x, there was a single gutter, and line markers -created with setMarker would have to somehow coexist with -the line numbers (if present). Version 3 allows you to specify an -array of gutters, by class -name, -use setGutterMarker -to add or remove markers in individual gutters, and clear whole -gutters -with clearGutter. -Gutter markers are now specified as DOM nodes, rather than HTML -snippets.

- -

The gutters no longer horizontally scrolls along with the content. -The fixedGutter option was removed (since it is now the -only behavior).

- -
-<style>
-  /* Define a gutter style */
-  .note-gutter { width: 3em; background: cyan; }
-</style>
-<script>
-  // Create an instance with two gutters -- line numbers and notes
-  var cm = new CodeMirror(document.body, {
-    gutters: ["note-gutter", "CodeMirror-linenumbers"],
-    lineNumbers: true
-  });
-  // Add a note to line 0
-  cm.setGutterMarker(0, "note-gutter", document.createTextNode("hi"));
-</script>
-
-
-
-

Event handling

- -

Most of the onXYZ options have been removed. The same -effect is now obtained by calling -the on method with a string -identifying the event type. Multiple handlers can now be registered -(and individually unregistered) for an event, and objects such as line -handlers now also expose events. See the -full list here.

- -

(The onKeyEvent and onDragEvent options, -which act more as hooks than as event handlers, are still there in -their old form.)

- -
-cm.on("change", function(cm, change) {
-  console.log("something changed! (" + change.origin + ")");
-});
-
-
-
-

markText method arguments

- -

The markText method -(which has gained some interesting new features, such as creating -atomic and read-only spans, or replacing spans with widgets) no longer -takes the CSS class name as a separate argument, but makes it an -optional field in the options object instead.

- -
-// Style first ten lines, and forbid the cursor from entering them
-cm.markText({line: 0, ch: 0}, {line: 10, ch: 0}, {
-  className: "magic-text",
-  inclusiveLeft: true,
-  atomic: true
-});
-
-
-
-

Line folding

- -

The interface for hiding lines has been -removed. markText can -now be used to do the same in a more flexible and powerful way.

- -

The folding script has been -updated to use the new interface, and should now be more robust.

- -
-// Fold a range, replacing it with the text "??"
-var range = cm.markText({line: 4, ch: 2}, {line: 8, ch: 1}, {
-  replacedWith: document.createTextNode("??"),
-  // Auto-unfold when cursor moves into the range
-  clearOnEnter: true
-});
-// Get notified when auto-unfolding
-CodeMirror.on(range, "clear", function() {
-  console.log("boom");
-});
-
-
-
-

Line CSS classes

- -

The setLineClass method has been replaced -by addLineClass -and removeLineClass, -which allow more modular control over the classes attached to a line.

- -
-var marked = cm.addLineClass(10, "background", "highlighted-line");
-setTimeout(function() {
-  cm.removeLineClass(marked, "background", "highlighted-line");
-});
-
-
-
-

Position properties

- -

All methods that take or return objects that represent screen -positions now use {left, top, bottom, right} properties -(not always all of them) instead of the {x, y, yBot} used -by some methods in v2.x.

- -

Affected methods -are cursorCoords, charCoords, coordsChar, -and getScrollInfo.

-
-
-

Bracket matching no longer in core

- -

The matchBrackets -option is no longer defined in the core editor. -Load addon/edit/matchbrackets.js to enable it.

-
-
-

Mode management

- -

The CodeMirror.listModes -and CodeMirror.listMIMEs functions, used for listing -defined modes, are gone. You are now encouraged to simply -inspect CodeMirror.modes (mapping mode names to mode -constructors) and CodeMirror.mimeModes (mapping MIME -strings to mode specs).

-
-
-

New features

- -

Some more reasons to upgrade to version 3.

- -
    -
  • Bi-directional text support. CodeMirror will now mostly do the - right thing when editing Arabic or Hebrew text.
  • -
  • Arbitrary line heights. Using fonts with different heights - inside the editor (whether off by one pixel or fifty) is now - supported and handled gracefully.
  • -
  • In-line widgets. See the demo - and the docs.
  • -
  • Defining custom options - with CodeMirror.defineOption.
  • -
-
-
- - diff --git a/ajax/libs/codemirror/3.24.0/package/mode/apl/index.html b/ajax/libs/codemirror/3.24.0/package/mode/apl/index.html deleted file mode 100644 index f8282ac42..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/apl/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: APL mode - - - - - - - - - - -
-

APL mode

-
- - - -

Simple mode that tries to handle APL as well as it can.

-

It attempts to label functions/operators based upon - monadic/dyadic usage (but this is far from fully fleshed out). - This means there are meaningful classnames so hover states can - have popups etc.

- -

MIME types defined: text/apl (APL code)

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/asterisk/index.html b/ajax/libs/codemirror/3.24.0/package/mode/asterisk/index.html deleted file mode 100644 index 6abdecb50..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/asterisk/index.html +++ /dev/null @@ -1,154 +0,0 @@ - - -CodeMirror: Asterisk dialplan mode - - - - - - - - - -
-

Asterisk dialplan mode

-
- - -

MIME types defined: text/x-asterisk.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/clike/index.html b/ajax/libs/codemirror/3.24.0/package/mode/clike/index.html deleted file mode 100644 index d892fddbd..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/clike/index.html +++ /dev/null @@ -1,200 +0,0 @@ - - -CodeMirror: C-like mode - - - - - - - - - - -
-

C-like mode

- -
- -

C++ example

- -
- -

Java example

- -
- - - -

Simple mode that tries to handle C-like languages as well as it - can. Takes two configuration parameters: keywords, an - object whose property names are the keywords in the language, - and useCPP, which determines whether C preprocessor - directives are recognized.

- -

MIME types defined: text/x-csrc - (C code), text/x-c++src (C++ - code), text/x-java (Java - code), text/x-csharp (C#).

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/clike/scala.html b/ajax/libs/codemirror/3.24.0/package/mode/clike/scala.html deleted file mode 100644 index e9acc049b..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/clike/scala.html +++ /dev/null @@ -1,767 +0,0 @@ - - -CodeMirror: Scala mode - - - - - - - - - - -
-

Scala mode

-
- -
- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/clojure/index.html b/ajax/libs/codemirror/3.24.0/package/mode/clojure/index.html deleted file mode 100644 index 5a50c566f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/clojure/index.html +++ /dev/null @@ -1,88 +0,0 @@ - - -CodeMirror: Clojure mode - - - - - - - - - -
-

Clojure mode

-
- - -

MIME types defined: text/x-clojure.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/cobol/index.html b/ajax/libs/codemirror/3.24.0/package/mode/cobol/index.html deleted file mode 100644 index a6c5c339c..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/cobol/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - -CodeMirror: COBOL mode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

COBOL mode

- -

Select Theme Select Font Size - - - - -

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/commonlisp/index.html b/ajax/libs/codemirror/3.24.0/package/mode/commonlisp/index.html deleted file mode 100644 index d48be8d23..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/commonlisp/index.html +++ /dev/null @@ -1,177 +0,0 @@ - - -CodeMirror: Common Lisp mode - - - - - - - - - -
-

Common Lisp mode

-
- - -

MIME types defined: text/x-common-lisp.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/index.html b/ajax/libs/codemirror/3.24.0/package/mode/css/index.html deleted file mode 100644 index 80ef518e9..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/css/index.html +++ /dev/null @@ -1,70 +0,0 @@ - - -CodeMirror: CSS mode - - - - - - - - - -
-

CSS mode

-
- - -

MIME types defined: text/css, text/x-scss (demo), text/x-less (demo).

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/less.html b/ajax/libs/codemirror/3.24.0/package/mode/css/less.html deleted file mode 100644 index 1030ca43f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/css/less.html +++ /dev/null @@ -1,152 +0,0 @@ - - -CodeMirror: LESS mode - - - - - - - - - - -
-

LESS mode

-
- - -

The LESS mode is a sub-mode of the CSS mode (defined in css.js.

- -

Parsing/Highlighting Tests: normal, verbose.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/css/scss.html b/ajax/libs/codemirror/3.24.0/package/mode/css/scss.html deleted file mode 100644 index 0677d08fe..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/css/scss.html +++ /dev/null @@ -1,157 +0,0 @@ - - -CodeMirror: SCSS mode - - - - - - - - - -
-

SCSS mode

-
- - -

The SCSS mode is a sub-mode of the CSS mode (defined in css.js.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/diff/index.html b/ajax/libs/codemirror/3.24.0/package/mode/diff/index.html deleted file mode 100644 index 6ceae8b33..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/diff/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - -CodeMirror: Diff mode - - - - - - - - - -
-

Diff mode

-
- - -

MIME types defined: text/x-diff.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/django/index.html b/ajax/libs/codemirror/3.24.0/package/mode/django/index.html deleted file mode 100644 index 07963bc61..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/django/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - -CodeMirror: Django template mode - - - - - - - - - - - - -
-

Django template mode

-
- - - -

Mode for HTML with embedded Django template markup.

- -

MIME types defined: text/x-django

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/dtd/index.html b/ajax/libs/codemirror/3.24.0/package/mode/dtd/index.html deleted file mode 100644 index 076d827f7..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/dtd/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: DTD mode - - - - - - - - - -
-

DTD mode

-
- - -

MIME types defined: application/xml-dtd.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/ecl/index.html b/ajax/libs/codemirror/3.24.0/package/mode/ecl/index.html deleted file mode 100644 index f4b612d61..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/ecl/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: ECL mode - - - - - - - - - -
-

ECL mode

-
- - -

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

-

MIME types defined: text/x-ecl.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/erlang/index.html b/ajax/libs/codemirror/3.24.0/package/mode/erlang/index.html deleted file mode 100644 index 9cacb759f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/erlang/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - -CodeMirror: Erlang mode - - - - - - - - - - - -
-

Erlang mode

-
- - - -

MIME types defined: text/x-erlang.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/fortran/index.html b/ajax/libs/codemirror/3.24.0/package/mode/fortran/index.html deleted file mode 100644 index efa55ec89..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/fortran/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - -CodeMirror: Fortran mode - - - - - - - - - -
-

Fortran mode

- - -
- - - -

MIME types defined: text/x-Fortran.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gas/index.html b/ajax/libs/codemirror/3.24.0/package/mode/gas/index.html deleted file mode 100644 index cd8a2ff5a..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/gas/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Gas mode - - - - - - - - - -
-

Gas mode

-
- -
- - - -

Handles AT&T assembler syntax (more specifically this handles - the GNU Assembler (gas) syntax.) - It takes a single optional configuration parameter: - architecture, which can be one of "ARM", - "ARMv6" or "x86". - Including the parameter adds syntax for the registers and special - directives for the supplied architecture. - -

MIME types defined: text/x-gas

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gfm/index.html b/ajax/libs/codemirror/3.24.0/package/mode/gfm/index.html deleted file mode 100644 index b71cd5c75..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/gfm/index.html +++ /dev/null @@ -1,82 +0,0 @@ - - -CodeMirror: GFM mode - - - - - - - - - - - - - - - - -
-

GFM mode

-
- - - -

Optionally depends on other modes for properly highlighted code blocks.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/gherkin/index.html b/ajax/libs/codemirror/3.24.0/package/mode/gherkin/index.html deleted file mode 100644 index b76877acd..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/gherkin/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - -CodeMirror: Gherkin mode - - - - - - - - - -
-

Gherkin mode

-
- - -

MIME types defined: text/x-feature.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/go/index.html b/ajax/libs/codemirror/3.24.0/package/mode/go/index.html deleted file mode 100644 index 3673fa0b0..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/go/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Go mode - - - - - - - - - - - -
-

Go mode

-
- - - -

MIME type: text/x-go

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/groovy/index.html b/ajax/libs/codemirror/3.24.0/package/mode/groovy/index.html deleted file mode 100644 index f5efdf758..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/groovy/index.html +++ /dev/null @@ -1,84 +0,0 @@ - - -CodeMirror: Groovy mode - - - - - - - - - - -
-

Groovy mode

-
- - - -

MIME types defined: text/x-groovy

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haml/index.html b/ajax/libs/codemirror/3.24.0/package/mode/haml/index.html deleted file mode 100644 index a73787554..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/haml/index.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: HAML mode - - - - - - - - - - - - - -
-

HAML mode

-
- - -

MIME types defined: text/x-haml.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haskell/index.html b/ajax/libs/codemirror/3.24.0/package/mode/haskell/index.html deleted file mode 100644 index 056b01d46..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/haskell/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: Haskell mode - - - - - - - - - - - -
-

Haskell mode

-
- - - -

MIME types defined: text/x-haskell.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/haxe/index.html b/ajax/libs/codemirror/3.24.0/package/mode/haxe/index.html deleted file mode 100644 index ec3b8e0e7..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/haxe/index.html +++ /dev/null @@ -1,103 +0,0 @@ - - -CodeMirror: Haxe mode - - - - - - - - - -
-

Haxe mode

- - -
- - - -

MIME types defined: text/x-haxe.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/htmlembedded/index.html b/ajax/libs/codemirror/3.24.0/package/mode/htmlembedded/index.html deleted file mode 100644 index fee119683..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/htmlembedded/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - -CodeMirror: Html Embedded Scripts mode - - - - - - - - - - - - - -
-

Html Embedded Scripts mode

-
- - - -

Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on - JavaScript, CSS and XML.
Other dependancies include those of the scriping language chosen.

- -

MIME types defined: application/x-aspx (ASP.NET), - application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/htmlmixed/index.html b/ajax/libs/codemirror/3.24.0/package/mode/htmlmixed/index.html deleted file mode 100644 index bd06bb504..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/htmlmixed/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: HTML mixed mode - - - - - - - - - - - - - -
-

HTML mixed mode

-
- - -

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

- -

It takes an optional mode configuration - option, scriptTypes, which can be used to add custom - behavior for specific <script type="..."> tags. If - given, it should hold an array of {matches, mode} - objects, where matches is a string or regexp that - matches the script type, and mode is - either null, for script types that should stay in - HTML mode, or a mode - spec corresponding to the mode that should be used for the - script.

- -

MIME types defined: text/html - (redefined, only takes effect if you load this parser after the - XML parser).

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/http/index.html b/ajax/libs/codemirror/3.24.0/package/mode/http/index.html deleted file mode 100644 index 705085e22..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/http/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: HTTP mode - - - - - - - - - -
-

HTTP mode

- - -
- - - -

MIME types defined: message/http.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/index.html b/ajax/libs/codemirror/3.24.0/package/mode/index.html deleted file mode 100644 index de39f9dd5..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - -CodeMirror: Language Modes - - - - - -
- -

Language modes

- -

This is a list of every mode in the distribution. Each mode lives -in a subdirectory of the mode/ directory, and typically -defines a single JavaScript file that implements the mode. Loading -such file will make the language available to CodeMirror, through -the mode -option.

- -
- -
- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/jade/index.html b/ajax/libs/codemirror/3.24.0/package/mode/jade/index.html deleted file mode 100644 index e22b15e65..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/jade/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Jade Templating Mode - - - - - - - - - -
-

Jade Templating Mode

-
- -

The Jade Templating Mode

-

Created by Drew Bratcher. Managed as part of an Adobe Brackets extension at https://github.com/dbratcher/brackets-jade.

-

MIME type defined: text/x-jade.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/javascript/index.html b/ajax/libs/codemirror/3.24.0/package/mode/javascript/index.html deleted file mode 100644 index faf50363e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/javascript/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - -CodeMirror: JavaScript mode - - - - - - - - - - - - -
-

JavaScript mode

- - -
- - - -

- JavaScript mode supports several configuration options: -

    -
  • json which will set the mode to expect JSON - data rather than a JavaScript program.
  • -
  • jsonld which will set the mode to expect - JSON-LD linked data rather - than a JavaScript program (demo).
  • -
  • typescript which will activate additional - syntax highlighting and some other things for TypeScript code - (demo).
  • -
  • statementIndent which (given a number) will - determine the amount of indentation to use for statements - continued on a new line.
  • -
-

- -

MIME types defined: text/javascript, application/json, application/ld+json, text/typescript, application/typescript.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/javascript/json-ld.html b/ajax/libs/codemirror/3.24.0/package/mode/javascript/json-ld.html deleted file mode 100644 index 256bb0f62..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/javascript/json-ld.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: JSON-LD mode - - - - - - - - - - - - -
-

JSON-LD mode

- - -
- - - -

This is a specialization of the JavaScript mode.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/javascript/typescript.html b/ajax/libs/codemirror/3.24.0/package/mode/javascript/typescript.html deleted file mode 100644 index 9cc5f4932..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/javascript/typescript.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: TypeScript mode - - - - - - - - - -
-

TypeScript mode

- - -
- - - -

This is a specialization of the JavaScript mode.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/jinja2/index.html b/ajax/libs/codemirror/3.24.0/package/mode/jinja2/index.html deleted file mode 100644 index c99daf6c4..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/jinja2/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - -CodeMirror: Jinja2 mode - - - - - - - - - -
-

Jinja2 mode

-
- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/julia/index.html b/ajax/libs/codemirror/3.24.0/package/mode/julia/index.html deleted file mode 100644 index 945e1a91f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/julia/index.html +++ /dev/null @@ -1,186 +0,0 @@ - - -CodeMirror: Julia mode - - - - - - - - - -
-

Julia mode

- -
- - -

MIME types defined: text/x-julia.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/less/index.html b/ajax/libs/codemirror/3.24.0/package/mode/less/index.html deleted file mode 100644 index 7239143c8..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/less/index.html +++ /dev/null @@ -1,753 +0,0 @@ - - -CodeMirror: LESS mode - - - - - - - - - - - -
-

LESS mode

-
- - -

MIME types defined: text/x-less, text/css (if not previously defined).

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/livescript/index.html b/ajax/libs/codemirror/3.24.0/package/mode/livescript/index.html deleted file mode 100644 index 3ce897485..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/livescript/index.html +++ /dev/null @@ -1,459 +0,0 @@ - - -CodeMirror: LiveScript mode - - - - - - - - - - -
-

LiveScript mode

-
- - -

MIME types defined: text/x-livescript.

- -

The LiveScript mode was written by Kenneth Bentley.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/lua/index.html b/ajax/libs/codemirror/3.24.0/package/mode/lua/index.html deleted file mode 100644 index 7f4eb2c84..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/lua/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Lua mode - - - - - - - - - - - -
-

Lua mode

-
- - -

Loosely based on Franciszek - Wawrzak's CodeMirror - 1 mode. One configuration parameter is - supported, specials, to which you can provide an - array of strings to have those identifiers highlighted with - the lua-special style.

-

MIME types defined: text/x-lua.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/mirc/index.html b/ajax/libs/codemirror/3.24.0/package/mode/mirc/index.html deleted file mode 100644 index c346f1c7e..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/mirc/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - -CodeMirror: mIRC mode - - - - - - - - - - -
-

mIRC mode

-
- - -

MIME types defined: text/mirc.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/mllike/index.html b/ajax/libs/codemirror/3.24.0/package/mode/mllike/index.html deleted file mode 100644 index 67bfef858..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/mllike/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - -CodeMirror: ML-like mode - - - - - - - - - - -
-

OCaml mode

- - - - -

F# mode

- - - - - -

MIME types defined: text/x-ocaml (OCaml) and text/x-fsharp (F#).

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/nginx/index.html b/ajax/libs/codemirror/3.24.0/package/mode/nginx/index.html deleted file mode 100644 index 16be1eb61..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/nginx/index.html +++ /dev/null @@ -1,181 +0,0 @@ - - -CodeMirror: NGINX mode - - - - - - - - - - - - - -
-

NGINX mode

-
- - -

MIME types defined: text/nginx.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/ntriples/index.html b/ajax/libs/codemirror/3.24.0/package/mode/ntriples/index.html deleted file mode 100644 index c8a67916d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/ntriples/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: NTriples mode - - - - - - - - - -
-

NTriples mode

-
- -
- - -

MIME types defined: text/n-triples.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/octave/index.html b/ajax/libs/codemirror/3.24.0/package/mode/octave/index.html deleted file mode 100644 index 573ce4238..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/octave/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - -CodeMirror: Octave mode - - - - - - - - - -
-

Octave mode

- -
- - -

MIME types defined: text/x-octave.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/pascal/index.html b/ajax/libs/codemirror/3.24.0/package/mode/pascal/index.html deleted file mode 100644 index bf8ff0d63..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/pascal/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Pascal mode - - - - - - - - - -
-

Pascal mode

- - -
- - - -

MIME types defined: text/x-pascal.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/pegjs/index.html b/ajax/libs/codemirror/3.24.0/package/mode/pegjs/index.html deleted file mode 100644 index 678b714d8..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/pegjs/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - CodeMirror: PEG.js Mode - - - - - - - - - - - - -
-

PEG.js Mode

-
- -

The PEG.js Mode

-

Created by Forbes Lindesay.

-
- - diff --git a/ajax/libs/codemirror/3.24.0/package/mode/perl/index.html b/ajax/libs/codemirror/3.24.0/package/mode/perl/index.html deleted file mode 100644 index 2b7578efe..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/perl/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Perl mode - - - - - - - - - -
-

Perl mode

- - -
- - - -

MIME types defined: text/x-perl.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/php/index.html b/ajax/libs/codemirror/3.24.0/package/mode/php/index.html deleted file mode 100644 index dd25a5e78..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/php/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: PHP mode - - - - - - - - - - - - - - - -
-

PHP mode

-
- - - -

Simple HTML/PHP mode based on - the C-like mode. Depends on XML, - JavaScript, CSS, HTMLMixed, and C-like modes.

- -

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/pig/index.html b/ajax/libs/codemirror/3.24.0/package/mode/pig/index.html deleted file mode 100644 index 93744ae2d..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/pig/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - -CodeMirror: Pig Latin mode - - - - - - - - - -
-

Pig Latin mode

-
- - - -

- Simple mode that handles Pig Latin language. -

- -

MIME type defined: text/x-pig - (PIG code) - -

diff --git a/ajax/libs/codemirror/3.24.0/package/mode/properties/index.html b/ajax/libs/codemirror/3.24.0/package/mode/properties/index.html deleted file mode 100644 index 40ee1a37b..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/properties/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - -CodeMirror: Properties files mode - - - - - - - - - -
-

Properties files mode

-
- - -

MIME types defined: text/x-properties, - text/x-ini.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/python/index.html b/ajax/libs/codemirror/3.24.0/package/mode/python/index.html deleted file mode 100644 index a1d6d2d83..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/python/index.html +++ /dev/null @@ -1,186 +0,0 @@ - - -CodeMirror: Python mode - - - - - - - - - - -
-

Python mode

- -
- - -

Cython mode

- -
- - -

Configuration Options for Python mode:

-
    -
  • version - 2/3 - The version of Python to recognize. Default is 2.
  • -
  • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
  • -
  • hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
  • -
-

Advanced Configuration Options:

-

Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help

-
    -
  • singleOperators - RegEx - Regular Expression for single operator matching, default :
    ^[\\+\\-\\*/%&|\\^~<>!]
  • -
  • singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :
    ^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]
  • -
  • doubleOperators - RegEx - Regular Expression for double operators matching, default :
    ^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))
  • -
  • doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default :
    ^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))
  • -
  • tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default :
    ^((//=)|(>>=)|(<<=)|(\\*\\*=))
  • -
  • identifiers - RegEx - Regular Expression for identifier, default :
    ^[_A-Za-z][_A-Za-z0-9]*
  • -
  • extra_keywords - list of string - List of extra words ton consider as keywords
  • -
  • extra_builtins - list of string - List of extra words ton consider as builtins
  • -
- - -

MIME types defined: text/x-python and text/x-cython.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/q/index.html b/ajax/libs/codemirror/3.24.0/package/mode/q/index.html deleted file mode 100644 index 78ed3d88f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/q/index.html +++ /dev/null @@ -1,144 +0,0 @@ - - -CodeMirror: Q mode - - - - - - - - - - -
-

Q mode

- - -
- - - -

MIME type defined: text/x-q.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/r/index.html b/ajax/libs/codemirror/3.24.0/package/mode/r/index.html deleted file mode 100644 index 397d5858a..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/r/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: R mode - - - - - - - - - -
-

R mode

-
- - -

MIME types defined: text/x-rsrc.

- -

Development of the CodeMirror R mode was kindly sponsored - by Ubalo.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rpm/changes/index.html b/ajax/libs/codemirror/3.24.0/package/mode/rpm/changes/index.html deleted file mode 100644 index 0ade01796..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/rpm/changes/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
-

RPM changes mode

- -
- - -

MIME types defined: text/x-rpm-changes.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rst/index.html b/ajax/libs/codemirror/3.24.0/package/mode/rst/index.html deleted file mode 100644 index cb8269751..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/rst/index.html +++ /dev/null @@ -1,535 +0,0 @@ - - -CodeMirror: reStructuredText mode - - - - - - - - - - -
-

reStructuredText mode

-
- - -

- The python mode will be used for highlighting blocks - containing Python/IPython terminal sessions: blocks starting with - >>> (for Python) or In [num]: (for - IPython). - - Further, the stex mode will be used for highlighting - blocks containing LaTex code. -

- -

MIME types defined: text/x-rst.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/rust/index.html b/ajax/libs/codemirror/3.24.0/package/mode/rust/index.html deleted file mode 100644 index 4fc099922..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/rust/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - -CodeMirror: Rust mode - - - - - - - - - -
-

Rust mode

- - -
- - - -

MIME types defined: text/x-rustsrc.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sass/index.html b/ajax/libs/codemirror/3.24.0/package/mode/sass/index.html deleted file mode 100644 index 66d467784..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/sass/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Sass mode - - - - - - - - - - -
-

Sass mode

-
- - -

MIME types defined: text/x-sass.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/scheme/index.html b/ajax/libs/codemirror/3.24.0/package/mode/scheme/index.html deleted file mode 100644 index 164d5da60..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/scheme/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: Scheme mode - - - - - - - - - -
-

Scheme mode

-
- - -

MIME types defined: text/x-scheme.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/shell/index.html b/ajax/libs/codemirror/3.24.0/package/mode/shell/index.html deleted file mode 100644 index cf415e832..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/shell/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Shell mode - - - - - - - - - - -
-

Shell mode

- - - - - - -

MIME types defined: text/x-sh.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sieve/index.html b/ajax/libs/codemirror/3.24.0/package/mode/sieve/index.html deleted file mode 100644 index 9d814a9d5..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/sieve/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - -CodeMirror: Sieve (RFC5228) mode - - - - - - - - - -
-

Sieve (RFC5228) mode

-
- - -

MIME types defined: application/sieve.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/smalltalk/index.html b/ajax/libs/codemirror/3.24.0/package/mode/smalltalk/index.html deleted file mode 100644 index 0d2b172e1..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/smalltalk/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - -CodeMirror: Smalltalk mode - - - - - - - - - - -
-

Smalltalk mode

-
- - - -

Simple Smalltalk mode.

- -

MIME types defined: text/x-stsrc.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/smarty/index.html b/ajax/libs/codemirror/3.24.0/package/mode/smarty/index.html deleted file mode 100644 index d458aef0f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/smarty/index.html +++ /dev/null @@ -1,136 +0,0 @@ - - -CodeMirror: Smarty mode - - - - - - - - - -
-

Smarty mode

-
- - - -
- -

Smarty 2, custom delimiters

-
- - - -
- -

Smarty 3

- - - - - - -

A plain text/Smarty version 2 or 3 mode, which allows for custom delimiter tags.

- -

MIME types defined: text/x-smarty

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/smartymixed/index.html b/ajax/libs/codemirror/3.24.0/package/mode/smartymixed/index.html deleted file mode 100644 index 47c805fac..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/smartymixed/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - -CodeMirror: Smarty mixed mode - - - - - - - - - - - - - -
-

Smarty mixed mode

-
- - - -

The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML - mixed mode itself depends on XML, JavaScript, and CSS modes.

- -

It takes the same options, as Smarty and HTML mixed modes.

- -

MIME types defined: text/x-smarty.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/solr/index.html b/ajax/libs/codemirror/3.24.0/package/mode/solr/index.html deleted file mode 100644 index cb880244b..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/solr/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - -CodeMirror: Solr mode - - - - - - - - - -
-

Solr mode

- -
- -
- - - -

MIME types defined: text/x-solr.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sparql/index.html b/ajax/libs/codemirror/3.24.0/package/mode/sparql/index.html deleted file mode 100644 index 5f19d647b..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/sparql/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - -CodeMirror: SPARQL mode - - - - - - - - - - -
-

SPARQL mode

-
- - -

MIME types defined: application/x-sparql-query.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/sql/index.html b/ajax/libs/codemirror/3.24.0/package/mode/sql/index.html deleted file mode 100644 index 79a2e74e0..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/sql/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - -CodeMirror: SQL Mode for CodeMirror - - - - - - - - - -
-

SQL Mode for CodeMirror

-
- -
-

MIME types defined: - text/x-sql, - text/x-mysql, - text/x-mariadb, - text/x-cassandra, - text/x-plsql, - text/x-mssql, - text/x-hive. -

- - -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/stex/index.html b/ajax/libs/codemirror/3.24.0/package/mode/stex/index.html deleted file mode 100644 index 28b8f64be..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/stex/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - -CodeMirror: sTeX mode - - - - - - - - - -
-

sTeX mode

-
- - -

MIME types defined: text/x-stex.

- -

Parsing/Highlighting Tests: normal, verbose.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tcl/index.html b/ajax/libs/codemirror/3.24.0/package/mode/tcl/index.html deleted file mode 100644 index c48e25324..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/tcl/index.html +++ /dev/null @@ -1,142 +0,0 @@ - - -CodeMirror: Tcl mode - - - - - - - - - - -
-

Tcl mode

-
- - -

MIME types defined: text/x-tcl.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/index.html b/ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/index.html deleted file mode 100644 index 6ef64a4d0..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/tiddlywiki/index.html +++ /dev/null @@ -1,154 +0,0 @@ - - -CodeMirror: TiddlyWiki mode - - - - - - - - - - - -
-

TiddlyWiki mode

- - -
- - - -

TiddlyWiki mode supports a single configuration.

- -

MIME types defined: text/x-tiddlywiki.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/tiki/index.html b/ajax/libs/codemirror/3.24.0/package/mode/tiki/index.html deleted file mode 100644 index 5315dbfcd..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/tiki/index.html +++ /dev/null @@ -1,95 +0,0 @@ - - -CodeMirror: Tiki wiki mode - - - - - - - - - - -
-

Tiki wiki mode

- - -
- - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/toml/index.html b/ajax/libs/codemirror/3.24.0/package/mode/toml/index.html deleted file mode 100644 index c59b4cc08..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/toml/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - -CodeMirror: TOML Mode - - - - - - - - - -
-

TOML Mode

-
- -

The TOML Mode

-

Created by Forbes Lindesay.

-

MIME type defined: text/x-toml.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/turtle/index.html b/ajax/libs/codemirror/3.24.0/package/mode/turtle/index.html deleted file mode 100644 index 27689c34f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/turtle/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - -CodeMirror: Turtle mode - - - - - - - - - -
-

Turtle mode

-
- - -

MIME types defined: text/turtle.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/vb/index.html b/ajax/libs/codemirror/3.24.0/package/mode/vb/index.html deleted file mode 100644 index 8b81a88b9..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/vb/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - -CodeMirror: VB.NET mode - - - - - - - - - - - -
-

VB.NET mode

- - - -
- -
-

-  

MIME type defined: text/x-vb.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/vbscript/index.html b/ajax/libs/codemirror/3.24.0/package/mode/vbscript/index.html deleted file mode 100644 index 9b506b798..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/vbscript/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - -CodeMirror: VBScript mode - - - - - - - - - -
-

VBScript mode

- - -
- - - -

MIME types defined: text/vbscript.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/velocity/index.html b/ajax/libs/codemirror/3.24.0/package/mode/velocity/index.html deleted file mode 100644 index bd38b886b..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/velocity/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - -CodeMirror: Velocity mode - - - - - - - - - - -
-

Velocity mode

-
- - -

MIME types defined: text/velocity.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/verilog/index.html b/ajax/libs/codemirror/3.24.0/package/mode/verilog/index.html deleted file mode 100644 index 4c06cdaec..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/verilog/index.html +++ /dev/null @@ -1,120 +0,0 @@ - - -CodeMirror: Verilog/SystemVerilog mode - - - - - - - - - - -
-

SystemVerilog mode

- -
- - - -

-Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800). -

Configuration options:

-
    -
  • noIndentKeywords - List of keywords which should not cause identation to increase. E.g. ["package", "module"]. Default: None
  • -
-

- -

MIME types defined: text/x-verilog and text/x-systemverilog.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/xml/index.html b/ajax/libs/codemirror/3.24.0/package/mode/xml/index.html deleted file mode 100644 index 60ebd2017..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/xml/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - -CodeMirror: XML mode - - - - - - - - - -
-

XML mode

-
- -

The XML mode supports two configuration parameters:

-
-
htmlMode (boolean)
-
This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as br) do not require a closing tag.
-
alignCDATA (boolean)
-
Setting this to true will force the opening tag of CDATA - blocks to not be indented.
-
- -

MIME types defined: application/xml, text/html.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/yaml/index.html b/ajax/libs/codemirror/3.24.0/package/mode/yaml/index.html deleted file mode 100644 index bbb40a3c7..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/yaml/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - -CodeMirror: YAML mode - - - - - - - - - -
-

YAML mode

-
- - -

MIME types defined: text/x-yaml.

- -
diff --git a/ajax/libs/codemirror/3.24.0/package/mode/z80/index.html b/ajax/libs/codemirror/3.24.0/package/mode/z80/index.html deleted file mode 100644 index b63c9621a..000000000 --- a/ajax/libs/codemirror/3.24.0/package/mode/z80/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: Z80 assembly mode - - - - - - - - - -
-

Z80 assembly mode

- - -
- - - -

MIME type defined: text/x-z80.

-
diff --git a/ajax/libs/codemirror/3.24.0/package/package.json b/ajax/libs/codemirror/3.24.0/package/package.json deleted file mode 100644 index 352962035..000000000 --- a/ajax/libs/codemirror/3.24.0/package/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "codemirror", - "version":"3.24.0", - "main": "lib/codemirror.js", - "description": "In-browser code editing made bearable", - "licenses": [{"type": "MIT", - "url": "http://codemirror.net/LICENSE"}], - "directories": {"lib": "./lib"}, - "scripts": {"test": "node ./test/run.js"}, - "devDependencies": {"node-static": "0.6.0", - "phantomjs": "1.9.2-5"}, - "bugs": "http://github.com/marijnh/CodeMirror/issues", - "keywords": ["JavaScript", "CodeMirror", "Editor"], - "homepage": "http://codemirror.net", - "maintainers":[{"name": "Marijn Haverbeke", - "email": "marijnh@gmail.com", - "web": "http://marijnhaverbeke.nl"}], - "repository": {"type": "git", - "url": "https://github.com/marijnh/CodeMirror.git"} -} diff --git a/ajax/libs/codemirror/3.24.0/package/test/comment_test.js b/ajax/libs/codemirror/3.24.0/package/test/comment_test.js deleted file mode 100644 index d8ff2c866..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/comment_test.js +++ /dev/null @@ -1,63 +0,0 @@ -namespace = "comment_"; - -(function() { - function test(name, mode, run, before, after) { - return testCM(name, function(cm) { - run(cm); - eq(cm.getValue(), after); - }, {value: before, mode: mode}); - } - - var simpleProg = "function foo() {\n return bar;\n}"; - - test("block", "javascript", function(cm) { - cm.blockComment(Pos(0, 3), Pos(3, 0), {blockCommentLead: " *"}); - }, simpleProg + "\n", "/* function foo() {\n * return bar;\n * }\n */"); - - test("blockToggle", "javascript", function(cm) { - cm.blockComment(Pos(0, 3), Pos(2, 0), {blockCommentLead: " *"}); - cm.uncomment(Pos(0, 3), Pos(2, 0), {blockCommentLead: " *"}); - }, simpleProg, simpleProg); - - test("line", "javascript", function(cm) { - cm.lineComment(Pos(1, 1), Pos(1, 1)); - }, simpleProg, "function foo() {\n// return bar;\n}"); - - test("lineToggle", "javascript", function(cm) { - cm.lineComment(Pos(0, 0), Pos(2, 1)); - cm.uncomment(Pos(0, 0), Pos(2, 1)); - }, simpleProg, simpleProg); - - test("fallbackToBlock", "css", function(cm) { - cm.lineComment(Pos(0, 0), Pos(2, 1)); - }, "html {\n border: none;\n}", "/* html {\n border: none;\n} */"); - - test("fallbackToLine", "ruby", function(cm) { - cm.blockComment(Pos(0, 0), Pos(1)); - }, "def blah()\n return hah\n", "# def blah()\n# return hah\n"); - - test("commentRange", "javascript", function(cm) { - cm.blockComment(Pos(1, 2), Pos(1, 13), {fullLines: false}); - }, simpleProg, "function foo() {\n /*return bar;*/\n}"); - - test("indented", "javascript", function(cm) { - cm.lineComment(Pos(1, 0), Pos(2), {indent: true}); - }, simpleProg, "function foo() {\n // return bar;\n // }"); - - test("singleEmptyLine", "javascript", function(cm) { - cm.setCursor(1); - cm.execCommand("toggleComment"); - }, "a;\n\nb;", "a;\n// \nb;"); - - test("dontMessWithStrings", "javascript", function(cm) { - cm.execCommand("toggleComment"); - }, "console.log(\"/*string*/\");", "// console.log(\"/*string*/\");"); - - test("dontMessWithStrings2", "javascript", function(cm) { - cm.execCommand("toggleComment"); - }, "console.log(\"// string\");", "// console.log(\"// string\");"); - - test("dontMessWithStrings3", "javascript", function(cm) { - cm.execCommand("toggleComment"); - }, "// console.log(\"// string\");", "console.log(\"// string\");"); -})(); diff --git a/ajax/libs/codemirror/3.24.0/package/test/doc_test.js b/ajax/libs/codemirror/3.24.0/package/test/doc_test.js deleted file mode 100644 index 25636a2b2..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/doc_test.js +++ /dev/null @@ -1,374 +0,0 @@ -(function() { - // A minilanguage for instantiating linked CodeMirror instances and Docs - function instantiateSpec(spec, place, opts) { - var names = {}, pos = 0, l = spec.length, editors = []; - while (spec) { - var m = spec.match(/^(\w+)(\*?)(?:='([^\']*)'|<(~?)(\w+)(?:\/(\d+)-(\d+))?)\s*/); - var name = m[1], isDoc = m[2], cur; - if (m[3]) { - cur = isDoc ? CodeMirror.Doc(m[3]) : CodeMirror(place, clone(opts, {value: m[3]})); - } else { - var other = m[5]; - if (!names.hasOwnProperty(other)) { - names[other] = editors.length; - editors.push(CodeMirror(place, opts)); - } - var doc = editors[names[other]].linkedDoc({ - sharedHist: !m[4], - from: m[6] ? Number(m[6]) : null, - to: m[7] ? Number(m[7]) : null - }); - cur = isDoc ? doc : CodeMirror(place, clone(opts, {value: doc})); - } - names[name] = editors.length; - editors.push(cur); - spec = spec.slice(m[0].length); - } - return editors; - } - - function clone(obj, props) { - if (!obj) return; - clone.prototype = obj; - var inst = new clone(); - if (props) for (var n in props) if (props.hasOwnProperty(n)) - inst[n] = props[n]; - return inst; - } - - function eqAll(val) { - var end = arguments.length, msg = null; - if (typeof arguments[end-1] == "string") - msg = arguments[--end]; - if (i == end) throw new Error("No editors provided to eqAll"); - for (var i = 1; i < end; ++i) - eq(arguments[i].getValue(), val, msg) - } - - function testDoc(name, spec, run, opts, expectFail) { - if (!opts) opts = {}; - - return test("doc_" + name, function() { - var place = document.getElementById("testground"); - var editors = instantiateSpec(spec, place, opts); - var successful = false; - - try { - run.apply(null, editors); - successful = true; - } finally { - if (!successful || verbose) { - place.style.visibility = "visible"; - } else { - for (var i = 0; i < editors.length; ++i) - if (editors[i] instanceof CodeMirror) - place.removeChild(editors[i].getWrapperElement()); - } - } - }, expectFail); - } - - var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); - - function testBasic(a, b) { - eqAll("x", a, b); - a.setValue("hey"); - eqAll("hey", a, b); - b.setValue("wow"); - eqAll("wow", a, b); - a.replaceRange("u\nv\nw", Pos(0, 3)); - b.replaceRange("i", Pos(0, 4)); - b.replaceRange("j", Pos(2, 1)); - eqAll("wowui\nv\nwj", a, b); - } - - testDoc("basic", "A='x' B 0, "not at left"); - is(pos.top > 0, "not at top"); - }); - - testDoc("copyDoc", "A='u'", function(a) { - var copy = a.getDoc().copy(true); - a.setValue("foo"); - copy.setValue("bar"); - var old = a.swapDoc(copy); - eq(a.getValue(), "bar"); - a.undo(); - eq(a.getValue(), "u"); - a.swapDoc(old); - eq(a.getValue(), "foo"); - eq(old.historySize().undo, 1); - eq(old.copy(false).historySize().undo, 0); - }); - - testDoc("docKeepsMode", "A='1+1'", function(a) { - var other = CodeMirror.Doc("hi", "text/x-markdown"); - a.setOption("mode", "text/javascript"); - var old = a.swapDoc(other); - eq(a.getOption("mode"), "text/x-markdown"); - eq(a.getMode().name, "markdown"); - a.swapDoc(old); - eq(a.getOption("mode"), "text/javascript"); - eq(a.getMode().name, "javascript"); - }); - - testDoc("subview", "A='1\n2\n3\n4\n5' B<~A/1-3", function(a, b) { - eq(b.getValue(), "2\n3"); - eq(b.firstLine(), 1); - b.setCursor(Pos(4)); - eqPos(b.getCursor(), Pos(2, 1)); - a.replaceRange("-1\n0\n", Pos(0, 0)); - eq(b.firstLine(), 3); - eqPos(b.getCursor(), Pos(4, 1)); - a.undo(); - eqPos(b.getCursor(), Pos(2, 1)); - b.replaceRange("oyoy\n", Pos(2, 0)); - eq(a.getValue(), "1\n2\noyoy\n3\n4\n5"); - b.undo(); - eq(a.getValue(), "1\n2\n3\n4\n5"); - }); - - testDoc("subviewEditOnBoundary", "A='11\n22\n33\n44\n55' B<~A/1-4", function(a, b) { - a.replaceRange("x\nyy\nz", Pos(0, 1), Pos(2, 1)); - eq(b.firstLine(), 2); - eq(b.lineCount(), 2); - eq(b.getValue(), "z3\n44"); - a.replaceRange("q\nrr\ns", Pos(3, 1), Pos(4, 1)); - eq(b.firstLine(), 2); - eq(b.getValue(), "z3\n4q"); - eq(a.getValue(), "1x\nyy\nz3\n4q\nrr\ns5"); - a.execCommand("selectAll"); - a.replaceSelection("!"); - eqAll("!", a, b); - }); - - - testDoc("sharedMarker", "A='ab\ncd\nef\ngh' B>>>>>> bc75b8f... Keep shared markers consistent when documents are linked/unlinked - testDoc("undoInSubview", "A='line 0\nline 1\nline 2\nline 3\nline 4' B 500){ - totalTime = 0; - delay = 50; - } - setTimeout(function(){step(i + 1);}, delay); - } else { // Quit tests - running = false; - return null; - } - } - step(0); -} - -function label(str, msg) { - if (msg) return str + " (" + msg + ")"; - return str; -} -function eq(a, b, msg) { - if (a != b) throw new Failure(label(a + " != " + b, msg)); -} -function eqPos(a, b, msg) { - function str(p) { return "{line:" + p.line + ",ch:" + p.ch + "}"; } - if (a == b) return; - if (a == null) throw new Failure(label("comparing null to " + str(b), msg)); - if (b == null) throw new Failure(label("comparing " + str(a) + " to null", msg)); - if (a.line != b.line || a.ch != b.ch) throw new Failure(label(str(a) + " != " + str(b), msg)); -} -function is(a, msg) { - if (!a) throw new Failure(label("assertion failed", msg)); -} - -function countTests() { - if (!filters.length) return tests.length; - var sum = 0; - for (var i = 0; i < tests.length; ++i) { - var name = tests[i].name; - for (var j = 0; j < filters.length; j++) { - if (name.match(filters[j])) { - ++sum; - break; - } - } - } - return sum; -} - -function parseTestFilter(s) { - if (/_\*$/.test(s)) return new RegExp("^" + s.slice(0, s.length - 2), "i"); - else return new RegExp(s, "i"); -} diff --git a/ajax/libs/codemirror/3.24.0/package/test/emacs_test.js b/ajax/libs/codemirror/3.24.0/package/test/emacs_test.js deleted file mode 100644 index f21605bb3..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/emacs_test.js +++ /dev/null @@ -1,138 +0,0 @@ -(function() { - "use strict"; - - var Pos = CodeMirror.Pos; - namespace = "emacs_"; - - var eventCache = {}; - function fakeEvent(keyName) { - var event = eventCache[key]; - if (event) return event; - - var ctrl, shift, alt; - var key = keyName.replace(/\w+-/g, function(type) { - if (type == "Ctrl-") ctrl = true; - else if (type == "Alt-") alt = true; - else if (type == "Shift-") shift = true; - return ""; - }); - var code; - for (var c in CodeMirror.keyNames) - if (CodeMirror.keyNames[c] == key) { code = c; break; } - if (c == null) throw new Error("Unknown key: " + key); - - return eventCache[keyName] = { - type: "keydown", keyCode: code, ctrlKey: ctrl, shiftKey: shift, altKey: alt, - preventDefault: function(){}, stopPropagation: function(){} - }; - } - - function sim(name, start /*, actions... */) { - var keys = Array.prototype.slice.call(arguments, 2); - testCM(name, function(cm) { - for (var i = 0; i < keys.length; ++i) { - var cur = keys[i]; - if (cur instanceof Pos) cm.setCursor(cur); - else if (cur.call) cur(cm); - else cm.triggerOnKeyDown(fakeEvent(cur)); - } - }, {keyMap: "emacs", value: start, mode: "javascript"}); - } - - function at(line, ch) { return function(cm) { eqPos(cm.getCursor(), Pos(line, ch)); }; } - function txt(str) { return function(cm) { eq(cm.getValue(), str); }; } - - sim("motionHSimple", "abc", "Ctrl-F", "Ctrl-F", "Ctrl-B", at(0, 1)); - sim("motionHMulti", "abcde", - "Ctrl-4", "Ctrl-F", at(0, 4), "Ctrl--", "Ctrl-2", "Ctrl-F", at(0, 2), - "Ctrl-5", "Ctrl-B", at(0, 0)); - - sim("motionHWord", "abc. def ghi", - "Alt-F", at(0, 3), "Alt-F", at(0, 8), - "Ctrl-B", "Alt-B", at(0, 5), "Alt-B", at(0, 0)); - sim("motionHWordMulti", "abc. def ghi ", - "Ctrl-3", "Alt-F", at(0, 12), "Ctrl-2", "Alt-B", at(0, 5), - "Ctrl--", "Alt-B", at(0, 8)); - - sim("motionVSimple", "a\nb\nc\n", "Ctrl-N", "Ctrl-N", "Ctrl-P", at(1, 0)); - sim("motionVMulti", "a\nb\nc\nd\ne\n", - "Ctrl-2", "Ctrl-N", at(2, 0), "Ctrl-F", "Ctrl--", "Ctrl-N", at(1, 1), - "Ctrl--", "Ctrl-3", "Ctrl-P", at(4, 1)); - - sim("killYank", "abc\ndef\nghi", - "Ctrl-F", "Ctrl-Space", "Ctrl-N", "Ctrl-N", "Ctrl-W", "Ctrl-E", "Ctrl-Y", - txt("ahibc\ndef\ng")); - sim("killRing", "abcdef", - "Ctrl-Space", "Ctrl-F", "Ctrl-W", "Ctrl-Space", "Ctrl-F", "Ctrl-W", - "Ctrl-Y", "Alt-Y", - txt("acdef")); - sim("copyYank", "abcd", - "Ctrl-Space", "Ctrl-E", "Alt-W", "Ctrl-Y", - txt("abcdabcd")); - - sim("killLineSimple", "foo\nbar", "Ctrl-F", "Ctrl-K", txt("f\nbar")); - sim("killLineEmptyLine", "foo\n \nbar", "Ctrl-N", "Ctrl-K", txt("foo\nbar")); - sim("killLineMulti", "foo\nbar\nbaz", - "Ctrl-F", "Ctrl-F", "Ctrl-K", "Ctrl-K", "Ctrl-K", "Ctrl-A", "Ctrl-Y", - txt("o\nbarfo\nbaz")); - - sim("moveByParagraph", "abc\ndef\n\n\nhij\nklm\n\n", - "Ctrl-F", "Ctrl-Down", at(2, 0), "Ctrl-Down", at(6, 0), - "Ctrl-N", "Ctrl-Up", at(3, 0), "Ctrl-Up", at(0, 0), - Pos(1, 2), "Ctrl-Down", at(2, 0), Pos(4, 2), "Ctrl-Up", at(3, 0)); - sim("moveByParagraphMulti", "abc\n\ndef\n\nhij\n\nklm", - "Ctrl-U", "2", "Ctrl-Down", at(3, 0), - "Shift-Alt-.", "Ctrl-3", "Ctrl-Up", at(1, 0)); - - sim("moveBySentence", "sentence one! sentence\ntwo\n\nparagraph two", - "Alt-E", at(0, 13), "Alt-E", at(1, 3), "Ctrl-F", "Alt-A", at(0, 13)); - - sim("moveByExpr", "function foo(a, b) {}", - "Ctrl-Alt-F", at(0, 8), "Ctrl-Alt-F", at(0, 12), "Ctrl-Alt-F", at(0, 18), - "Ctrl-Alt-B", at(0, 12), "Ctrl-Alt-B", at(0, 9)); - sim("moveByExprMulti", "foo bar baz bug", - "Ctrl-2", "Ctrl-Alt-F", at(0, 7), - "Ctrl--", "Ctrl-Alt-F", at(0, 4), - "Ctrl--", "Ctrl-2", "Ctrl-Alt-B", at(0, 11)); - sim("delExpr", "var x = [\n a,\n b\n c\n];", - Pos(0, 8), "Ctrl-Alt-K", txt("var x = ;"), "Ctrl-/", - Pos(4, 1), "Ctrl-Alt-Backspace", txt("var x = ;")); - sim("delExprMulti", "foo bar baz", - "Ctrl-2", "Ctrl-Alt-K", txt(" baz"), - "Ctrl-/", "Ctrl-E", "Ctrl-2", "Ctrl-Alt-Backspace", txt("foo ")); - - sim("justOneSpace", "hi bye ", - Pos(0, 4), "Alt-Space", txt("hi bye "), - Pos(0, 4), "Alt-Space", txt("hi b ye "), - "Ctrl-A", "Alt-Space", "Ctrl-E", "Alt-Space", txt(" hi b ye ")); - - sim("openLine", "foo bar", "Alt-F", "Ctrl-O", txt("foo\n bar")) - - sim("transposeChar", "abcd\n\ne", - "Ctrl-F", "Ctrl-T", "Ctrl-T", txt("bcad\n\ne"), at(0, 3), - "Ctrl-F", "Ctrl-T", "Ctrl-T", "Ctrl-T", txt("bcda\n\ne"), at(0, 4), - "Ctrl-F", "Ctrl-T", txt("bcd\na\ne"), at(1, 1)); - - sim("manipWordCase", "foo BAR bAZ", - "Alt-C", "Alt-L", "Alt-U", txt("Foo bar BAZ"), - "Ctrl-A", "Alt-U", "Alt-L", "Alt-C", txt("FOO bar Baz")); - sim("manipWordCaseMulti", "foo Bar bAz", - "Ctrl-2", "Alt-U", txt("FOO BAR bAz"), - "Ctrl-A", "Ctrl-3", "Alt-C", txt("Foo Bar Baz")); - - sim("upExpr", "foo {\n bar[];\n baz(blah);\n}", - Pos(2, 7), "Ctrl-Alt-U", at(2, 5), "Ctrl-Alt-U", at(0, 4)); - sim("transposeExpr", "do foo[bar] dah", - Pos(0, 6), "Ctrl-Alt-T", txt("do [bar]foo dah")); - - sim("clearMark", "abcde", Pos(0, 2), "Ctrl-Space", "Ctrl-F", "Ctrl-F", - "Ctrl-G", "Ctrl-W", txt("abcde")); - - testCM("save", function(cm) { - var saved = false; - CodeMirror.commands.save = function(cm) { saved = cm.getValue(); }; - cm.triggerOnKeyDown(fakeEvent("Ctrl-X")); - cm.triggerOnKeyDown(fakeEvent("Ctrl-S")); - is(saved, "hi"); - }, {value: "hi", keyMap: "emacs"}); -})(); diff --git a/ajax/libs/codemirror/3.24.0/package/test/index.html b/ajax/libs/codemirror/3.24.0/package/test/index.html deleted file mode 100644 index 56ba5122b..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/index.html +++ /dev/null @@ -1,226 +0,0 @@ - - -CodeMirror: Test Suite - - - - - - - - - - - - - - - - - - - - - - - -
-

Test Suite

- -

A limited set of programmatic sanity tests for CodeMirror.

- -
-
Ran 0 of 0 tests
-
-

Please enable JavaScript...

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ajax/libs/codemirror/3.24.0/package/test/lint/acorn.js b/ajax/libs/codemirror/3.24.0/package/test/lint/acorn.js deleted file mode 100644 index 6323b1fc6..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/lint/acorn.js +++ /dev/null @@ -1,1593 +0,0 @@ -// Acorn is a tiny, fast JavaScript parser written in JavaScript. -// -// Acorn was written by Marijn Haverbeke and released under an MIT -// license. The Unicode regexps (for identifiers and whitespace) were -// taken from [Esprima](http://esprima.org) by Ariya Hidayat. -// -// Git repositories for Acorn are available at -// -// http://marijnhaverbeke.nl/git/acorn -// https://github.com/marijnh/acorn.git -// -// Please use the [github bug tracker][ghbt] to report issues. -// -// [ghbt]: https://github.com/marijnh/acorn/issues - -(function(exports) { - "use strict"; - - exports.version = "0.0.1"; - - // The main exported interface (under `window.acorn` when in the - // browser) is a `parse` function that takes a code string and - // returns an abstract syntax tree as specified by [Mozilla parser - // API][api], with the caveat that the SpiderMonkey-specific syntax - // (`let`, `yield`, inline XML, etc) is not recognized. - // - // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - - var options, input, inputLen, sourceFile; - - exports.parse = function(inpt, opts) { - input = String(inpt); inputLen = input.length; - options = opts || {}; - for (var opt in defaultOptions) if (!options.hasOwnProperty(opt)) - options[opt] = defaultOptions[opt]; - sourceFile = options.sourceFile || null; - return parseTopLevel(options.program); - }; - - // A second optional argument can be given to further configure - // the parser process. These options are recognized: - - var defaultOptions = exports.defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3 or 5. This - // influences support for strict mode, the set of reserved words, and - // support for getters and setter. - ecmaVersion: 5, - // Turn on `strictSemicolons` to prevent the parser from doing - // automatic semicolon insertion. - strictSemicolons: false, - // When `allowTrailingCommas` is false, the parser will not allow - // trailing commas in array and object literals. - allowTrailingCommas: true, - // By default, reserved words are not enforced. Enable - // `forbidReserved` to enforce them. - forbidReserved: false, - // When `trackComments` is turned on, the parser will attach - // `commentsBefore` and `commentsAfter` properties to AST nodes - // holding arrays of strings. A single comment may appear in both - // a `commentsBefore` and `commentsAfter` array (of the nodes - // after and before it), but never twice in the before (or after) - // array of different nodes. - trackComments: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `location` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null - }; - - // The `getLineInfo` function is mostly useful when the - // `locations` option is off (for performance reasons) and you - // want to find the line/column position for a given character - // offset. `input` should be the code string that the offset refers - // into. - - var getLineInfo = exports.getLineInfo = function(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreak.lastIndex = cur; - var match = lineBreak.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else break; - } - return {line: line, column: offset - cur}; - }; - - // Acorn is organized as a tokenizer and a recursive-descent parser. - // Both use (closure-)global variables to keep their state and - // communicate. We already saw the `options`, `input`, and - // `inputLen` variables above (set in `parse`). - - // The current position of the tokenizer in the input. - - var tokPos; - - // The start and end offsets of the current token. - - var tokStart, tokEnd; - - // When `options.locations` is true, these hold objects - // containing the tokens start and end line/column pairs. - - var tokStartLoc, tokEndLoc; - - // The type and value of the current token. Token types are objects, - // named by variables against which they can be compared, and - // holding properties that describe them (indicating, for example, - // the precedence of an infix operator, and the original name of a - // keyword token). The kind of value that's held in `tokVal` depends - // on the type of the token. For literals, it is the literal value, - // for operators, the operator name, and so on. - - var tokType, tokVal; - - // These are used to hold arrays of comments when - // `options.trackComments` is true. - - var tokCommentsBefore, tokCommentsAfter; - - // Interal state for the tokenizer. To distinguish between division - // operators and regular expressions, it remembers whether the last - // token was one that is allowed to be followed by an expression. - // (If it is, a slash is probably a regexp, if it isn't it's a - // division operator. See the `parseStatement` function for a - // caveat.) - - var tokRegexpAllowed, tokComments; - - // When `options.locations` is true, these are used to keep - // track of the current line, and know when a new line has been - // entered. See the `curLineLoc` function. - - var tokCurLine, tokLineStart, tokLineStartNext; - - // These store the position of the previous token, which is useful - // when finishing a node and assigning its `end` position. - - var lastStart, lastEnd, lastEndLoc; - - // This is the parser's state. `inFunction` is used to reject - // `return` statements outside of functions, `labels` to verify that - // `break` and `continue` have somewhere to jump to, and `strict` - // indicates whether strict mode is on. - - var inFunction, labels, strict; - - // This function is used to raise exceptions on parse errors. It - // takes either a `{line, column}` object or an offset integer (into - // the current `input`) as `pos` argument. It attaches the position - // to the end of the error message, and then raises a `SyntaxError` - // with that message. - - function raise(pos, message) { - if (typeof pos == "number") pos = getLineInfo(input, pos); - message += " (" + pos.line + ":" + pos.column + ")"; - throw new SyntaxError(message); - } - - // ## Token types - - // The assignment of fine-grained, information-carrying type objects - // allows the tokenizer to store the information it has about a - // token in a way that is very cheap for the parser to look up. - - // All token type variables start with an underscore, to make them - // easy to recognize. - - // These are the general types. The `type` property is only used to - // make them recognizeable when debugging. - - var _num = {type: "num"}, _regexp = {type: "regexp"}, _string = {type: "string"}; - var _name = {type: "name"}, _eof = {type: "eof"}; - - // Keyword tokens. The `keyword` property (also used in keyword-like - // operators) indicates that the token originated from an - // identifier-like word, which is used when parsing property names. - // - // The `beforeExpr` property is used to disambiguate between regular - // expressions and divisions. It is set on all token types that can - // be followed by an expression (thus, a slash after them would be a - // regular expression). - // - // `isLoop` marks a keyword as starting a loop, which is important - // to know when parsing a label, in order to allow or disallow - // continue jumps to that label. - - var _break = {keyword: "break"}, _case = {keyword: "case", beforeExpr: true}, _catch = {keyword: "catch"}; - var _continue = {keyword: "continue"}, _debugger = {keyword: "debugger"}, _default = {keyword: "default"}; - var _do = {keyword: "do", isLoop: true}, _else = {keyword: "else", beforeExpr: true}; - var _finally = {keyword: "finally"}, _for = {keyword: "for", isLoop: true}, _function = {keyword: "function"}; - var _if = {keyword: "if"}, _return = {keyword: "return", beforeExpr: true}, _switch = {keyword: "switch"}; - var _throw = {keyword: "throw", beforeExpr: true}, _try = {keyword: "try"}, _var = {keyword: "var"}; - var _while = {keyword: "while", isLoop: true}, _with = {keyword: "with"}, _new = {keyword: "new", beforeExpr: true}; - var _this = {keyword: "this"}; - - // The keywords that denote values. - - var _null = {keyword: "null", atomValue: null}, _true = {keyword: "true", atomValue: true}; - var _false = {keyword: "false", atomValue: false}; - - // Some keywords are treated as regular operators. `in` sometimes - // (when parsing `for`) needs to be tested against specifically, so - // we assign a variable name to it for quick comparing. - - var _in = {keyword: "in", binop: 7, beforeExpr: true}; - - // Map keyword names to token types. - - var keywordTypes = {"break": _break, "case": _case, "catch": _catch, - "continue": _continue, "debugger": _debugger, "default": _default, - "do": _do, "else": _else, "finally": _finally, "for": _for, - "function": _function, "if": _if, "return": _return, "switch": _switch, - "throw": _throw, "try": _try, "var": _var, "while": _while, "with": _with, - "null": _null, "true": _true, "false": _false, "new": _new, "in": _in, - "instanceof": {keyword: "instanceof", binop: 7}, "this": _this, - "typeof": {keyword: "typeof", prefix: true}, - "void": {keyword: "void", prefix: true}, - "delete": {keyword: "delete", prefix: true}}; - - // Punctuation token types. Again, the `type` property is purely for debugging. - - var _bracketL = {type: "[", beforeExpr: true}, _bracketR = {type: "]"}, _braceL = {type: "{", beforeExpr: true}; - var _braceR = {type: "}"}, _parenL = {type: "(", beforeExpr: true}, _parenR = {type: ")"}; - var _comma = {type: ",", beforeExpr: true}, _semi = {type: ";", beforeExpr: true}; - var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _question = {type: "?", beforeExpr: true}; - - // Operators. These carry several kinds of properties to help the - // parser use them properly (the presence of these properties is - // what categorizes them as operators). - // - // `binop`, when present, specifies that this operator is a binary - // operator, and will refer to its precedence. - // - // `prefix` and `postfix` mark the operator as a prefix or postfix - // unary operator. `isUpdate` specifies that the node produced by - // the operator should be of type UpdateExpression rather than - // simply UnaryExpression (`++` and `--`). - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - - var _slash = {binop: 10, beforeExpr: true}, _eq = {isAssign: true, beforeExpr: true}; - var _assign = {isAssign: true, beforeExpr: true}, _plusmin = {binop: 9, prefix: true, beforeExpr: true}; - var _incdec = {postfix: true, prefix: true, isUpdate: true}, _prefix = {prefix: true, beforeExpr: true}; - var _bin1 = {binop: 1, beforeExpr: true}, _bin2 = {binop: 2, beforeExpr: true}; - var _bin3 = {binop: 3, beforeExpr: true}, _bin4 = {binop: 4, beforeExpr: true}; - var _bin5 = {binop: 5, beforeExpr: true}, _bin6 = {binop: 6, beforeExpr: true}; - var _bin7 = {binop: 7, beforeExpr: true}, _bin8 = {binop: 8, beforeExpr: true}; - var _bin10 = {binop: 10, beforeExpr: true}; - - // This is a trick taken from Esprima. It turns out that, on - // non-Chrome browsers, to check whether a string is in a set, a - // predicate containing a big ugly `switch` statement is faster than - // a regular expression, and on Chrome the two are about on par. - // This function uses `eval` (non-lexical) to produce such a - // predicate from a space-separated string of words. - // - // It starts by sorting the words by length. - - function makePredicate(words) { - words = words.split(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([words[i]]); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; - f += "return true}return false;"; - } - - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - - if (cats.length > 3) { - cats.sort(function(a, b) {return b.length - a.length;}); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - - // Otherwise, simply generate a flat `switch` statement. - - } else { - compareTo(words); - } - return new Function("str", f); - } - - // The ECMAScript 3 reserved word list. - - var isReservedWord3 = makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"); - - // ECMAScript 5 reserved words. - - var isReservedWord5 = makePredicate("class enum extends super const export import"); - - // The additional reserved words in strict mode. - - var isStrictReservedWord = makePredicate("implements interface let package private protected public static yield"); - - // The forbidden variable names in strict mode. - - var isStrictBadIdWord = makePredicate("eval arguments"); - - // And the keywords. - - var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"); - - // ## Character categories - - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - - var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/; - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u0371-\u0374\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - - // Whether a single character denotes a newline. - - var newline = /[\n\r\u2028\u2029]/; - - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. - - var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; - - // Test whether a given character code starts an identifier. - - function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123)return true; - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - // Test whether a given character is part of an identifier. - - function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123)return true; - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - // ## Tokenizer - - // These are used when `options.locations` is on, in order to track - // the current line number and start of line offset, in order to set - // `tokStartLoc` and `tokEndLoc`. - - function nextLineStart() { - lineBreak.lastIndex = tokLineStart; - var match = lineBreak.exec(input); - return match ? match.index + match[0].length : input.length + 1; - } - - function curLineLoc() { - while (tokLineStartNext <= tokPos) { - ++tokCurLine; - tokLineStart = tokLineStartNext; - tokLineStartNext = nextLineStart(); - } - return {line: tokCurLine, column: tokPos - tokLineStart}; - } - - // Reset the token state. Used at the start of a parse. - - function initTokenState() { - tokCurLine = 1; - tokPos = tokLineStart = 0; - tokLineStartNext = nextLineStart(); - tokRegexpAllowed = true; - tokComments = null; - skipSpace(); - } - - // Called at the end of every token. Sets `tokEnd`, `tokVal`, - // `tokCommentsAfter`, and `tokRegexpAllowed`, and skips the space - // after the token, so that the next one's `tokStart` will point at - // the right position. - - function finishToken(type, val) { - tokEnd = tokPos; - if (options.locations) tokEndLoc = curLineLoc(); - tokType = type; - skipSpace(); - tokVal = val; - tokCommentsAfter = tokComments; - tokRegexpAllowed = type.beforeExpr; - } - - function skipBlockComment() { - var end = input.indexOf("*/", tokPos += 2); - if (end === -1) raise(tokPos - 2, "Unterminated comment"); - if (options.trackComments) - (tokComments || (tokComments = [])).push(input.slice(tokPos, end)); - tokPos = end + 2; - } - - function skipLineComment() { - var start = tokPos; - var ch = input.charCodeAt(tokPos+=2); - while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8329) { - ++tokPos; - ch = input.charCodeAt(tokPos); - } - (tokComments || (tokComments = [])).push(input.slice(start, tokPos)); - } - - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and, if `options.trackComments` is on, - // will store all skipped comments in `tokComments`. - - function skipSpace() { - tokComments = null; - while (tokPos < inputLen) { - var ch = input.charCodeAt(tokPos); - if (ch === 47) { // '/' - var next = input.charCodeAt(tokPos+1); - if (next === 42) { // '*' - skipBlockComment(); - } else if (next === 47) { // '/' - skipLineComment(); - } else break; - } else if (ch < 14 && ch > 8) { - ++tokPos; - } else if (ch === 32 || ch === 160) { // ' ', '\xa0' - ++tokPos; - } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++tokPos; - } else { - break; - } - } - } - - // ### Token reading - - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - // The `forceRegexp` parameter is used in the one case where the - // `tokRegexpAllowed` trick does not work. See `parseStatement`. - - function readToken(forceRegexp) { - tokStart = tokPos; - if (options.locations) tokStartLoc = curLineLoc(); - tokCommentsBefore = tokComments; - if (forceRegexp) return readRegexp(); - if (tokPos >= inputLen) return finishToken(_eof); - - var code = input.charCodeAt(tokPos); - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code) || code === 92 /* '\' */) return readWord(); - var next = input.charCodeAt(tokPos+1); - - switch(code) { - // The interpretation of a dot depends on whether it is followed - // by a digit. - case 46: // '.' - if (next >= 48 && next <= 57) return readNumber(String.fromCharCode(code)); - ++tokPos; - return finishToken(_dot); - - // Punctuation tokens. - case 40: ++tokPos; return finishToken(_parenL); - case 41: ++tokPos; return finishToken(_parenR); - case 59: ++tokPos; return finishToken(_semi); - case 44: ++tokPos; return finishToken(_comma); - case 91: ++tokPos; return finishToken(_bracketL); - case 93: ++tokPos; return finishToken(_bracketR); - case 123: ++tokPos; return finishToken(_braceL); - case 125: ++tokPos; return finishToken(_braceR); - case 58: ++tokPos; return finishToken(_colon); - case 63: ++tokPos; return finishToken(_question); - - // '0x' is a hexadecimal number. - case 48: // '0' - if (next === 120 || next === 88) return readHexNumber(); - // Anything else beginning with a digit is an integer, octal - // number, or float. - case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9 - return readNumber(String.fromCharCode(code)); - - // Quotes produce strings. - case 34: case 39: // '"', "'" - return readString(code); - - // Operators are parsed inline in tiny state machines. '=' (61) is - // often referred to. `finishOp` simply skips the amount of - // characters it is given as second argument, and returns a token - // of the type given by its first argument. - - case 47: // '/' - if (tokRegexpAllowed) {++tokPos; return readRegexp();} - if (next === 61) return finishOp(_assign, 2); - return finishOp(_slash, 1); - - case 37: case 42: // '%*' - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bin10, 1); - - case 124: case 38: // '|&' - if (next === code) return finishOp(code === 124 ? _bin1 : _bin2, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(code === 124 ? _bin3 : _bin5, 1); - - case 94: // '^' - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bin4, 1); - - case 43: case 45: // '+-' - if (next === code) return finishOp(_incdec, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_plusmin, 1); - - case 60: case 62: // '<>' - var size = 1; - if (next === code) { - size = code === 62 && input.charCodeAt(tokPos+2) === 62 ? 3 : 2; - if (input.charCodeAt(tokPos + size) === 61) return finishOp(_assign, size + 1); - return finishOp(_bin8, size); - } - if (next === 61) - size = input.charCodeAt(tokPos+2) === 61 ? 3 : 2; - return finishOp(_bin7, size); - - case 61: case 33: // '=!' - if (next === 61) return finishOp(_bin6, input.charCodeAt(tokPos+2) === 61 ? 3 : 2); - return finishOp(code === 61 ? _eq : _prefix, 1); - - case 126: // '~' - return finishOp(_prefix, 1); - } - - // If we are here, we either found a non-ASCII identifier - // character, or something that's entirely disallowed. - var ch = String.fromCharCode(code); - if (ch === "\\" || nonASCIIidentifierStart.test(ch)) return readWord(); - raise(tokPos, "Unexpected character '" + ch + "'"); - } - - function finishOp(type, size) { - var str = input.slice(tokPos, tokPos + size); - tokPos += size; - finishToken(type, str); - } - - // Parse a regular expression. Some context-awareness is necessary, - // since a '/' inside a '[]' set does not end the expression. - - function readRegexp() { - var content = "", escaped, inClass, start = tokPos; - for (;;) { - if (tokPos >= inputLen) raise(start, "Unterminated regular expression"); - var ch = input.charAt(tokPos); - if (newline.test(ch)) raise(start, "Unterminated regular expression"); - if (!escaped) { - if (ch === "[") inClass = true; - else if (ch === "]" && inClass) inClass = false; - else if (ch === "/" && !inClass) break; - escaped = ch === "\\"; - } else escaped = false; - ++tokPos; - } - var content = input.slice(start, tokPos); - ++tokPos; - // Need to use `readWord1` because '\uXXXX' sequences are allowed - // here (don't ask). - var mods = readWord1(); - if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, "Invalid regexp flag"); - return finishToken(_regexp, new RegExp(content, mods)); - } - - // Read an integer in the given radix. Return null if zero digits - // were read, the integer value otherwise. When `len` is given, this - // will return `null` unless the integer has exactly `len` digits. - - function readInt(radix, len) { - var start = tokPos, total = 0; - for (;;) { - var code = input.charCodeAt(tokPos), val; - if (code >= 97) val = code - 97 + 10; // a - else if (code >= 65) val = code - 65 + 10; // A - else if (code >= 48 && code <= 57) val = code - 48; // 0-9 - else val = Infinity; - if (val >= radix) break; - ++tokPos; - total = total * radix + val; - } - if (tokPos === start || len != null && tokPos - start !== len) return null; - - return total; - } - - function readHexNumber() { - tokPos += 2; // 0x - var val = readInt(16); - if (val == null) raise(tokStart + 2, "Expected hexadecimal number"); - if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); - return finishToken(_num, val); - } - - // Read an integer, octal integer, or floating-point number. - - function readNumber(ch) { - var start = tokPos, isFloat = ch === "."; - if (!isFloat && readInt(10) == null) raise(start, "Invalid number"); - if (isFloat || input.charAt(tokPos) === ".") { - var next = input.charAt(++tokPos); - if (next === "-" || next === "+") ++tokPos; - if (readInt(10) === null && ch === ".") raise(start, "Invalid number"); - isFloat = true; - } - if (/e/i.test(input.charAt(tokPos))) { - var next = input.charAt(++tokPos); - if (next === "-" || next === "+") ++tokPos; - if (readInt(10) === null) raise(start, "Invalid number") - isFloat = true; - } - if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); - - var str = input.slice(start, tokPos), val; - if (isFloat) val = parseFloat(str); - else if (ch !== "0" || str.length === 1) val = parseInt(str, 10); - else if (/[89]/.test(str) || strict) raise(start, "Invalid number"); - else val = parseInt(str, 8); - return finishToken(_num, val); - } - - // Read a string value, interpreting backslash-escapes. - - function readString(quote) { - tokPos++; - var str = []; - for (;;) { - if (tokPos >= inputLen) raise(tokStart, "Unterminated string constant"); - var ch = input.charCodeAt(tokPos); - if (ch === quote) { - ++tokPos; - return finishToken(_string, String.fromCharCode.apply(null, str)); - } - if (ch === 92) { // '\' - ch = input.charCodeAt(++tokPos); - var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3)); - if (octal) octal = octal[0]; - while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, octal.length - 1); - if (octal === "0") octal = null; - ++tokPos; - if (octal) { - if (strict) raise(tokPos - 2, "Octal literal in strict mode"); - str.push(parseInt(octal, 8)); - tokPos += octal.length - 1; - } else { - switch (ch) { - case 110: str.push(10); break; // 'n' -> '\n' - case 114: str.push(13); break; // 'r' -> '\r' - case 120: str.push(readHexChar(2)); break; // 'x' - case 117: str.push(readHexChar(4)); break; // 'u' - case 85: str.push(readHexChar(8)); break; // 'U' - case 116: str.push(9); break; // 't' -> '\t' - case 98: str.push(8); break; // 'b' -> '\b' - case 118: str.push(11); break; // 'v' -> '\u000b' - case 102: str.push(12); break; // 'f' -> '\f' - case 48: str.push(0); break; // 0 -> '\0' - case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\r\n' - case 10: break; // ' \n' - default: str.push(ch); break; - } - } - } else { - if (ch === 13 || ch === 10 || ch === 8232 || ch === 8329) raise(tokStart, "Unterminated string constant"); - if (ch !== 92) str.push(ch); // '\' - ++tokPos; - } - } - } - - // Used to read character escape sequences ('\x', '\u', '\U'). - - function readHexChar(len) { - var n = readInt(16, len); - if (n === null) raise(tokStart, "Bad character escape sequence"); - return n; - } - - // Used to signal to callers of `readWord1` whether the word - // contained any escape sequences. This is needed because words with - // escape sequences must not be interpreted as keywords. - - var containsEsc; - - // Read an identifier, and return it as a string. Sets `containsEsc` - // to whether the word contained a '\u' escape. - // - // Only builds up the word character-by-character when it actually - // containeds an escape, as a micro-optimization. - - function readWord1() { - containsEsc = false; - var word, first = true, start = tokPos; - for (;;) { - var ch = input.charCodeAt(tokPos); - if (isIdentifierChar(ch)) { - if (containsEsc) word += input.charAt(tokPos); - ++tokPos; - } else if (ch === 92) { // "\" - if (!containsEsc) word = input.slice(start, tokPos); - containsEsc = true; - if (input.charCodeAt(++tokPos) != 117) // "u" - raise(tokPos, "Expecting Unicode escape sequence \\uXXXX"); - ++tokPos; - var esc = readHexChar(4); - var escStr = String.fromCharCode(esc); - if (!escStr) raise(tokPos - 1, "Invalid Unicode escape"); - if (!(first ? isIdentifierStart(esc) : isIdentifierChar(esc))) - raise(tokPos - 4, "Invalid Unicode escape"); - word += escStr; - } else { - break; - } - first = false; - } - return containsEsc ? word : input.slice(start, tokPos); - } - - // Read an identifier or keyword token. Will check for reserved - // words when necessary. - - function readWord() { - var word = readWord1(); - var type = _name; - if (!containsEsc) { - if (isKeyword(word)) type = keywordTypes[word]; - else if (options.forbidReserved && - (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(word) || - strict && isStrictReservedWord(word)) - raise(tokStart, "The keyword '" + word + "' is reserved"); - } - return finishToken(type, word); - } - - // ## Parser - - // A recursive descent parser operates by defining functions for all - // syntactic elements, and recursively calling those, each function - // advancing the input stream and returning an AST node. Precedence - // of constructs (for example, the fact that `!x[1]` means `!(x[1])` - // instead of `(!x)[1]` is handled by the fact that the parser - // function that parses unary prefix operators is called first, and - // in turn calls the function that parses `[]` subscripts — that - // way, it'll receive the node for `x[1]` already parsed, and wraps - // *that* in the unary operator node. - // - // Acorn uses an [operator precedence parser][opp] to handle binary - // operator precedence, because it is much more compact than using - // the technique outlined above, which uses different, nesting - // functions to specify precedence, for all of the ten binary - // precedence levels that JavaScript defines. - // - // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - - // ### Parser utilities - - // Continue to the next token. - - function next() { - lastStart = tokStart; - lastEnd = tokEnd; - lastEndLoc = tokEndLoc; - readToken(); - } - - // Enter strict mode. Re-reads the next token to please pedantic - // tests ("use strict"; 010; -- should fail). - - function setStrict(strct) { - strict = strct; - tokPos = lastEnd; - skipSpace(); - readToken(); - } - - // Start an AST node, attaching a start offset and optionally a - // `commentsBefore` property to it. - - function startNode() { - var node = {type: null, start: tokStart, end: null}; - if (options.trackComments && tokCommentsBefore) { - node.commentsBefore = tokCommentsBefore; - tokCommentsBefore = null; - } - if (options.locations) - node.loc = {start: tokStartLoc, end: null, source: sourceFile}; - if (options.ranges) - node.range = [tokStart, 0]; - return node; - } - - // Start a node whose start offset/comments information should be - // based on the start of another node. For example, a binary - // operator node is only started after its left-hand side has - // already been parsed. - - function startNodeFrom(other) { - var node = {type: null, start: other.start}; - if (other.commentsBefore) { - node.commentsBefore = other.commentsBefore; - other.commentsBefore = null; - } - if (options.locations) - node.loc = {start: other.loc.start, end: null, source: other.loc.source}; - if (options.ranges) - node.range = [other.range[0], 0]; - - return node; - } - - // Finish an AST node, adding `type`, `end`, and `commentsAfter` - // properties. - // - // We keep track of the last node that we finished, in order - // 'bubble' `commentsAfter` properties up to the biggest node. I.e. - // in '`1 + 1 // foo', the comment should be attached to the binary - // operator node, not the second literal node. - - var lastFinishedNode; - - function finishNode(node, type) { - node.type = type; - node.end = lastEnd; - if (options.trackComments) { - if (tokCommentsAfter) { - node.commentsAfter = tokCommentsAfter; - tokCommentsAfter = null; - } else if (lastFinishedNode && lastFinishedNode.end === lastEnd) { - node.commentsAfter = lastFinishedNode.commentsAfter; - lastFinishedNode.commentsAfter = null; - } - lastFinishedNode = node; - } - if (options.locations) - node.loc.end = lastEndLoc; - if (options.ranges) - node.range[1] = lastEnd; - return node; - } - - // Test whether a statement node is the string literal `"use strict"`. - - function isUseStrict(stmt) { - return options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && - stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; - } - - // Predicate that tests whether the next token is of the given - // type, and if yes, consumes it as a side effect. - - function eat(type) { - if (tokType === type) { - next(); - return true; - } - } - - // Test whether a semicolon can be inserted at the current position. - - function canInsertSemicolon() { - return !options.strictSemicolons && - (tokType === _eof || tokType === _braceR || newline.test(input.slice(lastEnd, tokStart))); - } - - // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. - - function semicolon() { - if (!eat(_semi) && !canInsertSemicolon()) unexpected(); - } - - // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error. - - function expect(type) { - if (tokType === type) next(); - else unexpected(); - } - - // Raise an unexpected token error. - - function unexpected() { - raise(tokStart, "Unexpected token"); - } - - // Verify that a node is an lval — something that can be assigned - // to. - - function checkLVal(expr) { - if (expr.type !== "Identifier" && expr.type !== "MemberExpression") - raise(expr.start, "Assigning to rvalue"); - if (strict && expr.type === "Identifier" && isStrictBadIdWord(expr.name)) - raise(expr.start, "Assigning to " + expr.name + " in strict mode"); - } - - // ### Statement parsing - - // Parse a program. Initializes the parser, reads any number of - // statements, and wraps them in a Program node. Optionally takes a - // `program` argument. If present, the statements will be appended - // to its body instead of creating a new node. - - function parseTopLevel(program) { - initTokenState(); - lastStart = lastEnd = tokPos; - if (options.locations) lastEndLoc = curLineLoc(); - inFunction = strict = null; - labels = []; - readToken(); - - var node = program || startNode(), first = true; - if (!program) node.body = []; - while (tokType !== _eof) { - var stmt = parseStatement(); - node.body.push(stmt); - if (first && isUseStrict(stmt)) setStrict(true); - first = false; - } - return finishNode(node, "Program"); - }; - - var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - - // Parse a single statement. - // - // If expecting a statement and finding a slash operator, parse a - // regular expression literal. This is to handle cases like - // `if (foo) /blah/.exec(foo);`, where looking at the previous token - // does not help. - - function parseStatement() { - if (tokType === _slash) - readToken(true); - - var starttype = tokType, node = startNode(); - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case _break: case _continue: - next(); - var isBreak = starttype === _break; - if (eat(_semi) || canInsertSemicolon()) node.label = null; - else if (tokType !== _name) unexpected(); - else { - node.label = parseIdent(); - semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - for (var i = 0; i < labels.length; ++i) { - var lab = labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - if (i === labels.length) raise(node.start, "Unsyntactic " + starttype.keyword); - return finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - - case _debugger: - next(); - return finishNode(node, "DebuggerStatement"); - - case _do: - next(); - labels.push(loopLabel); - node.body = parseStatement(); - labels.pop(); - expect(_while); - node.test = parseParenExpression(); - semicolon(); - return finishNode(node, "DoWhileStatement"); - - // Disambiguating between a `for` and a `for`/`in` loop is - // non-trivial. Basically, we have to parse the init `var` - // statement or expression, disallowing the `in` operator (see - // the second parameter to `parseExpression`), and then check - // whether the next token is `in`. When there is no init part - // (semicolon immediately after the opening parenthesis), it is - // a regular `for` loop. - - case _for: - next(); - labels.push(loopLabel); - expect(_parenL); - if (tokType === _semi) return parseFor(node, null); - if (tokType === _var) { - var init = startNode(); - next(); - parseVar(init, true); - if (init.declarations.length === 1 && eat(_in)) - return parseForIn(node, init); - return parseFor(node, init); - } - var init = parseExpression(false, true); - if (eat(_in)) {checkLVal(init); return parseForIn(node, init);} - return parseFor(node, init); - - case _function: - next(); - return parseFunction(node, true); - - case _if: - next(); - node.test = parseParenExpression(); - node.consequent = parseStatement(); - node.alternate = eat(_else) ? parseStatement() : null; - return finishNode(node, "IfStatement"); - - case _return: - if (!inFunction) raise(tokStart, "'return' outside of function"); - next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (eat(_semi) || canInsertSemicolon()) node.argument = null; - else { node.argument = parseExpression(); semicolon(); } - return finishNode(node, "ReturnStatement"); - - case _switch: - next(); - node.discriminant = parseParenExpression(); - node.cases = []; - expect(_braceL); - labels.push(switchLabel); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - for (var cur, sawDefault; tokType != _braceR;) { - if (tokType === _case || tokType === _default) { - var isCase = tokType === _case; - if (cur) finishNode(cur, "SwitchCase"); - node.cases.push(cur = startNode()); - cur.consequent = []; - next(); - if (isCase) cur.test = parseExpression(); - else { - if (sawDefault) raise(lastStart, "Multiple default clauses"); sawDefault = true; - cur.test = null; - } - expect(_colon); - } else { - if (!cur) unexpected(); - cur.consequent.push(parseStatement()); - } - } - if (cur) finishNode(cur, "SwitchCase"); - next(); // Closing brace - labels.pop(); - return finishNode(node, "SwitchStatement"); - - case _throw: - next(); - if (newline.test(input.slice(lastEnd, tokStart))) - raise(lastEnd, "Illegal newline after throw"); - node.argument = parseExpression(); - return finishNode(node, "ThrowStatement"); - - case _try: - next(); - node.block = parseBlock(); - node.handlers = []; - while (tokType === _catch) { - var clause = startNode(); - next(); - expect(_parenL); - clause.param = parseIdent(); - if (strict && isStrictBadIdWord(clause.param.name)) - raise(clause.param.start, "Binding " + clause.param.name + " in strict mode"); - expect(_parenR); - clause.guard = null; - clause.body = parseBlock(); - node.handlers.push(finishNode(clause, "CatchClause")); - } - node.finalizer = eat(_finally) ? parseBlock() : null; - if (!node.handlers.length && !node.finalizer) - raise(node.start, "Missing catch or finally clause"); - return finishNode(node, "TryStatement"); - - case _var: - next(); - node = parseVar(node); - semicolon(); - return node; - - case _while: - next(); - node.test = parseParenExpression(); - labels.push(loopLabel); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "WhileStatement"); - - case _with: - if (strict) raise(tokStart, "'with' in strict mode"); - next(); - node.object = parseParenExpression(); - node.body = parseStatement(); - return finishNode(node, "WithStatement"); - - case _braceL: - return parseBlock(); - - case _semi: - next(); - return finishNode(node, "EmptyStatement"); - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - - default: - var maybeName = tokVal, expr = parseExpression(); - if (starttype === _name && expr.type === "Identifier" && eat(_colon)) { - for (var i = 0; i < labels.length; ++i) - if (labels[i].name === maybeName) raise(expr.start, "Label '" + maybeName + "' is already declared"); - var kind = tokType.isLoop ? "loop" : tokType === _switch ? "switch" : null; - labels.push({name: maybeName, kind: kind}); - node.body = parseStatement(); - node.label = expr; - return finishNode(node, "LabeledStatement"); - } else { - node.expression = expr; - semicolon(); - return finishNode(node, "ExpressionStatement"); - } - } - } - - // Used for constructs like `switch` and `if` that insist on - // parentheses around their expression. - - function parseParenExpression() { - expect(_parenL); - var val = parseExpression(); - expect(_parenR); - return val; - } - - // Parse a semicolon-enclosed block of statements, handling `"use - // strict"` declarations when `allowStrict` is true (used for - // function bodies). - - function parseBlock(allowStrict) { - var node = startNode(), first = true, strict = false, oldStrict; - node.body = []; - expect(_braceL); - while (!eat(_braceR)) { - var stmt = parseStatement(); - node.body.push(stmt); - if (first && isUseStrict(stmt)) { - oldStrict = strict; - setStrict(strict = true); - } - first = false - } - if (strict && !oldStrict) setStrict(false); - return finishNode(node, "BlockStatement"); - } - - // Parse a regular `for` loop. The disambiguation code in - // `parseStatement` will already have parsed the init statement or - // expression. - - function parseFor(node, init) { - node.init = init; - expect(_semi); - node.test = tokType === _semi ? null : parseExpression(); - expect(_semi); - node.update = tokType === _parenR ? null : parseExpression(); - expect(_parenR); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "ForStatement"); - } - - // Parse a `for`/`in` loop. - - function parseForIn(node, init) { - node.left = init; - node.right = parseExpression(); - expect(_parenR); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "ForInStatement"); - } - - // Parse a list of variable declarations. - - function parseVar(node, noIn) { - node.declarations = []; - node.kind = "var"; - for (;;) { - var decl = startNode(); - decl.id = parseIdent(); - if (strict && isStrictBadIdWord(decl.id.name)) - raise(decl.id.start, "Binding " + decl.id.name + " in strict mode"); - decl.init = eat(_eq) ? parseExpression(true, noIn) : null; - node.declarations.push(finishNode(decl, "VariableDeclarator")); - if (!eat(_comma)) break; - } - return finishNode(node, "VariableDeclaration"); - } - - // ### Expression parsing - - // These nest, from the most general expression type at the top to - // 'atomic', nondivisible expression types at the bottom. Most of - // the functions will simply let the function(s) below them parse, - // and, *if* the syntactic construct they handle is present, wrap - // the AST node that the inner parser gave them in another node. - - // Parse a full expression. The arguments are used to forbid comma - // sequences (in argument lists, array literals, or object literals) - // or the `in` operator (in for loops initalization expressions). - - function parseExpression(noComma, noIn) { - var expr = parseMaybeAssign(noIn); - if (!noComma && tokType === _comma) { - var node = startNodeFrom(expr); - node.expressions = [expr]; - while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn)); - return finishNode(node, "SequenceExpression"); - } - return expr; - } - - // Parse an assignment expression. This includes applications of - // operators like `+=`. - - function parseMaybeAssign(noIn) { - var left = parseMaybeConditional(noIn); - if (tokType.isAssign) { - var node = startNodeFrom(left); - node.operator = tokVal; - node.left = left; - next(); - node.right = parseMaybeAssign(noIn); - checkLVal(left); - return finishNode(node, "AssignmentExpression"); - } - return left; - } - - // Parse a ternary conditional (`?:`) operator. - - function parseMaybeConditional(noIn) { - var expr = parseExprOps(noIn); - if (eat(_question)) { - var node = startNodeFrom(expr); - node.test = expr; - node.consequent = parseExpression(true); - expect(_colon); - node.alternate = parseExpression(true, noIn); - return finishNode(node, "ConditionalExpression"); - } - return expr; - } - - // Start the precedence parser. - - function parseExprOps(noIn) { - return parseExprOp(parseMaybeUnary(noIn), -1, noIn); - } - - // Parse binary operators with the operator precedence parsing - // algorithm. `left` is the left-hand side of the operator. - // `minPrec` provides context that allows the function to stop and - // defer further parser to one of its callers when it encounters an - // operator that has a lower precedence than the set it is parsing. - - function parseExprOp(left, minPrec, noIn) { - var prec = tokType.binop; - if (prec != null && (!noIn || tokType !== _in)) { - if (prec > minPrec) { - var node = startNodeFrom(left); - node.left = left; - node.operator = tokVal; - next(); - node.right = parseExprOp(parseMaybeUnary(noIn), prec, noIn); - var node = finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression"); - return parseExprOp(node, minPrec, noIn); - } - } - return left; - } - - // Parse unary operators, both prefix and postfix. - - function parseMaybeUnary(noIn) { - if (tokType.prefix) { - var node = startNode(), update = tokType.isUpdate; - node.operator = tokVal; - node.prefix = true; - next(); - node.argument = parseMaybeUnary(noIn); - if (update) checkLVal(node.argument); - else if (strict && node.operator === "delete" && - node.argument.type === "Identifier") - raise(node.start, "Deleting local variable in strict mode"); - return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - var expr = parseExprSubscripts(); - while (tokType.postfix && !canInsertSemicolon()) { - var node = startNodeFrom(expr); - node.operator = tokVal; - node.prefix = false; - node.argument = expr; - checkLVal(expr); - next(); - expr = finishNode(node, "UpdateExpression"); - } - return expr; - } - - // Parse call, dot, and `[]`-subscript expressions. - - function parseExprSubscripts() { - return parseSubscripts(parseExprAtom()); - } - - function parseSubscripts(base, noCalls) { - if (eat(_dot)) { - var node = startNodeFrom(base); - node.object = base; - node.property = parseIdent(true); - node.computed = false; - return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); - } else if (eat(_bracketL)) { - var node = startNodeFrom(base); - node.object = base; - node.property = parseExpression(); - node.computed = true; - expect(_bracketR); - return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); - } else if (!noCalls && eat(_parenL)) { - var node = startNodeFrom(base); - node.callee = base; - node.arguments = parseExprList(_parenR, false); - return parseSubscripts(finishNode(node, "CallExpression"), noCalls); - } else return base; - } - - // Parse an atomic expression — either a single token that is an - // expression, an expression started by a keyword like `function` or - // `new`, or an expression wrapped in punctuation like `()`, `[]`, - // or `{}`. - - function parseExprAtom() { - switch (tokType) { - case _this: - var node = startNode(); - next(); - return finishNode(node, "ThisExpression"); - case _name: - return parseIdent(); - case _num: case _string: case _regexp: - var node = startNode(); - node.value = tokVal; - node.raw = input.slice(tokStart, tokEnd); - next(); - return finishNode(node, "Literal"); - - case _null: case _true: case _false: - var node = startNode(); - node.value = tokType.atomValue; - next(); - return finishNode(node, "Literal"); - - case _parenL: - next(); - var val = parseExpression(); - expect(_parenR); - return val; - - case _bracketL: - var node = startNode(); - next(); - node.elements = parseExprList(_bracketR, true, true); - return finishNode(node, "ArrayExpression"); - - case _braceL: - return parseObj(); - - case _function: - var node = startNode(); - next(); - return parseFunction(node, false); - - case _new: - return parseNew(); - - default: - unexpected(); - } - } - - // New's precedence is slightly tricky. It must allow its argument - // to be a `[]` or dot subscript expression, but not a call — at - // least, not without wrapping it in parentheses. Thus, it uses the - - function parseNew() { - var node = startNode(); - next(); - node.callee = parseSubscripts(parseExprAtom(false), true); - if (eat(_parenL)) node.arguments = parseExprList(_parenR, false); - else node.arguments = []; - return finishNode(node, "NewExpression"); - } - - // Parse an object literal. - - function parseObj() { - var node = startNode(), first = true, sawGetSet = false; - node.properties = []; - next(); - while (!eat(_braceR)) { - if (!first) { - expect(_comma); - if (options.allowTrailingCommas && eat(_braceR)) break; - } else first = false; - - var prop = {key: parsePropertyName()}, isGetSet = false, kind; - if (eat(_colon)) { - prop.value = parseExpression(true); - kind = prop.kind = "init"; - } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set")) { - isGetSet = sawGetSet = true; - kind = prop.kind = prop.key.name; - prop.key = parsePropertyName(); - if (!tokType === _parenL) unexpected(); - prop.value = parseFunction(startNode(), false); - } else unexpected(); - - // getters and setters are not allowed to clash — either with - // each other or with an init property — and in strict mode, - // init properties are also not allowed to be repeated. - - if (prop.key.type === "Identifier" && (strict || sawGetSet)) { - for (var i = 0; i < node.properties.length; ++i) { - var other = node.properties[i]; - if (other.key.name === prop.key.name) { - var conflict = kind == other.kind || isGetSet && other.kind === "init" || - kind === "init" && (other.kind === "get" || other.kind === "set"); - if (conflict && !strict && kind === "init" && other.kind === "init") conflict = false; - if (conflict) raise(prop.key.start, "Redefinition of property"); - } - } - } - node.properties.push(prop); - } - return finishNode(node, "ObjectExpression"); - } - - function parsePropertyName() { - if (tokType === _num || tokType === _string) return parseExprAtom(); - return parseIdent(true); - } - - // Parse a function declaration or literal (depending on the - // `isStatement` parameter). - - function parseFunction(node, isStatement) { - if (tokType === _name) node.id = parseIdent(); - else if (isStatement) unexpected(); - else node.id = null; - node.params = []; - var first = true; - expect(_parenL); - while (!eat(_parenR)) { - if (!first) expect(_comma); else first = false; - node.params.push(parseIdent()); - } - - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldInFunc = inFunction, oldLabels = labels; - inFunction = true; labels = []; - node.body = parseBlock(true); - inFunction = oldInFunc; labels = oldLabels; - - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (strict || node.body.body.length && isUseStrict(node.body.body[0])) { - for (var i = node.id ? -1 : 0; i < node.params.length; ++i) { - var id = i < 0 ? node.id : node.params[i]; - if (isStrictReservedWord(id.name) || isStrictBadIdWord(id.name)) - raise(id.start, "Defining '" + id.name + "' in strict mode"); - if (i >= 0) for (var j = 0; j < i; ++j) if (id.name === node.params[j].name) - raise(id.start, "Argument name clash in strict mode"); - } - } - - return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - } - - // Parses a comma-separated list of expressions, and returns them as - // an array. `close` is the token type that ends the list, and - // `allowEmpty` can be turned on to allow subsequent commas with - // nothing in between them to be parsed as `null` (which is needed - // for array literals). - - function parseExprList(close, allowTrailingComma, allowEmpty) { - var elts = [], first = true; - while (!eat(close)) { - if (!first) { - expect(_comma); - if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break; - } else first = false; - - if (allowEmpty && tokType === _comma) elts.push(null); - else elts.push(parseExpression(true)); - } - return elts; - } - - // Parse the next token as an identifier. If `liberal` is true (used - // when parsing properties), it will also convert keywords into - // identifiers. - - function parseIdent(liberal) { - var node = startNode(); - node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected(); - next(); - return finishNode(node, "Identifier"); - } - -})(typeof exports === "undefined" ? (window.acorn = {}) : exports); diff --git a/ajax/libs/codemirror/3.24.0/package/test/lint/lint.js b/ajax/libs/codemirror/3.24.0/package/test/lint/lint.js deleted file mode 100644 index fda737c08..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/lint/lint.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - Simple linter, based on the Acorn [1] parser module - - All of the existing linters either cramp my style or have huge - dependencies (Closure). So here's a very simple, non-invasive one - that only spots - - - missing semicolons and trailing commas - - variables or properties that are reserved words - - assigning to a variable you didn't declare - - access to non-whitelisted globals - (use a '// declare global: foo, bar' comment to declare extra - globals in a file) - - [1]: https://github.com/marijnh/acorn/ -*/ - -var topAllowedGlobals = Object.create(null); -("Error RegExp Number String Array Function Object Math Date undefined " + - "parseInt parseFloat Infinity NaN isNaN " + - "window document navigator prompt alert confirm console " + - "FileReader Worker postMessage importScripts " + - "setInterval clearInterval setTimeout clearTimeout " + - "CodeMirror test") - .split(" ").forEach(function(n) { topAllowedGlobals[n] = true; }); - -var fs = require("fs"), acorn = require("./acorn.js"), walk = require("./walk.js"); - -var scopePasser = walk.make({ - ScopeBody: function(node, prev, c) { c(node, node.scope); } -}); - -function checkFile(fileName) { - var file = fs.readFileSync(fileName, "utf8"), notAllowed; - if (notAllowed = file.match(/[\x00-\x08\x0b\x0c\x0e-\x19\uFEFF\t]|[ \t]\n/)) { - var msg; - if (notAllowed[0] == "\t") msg = "Found tab character"; - else if (notAllowed[0].indexOf("\n") > -1) msg = "Trailing whitespace"; - else msg = "Undesirable character " + notAllowed[0].charCodeAt(0); - var info = acorn.getLineInfo(file, notAllowed.index); - fail(msg + " at line " + info.line + ", column " + info.column, {source: fileName}); - } - - var globalsSeen = Object.create(null); - - try { - var parsed = acorn.parse(file, { - locations: true, - ecmaVersion: 3, - strictSemicolons: true, - allowTrailingCommas: false, - forbidReserved: true, - sourceFile: fileName - }); - } catch (e) { - fail(e.message, {source: fileName}); - return; - } - - var scopes = []; - - walk.simple(parsed, { - ScopeBody: function(node, scope) { - node.scope = scope; - scopes.push(scope); - } - }, walk.scopeVisitor, {vars: Object.create(null)}); - - var ignoredGlobals = Object.create(null); - - function inScope(name, scope) { - for (var cur = scope; cur; cur = cur.prev) - if (name in cur.vars) return true; - } - function checkLHS(node, scope) { - if (node.type == "Identifier" && !(node.name in ignoredGlobals) && - !inScope(node.name, scope)) { - ignoredGlobals[node.name] = true; - fail("Assignment to global variable", node.loc); - } - } - - walk.simple(parsed, { - UpdateExpression: function(node, scope) {checkLHS(node.argument, scope);}, - AssignmentExpression: function(node, scope) {checkLHS(node.left, scope);}, - Identifier: function(node, scope) { - if (node.name == "arguments") return; - // Mark used identifiers - for (var cur = scope; cur; cur = cur.prev) - if (node.name in cur.vars) { - cur.vars[node.name].used = true; - return; - } - globalsSeen[node.name] = node.loc; - }, - FunctionExpression: function(node) { - if (node.id) fail("Named function expression", node.loc); - } - }, scopePasser); - - if (!globalsSeen.exports) { - var allowedGlobals = Object.create(topAllowedGlobals), m; - if (m = file.match(/\/\/ declare global:\s+(.*)/)) - m[1].split(/,\s*/g).forEach(function(n) { allowedGlobals[n] = true; }); - for (var glob in globalsSeen) - if (!(glob in allowedGlobals)) - fail("Access to global variable " + glob + ". Add a '// declare global: " + glob + - "' comment or add this variable in test/lint/lint.js.", globalsSeen[glob]); - } - - - for (var i = 0; i < scopes.length; ++i) { - var scope = scopes[i]; - for (var name in scope.vars) { - var info = scope.vars[name]; - if (!info.used && info.type != "catch clause" && info.type != "function name" && name.charAt(0) != "_") - fail("Unused " + info.type + " " + name, info.node.loc); - } - } -} - -var failed = false; -function fail(msg, pos) { - if (pos.start) msg += " (" + pos.start.line + ":" + pos.start.column + ")"; - console.log(pos.source + ": " + msg); - failed = true; -} - -function checkDir(dir) { - fs.readdirSync(dir).forEach(function(file) { - var fname = dir + "/" + file; - if (/\.js$/.test(file)) checkFile(fname); - else if (file != "dep" && fs.lstatSync(fname).isDirectory()) checkDir(fname); - }); -} - -exports.checkDir = checkDir; -exports.checkFile = checkFile; -exports.success = function() { return !failed; }; diff --git a/ajax/libs/codemirror/3.24.0/package/test/lint/walk.js b/ajax/libs/codemirror/3.24.0/package/test/lint/walk.js deleted file mode 100644 index 97321acfc..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/lint/walk.js +++ /dev/null @@ -1,216 +0,0 @@ -// AST walker module for Mozilla Parser API compatible trees - -(function(exports) { - "use strict"; - - // A simple walk is one where you simply specify callbacks to be - // called on specific nodes. The last two arguments are optional. A - // simple use would be - // - // walk.simple(myTree, { - // Expression: function(node) { ... } - // }); - // - // to do something with all expressions. All Parser API node types - // can be used to identify node types, as well as Expression, - // Statement, and ScopeBody, which denote categories of nodes. - // - // The base argument can be used to pass a custom (recursive) - // walker, and state can be used to give this walked an initial - // state. - exports.simple = function(node, visitors, base, state) { - if (!base) base = exports; - function c(node, st, override) { - var type = override || node.type, found = visitors[type]; - if (found) found(node, st); - base[type](node, st, c); - } - c(node, state); - }; - - // A recursive walk is one where your functions override the default - // walkers. They can modify and replace the state parameter that's - // threaded through the walk, and can opt how and whether to walk - // their child nodes (by calling their third argument on these - // nodes). - exports.recursive = function(node, state, funcs, base) { - var visitor = exports.make(funcs, base); - function c(node, st, override) { - visitor[override || node.type](node, st, c); - } - c(node, state); - }; - - // Used to create a custom walker. Will fill in all missing node - // type properties with the defaults. - exports.make = function(funcs, base) { - if (!base) base = exports; - var visitor = {}; - for (var type in base) - visitor[type] = funcs.hasOwnProperty(type) ? funcs[type] : base[type]; - return visitor; - }; - - function skipThrough(node, st, c) { c(node, st); } - function ignore(node, st, c) {} - - // Node walkers. - - exports.Program = exports.BlockStatement = function(node, st, c) { - for (var i = 0; i < node.body.length; ++i) - c(node.body[i], st, "Statement"); - }; - exports.Statement = skipThrough; - exports.EmptyStatement = ignore; - exports.ExpressionStatement = function(node, st, c) { - c(node.expression, st, "Expression"); - }; - exports.IfStatement = function(node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Statement"); - if (node.alternate) c(node.alternate, st, "Statement"); - }; - exports.LabeledStatement = function(node, st, c) { - c(node.body, st, "Statement"); - }; - exports.BreakStatement = exports.ContinueStatement = ignore; - exports.WithStatement = function(node, st, c) { - c(node.object, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.SwitchStatement = function(node, st, c) { - c(node.discriminant, st, "Expression"); - for (var i = 0; i < node.cases.length; ++i) { - var cs = node.cases[i]; - if (cs.test) c(cs.test, st, "Expression"); - for (var j = 0; j < cs.consequent.length; ++j) - c(cs.consequent[j], st, "Statement"); - } - }; - exports.ReturnStatement = function(node, st, c) { - if (node.argument) c(node.argument, st, "Expression"); - }; - exports.ThrowStatement = function(node, st, c) { - c(node.argument, st, "Expression"); - }; - exports.TryStatement = function(node, st, c) { - c(node.block, st, "Statement"); - for (var i = 0; i < node.handlers.length; ++i) - c(node.handlers[i].body, st, "ScopeBody"); - if (node.finalizer) c(node.finalizer, st, "Statement"); - }; - exports.WhileStatement = function(node, st, c) { - c(node.test, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.DoWhileStatement = exports.WhileStatement; - exports.ForStatement = function(node, st, c) { - if (node.init) c(node.init, st, "ForInit"); - if (node.test) c(node.test, st, "Expression"); - if (node.update) c(node.update, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.ForInStatement = function(node, st, c) { - c(node.left, st, "ForInit"); - c(node.right, st, "Expression"); - c(node.body, st, "Statement"); - }; - exports.ForInit = function(node, st, c) { - if (node.type == "VariableDeclaration") c(node, st); - else c(node, st, "Expression"); - }; - exports.DebuggerStatement = ignore; - - exports.FunctionDeclaration = function(node, st, c) { - c(node, st, "Function"); - }; - exports.VariableDeclaration = function(node, st, c) { - for (var i = 0; i < node.declarations.length; ++i) { - var decl = node.declarations[i]; - if (decl.init) c(decl.init, st, "Expression"); - } - }; - - exports.Function = function(node, st, c) { - c(node.body, st, "ScopeBody"); - }; - exports.ScopeBody = function(node, st, c) { - c(node, st, "Statement"); - }; - - exports.Expression = skipThrough; - exports.ThisExpression = ignore; - exports.ArrayExpression = function(node, st, c) { - for (var i = 0; i < node.elements.length; ++i) { - var elt = node.elements[i]; - if (elt) c(elt, st, "Expression"); - } - }; - exports.ObjectExpression = function(node, st, c) { - for (var i = 0; i < node.properties.length; ++i) - c(node.properties[i].value, st, "Expression"); - }; - exports.FunctionExpression = exports.FunctionDeclaration; - exports.SequenceExpression = function(node, st, c) { - for (var i = 0; i < node.expressions.length; ++i) - c(node.expressions[i], st, "Expression"); - }; - exports.UnaryExpression = exports.UpdateExpression = function(node, st, c) { - c(node.argument, st, "Expression"); - }; - exports.BinaryExpression = exports.AssignmentExpression = exports.LogicalExpression = function(node, st, c) { - c(node.left, st, "Expression"); - c(node.right, st, "Expression"); - }; - exports.ConditionalExpression = function(node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Expression"); - c(node.alternate, st, "Expression"); - }; - exports.NewExpression = exports.CallExpression = function(node, st, c) { - c(node.callee, st, "Expression"); - if (node.arguments) for (var i = 0; i < node.arguments.length; ++i) - c(node.arguments[i], st, "Expression"); - }; - exports.MemberExpression = function(node, st, c) { - c(node.object, st, "Expression"); - if (node.computed) c(node.property, st, "Expression"); - }; - exports.Identifier = exports.Literal = ignore; - - // A custom walker that keeps track of the scope chain and the - // variables defined in it. - function makeScope(prev) { - return {vars: Object.create(null), prev: prev}; - } - exports.scopeVisitor = exports.make({ - Function: function(node, scope, c) { - var inner = makeScope(scope); - for (var i = 0; i < node.params.length; ++i) - inner.vars[node.params[i].name] = {type: "argument", node: node.params[i]}; - if (node.id) { - var decl = node.type == "FunctionDeclaration"; - (decl ? scope : inner).vars[node.id.name] = - {type: decl ? "function" : "function name", node: node.id}; - } - c(node.body, inner, "ScopeBody"); - }, - TryStatement: function(node, scope, c) { - c(node.block, scope, "Statement"); - for (var i = 0; i < node.handlers.length; ++i) { - var handler = node.handlers[i], inner = makeScope(scope); - inner.vars[handler.param.name] = {type: "catch clause", node: handler.param}; - c(handler.body, inner, "ScopeBody"); - } - if (node.finalizer) c(node.finalizer, scope, "Statement"); - }, - VariableDeclaration: function(node, scope, c) { - for (var i = 0; i < node.declarations.length; ++i) { - var decl = node.declarations[i]; - scope.vars[decl.id.name] = {type: "var", node: decl.id}; - if (decl.init) c(decl.init, scope, "Expression"); - } - } - }); - -})(typeof exports == "undefined" ? acorn.walk = {} : exports); diff --git a/ajax/libs/codemirror/3.24.0/package/test/mode_test.css b/ajax/libs/codemirror/3.24.0/package/test/mode_test.css deleted file mode 100644 index 1ac66737f..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/mode_test.css +++ /dev/null @@ -1,10 +0,0 @@ -.mt-output .mt-token { - border: 1px solid #ddd; - white-space: pre; - font-family: "Consolas", monospace; - text-align: center; -} - -.mt-output .mt-style { - font-size: x-small; -} diff --git a/ajax/libs/codemirror/3.24.0/package/test/mode_test.js b/ajax/libs/codemirror/3.24.0/package/test/mode_test.js deleted file mode 100644 index 46174e1f7..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/mode_test.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Helper to test CodeMirror highlighting modes. It pretty prints output of the - * highlighter and can check against expected styles. - * - * Mode tests are registered by calling test.mode(testName, mode, - * tokens), where mode is a mode object as returned by - * CodeMirror.getMode, and tokens is an array of lines that make up - * the test. - * - * These lines are strings, in which styled stretches of code are - * enclosed in brackets `[]`, and prefixed by their style. For - * example, `[keyword if]`. Brackets in the code itself must be - * duplicated to prevent them from being interpreted as token - * boundaries. For example `a[[i]]` for `a[i]`. If a token has - * multiple styles, the styles must be separated by ampersands, for - * example `[tag&error ]`. - * - * See the test.js files in the css, markdown, gfm, and stex mode - * directories for examples. - */ -(function() { - function findSingle(str, pos, ch) { - for (;;) { - var found = str.indexOf(ch, pos); - if (found == -1) return null; - if (str.charAt(found + 1) != ch) return found; - pos = found + 2; - } - } - - var styleName = /[\w&-_]+/g; - function parseTokens(strs) { - var tokens = [], plain = ""; - for (var i = 0; i < strs.length; ++i) { - if (i) plain += "\n"; - var str = strs[i], pos = 0; - while (pos < str.length) { - var style = null, text; - if (str.charAt(pos) == "[" && str.charAt(pos+1) != "[") { - styleName.lastIndex = pos + 1; - var m = styleName.exec(str); - style = m[0].replace(/&/g, " "); - var textStart = pos + style.length + 2; - var end = findSingle(str, textStart, "]"); - if (end == null) throw new Error("Unterminated token at " + pos + " in '" + str + "'" + style); - text = str.slice(textStart, end); - pos = end + 1; - } else { - var end = findSingle(str, pos, "["); - if (end == null) end = str.length; - text = str.slice(pos, end); - pos = end; - } - text = text.replace(/\[\[|\]\]/g, function(s) {return s.charAt(0);}); - tokens.push(style, text); - plain += text; - } - } - return {tokens: tokens, plain: plain}; - } - - test.mode = function(name, mode, tokens, modeName) { - var data = parseTokens(tokens); - return test((modeName || mode.name) + "_" + name, function() { - return compare(data.plain, data.tokens, mode); - }); - }; - - function esc(str) { - return str.replace('&', '&').replace('<', '<'); - } - - function compare(text, expected, mode) { - - var expectedOutput = []; - for (var i = 0; i < expected.length; i += 2) { - var sty = expected[i]; - if (sty && sty.indexOf(" ")) sty = sty.split(' ').sort().join(' '); - expectedOutput.push(sty, expected[i + 1]); - } - - var observedOutput = highlight(text, mode); - - var s = ""; - var diff = highlightOutputsDifferent(expectedOutput, observedOutput); - if (diff != null) { - s += '
'; - s += '
' + esc(text) + '
'; - s += '
'; - s += 'expected:'; - s += prettyPrintOutputTable(expectedOutput, diff); - s += 'observed:'; - s += prettyPrintOutputTable(observedOutput, diff); - s += '
'; - s += '
'; - } - if (observedOutput.indentFailures) { - for (var i = 0; i < observedOutput.indentFailures.length; i++) - s += "
" + esc(observedOutput.indentFailures[i]) + "
"; - } - if (s) throw new Failure(s); - } - - function highlight(string, mode) { - var state = mode.startState() - - var lines = string.replace(/\r\n/g,'\n').split('\n'); - var st = [], pos = 0; - for (var i = 0; i < lines.length; ++i) { - var line = lines[i], newLine = true; - if (mode.indent) { - var ws = line.match(/^\s*/)[0]; - var indent = mode.indent(state, line.slice(ws.length)); - if (indent != CodeMirror.Pass && indent != ws.length) - (st.indentFailures || (st.indentFailures = [])).push( - "Indentation of line " + (i + 1) + " is " + indent + " (expected " + ws.length + ")"); - } - var stream = new CodeMirror.StringStream(line); - if (line == "" && mode.blankLine) mode.blankLine(state); - /* Start copied code from CodeMirror.highlight */ - while (!stream.eol()) { - var compare = mode.token(stream, state), substr = stream.current(); - if (compare && compare.indexOf(" ") > -1) compare = compare.split(' ').sort().join(' '); - stream.start = stream.pos; - if (pos && st[pos-2] == compare && !newLine) { - st[pos-1] += substr; - } else if (substr) { - st[pos++] = compare; st[pos++] = substr; - } - // Give up when line is ridiculously long - if (stream.pos > 5000) { - st[pos++] = null; st[pos++] = this.text.slice(stream.pos); - break; - } - newLine = false; - } - } - - return st; - } - - function highlightOutputsDifferent(o1, o2) { - var minLen = Math.min(o1.length, o2.length); - for (var i = 0; i < minLen; ++i) - if (o1[i] != o2[i]) return i >> 1; - if (o1.length > minLen || o2.length > minLen) return minLen; - } - - function prettyPrintOutputTable(output, diffAt) { - var s = ''; - s += ''; - for (var i = 0; i < output.length; i += 2) { - var style = output[i], val = output[i+1]; - s += - ''; - } - s += ''; - for (var i = 0; i < output.length; i += 2) { - s += ''; - } - s += '
' + - '' + - esc(val.replace(/ /g,'\xb7')) + - '' + - '
' + (output[i] || null) + '
'; - return s; - } -})(); diff --git a/ajax/libs/codemirror/3.24.0/package/test/phantom_driver.js b/ajax/libs/codemirror/3.24.0/package/test/phantom_driver.js deleted file mode 100644 index dbad08db6..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/phantom_driver.js +++ /dev/null @@ -1,31 +0,0 @@ -var page = require('webpage').create(); - -page.open("http://localhost:3000/test/index.html", function (status) { - if (status != "success") { - console.log("page couldn't be loaded successfully"); - phantom.exit(1); - } - waitFor(function () { - return page.evaluate(function () { - var output = document.getElementById('status'); - if (!output) { return false; } - return (/^(\d+ failures?|all passed)/i).test(output.innerText); - }); - }, function () { - var failed = page.evaluate(function () { return window.failed; }); - var output = page.evaluate(function () { - return document.getElementById('output').innerText + "\n" + - document.getElementById('status').innerText; - }); - console.log(output); - phantom.exit(failed > 0 ? 1 : 0); - }); -}); - -function waitFor (test, cb) { - if (test()) { - cb(); - } else { - setTimeout(function () { waitFor(test, cb); }, 250); - } -} diff --git a/ajax/libs/codemirror/3.24.0/package/test/run.js b/ajax/libs/codemirror/3.24.0/package/test/run.js deleted file mode 100755 index 140539c17..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/run.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node - -var lint = require("./lint/lint"); - -lint.checkDir("mode"); -lint.checkDir("lib"); -lint.checkDir("addon"); -lint.checkDir("keymap"); - -var ok = lint.success(); - -var files = new (require('node-static').Server)(); - -var server = require('http').createServer(function (req, res) { - req.addListener('end', function () { - files.serve(req, res, function (err/*, result */) { - if (err) { - console.error(err); - process.exit(1); - } - }); - }).resume(); -}).addListener('error', function (err) { - throw err; -}).listen(3000, function () { - var childProcess = require('child_process'); - var phantomjs = require("phantomjs"); - var childArgs = [ - require("path").join(__dirname, 'phantom_driver.js') - ]; - childProcess.execFile(phantomjs.path, childArgs, function (err, stdout, stderr) { - server.close(); - console.log(stdout); - if (err) console.error(err); - if (stderr) console.error(stderr); - process.exit(err || stderr || !ok ? 1 : 0); - }); -}); diff --git a/ajax/libs/codemirror/3.24.0/package/test/search_test.js b/ajax/libs/codemirror/3.24.0/package/test/search_test.js deleted file mode 100644 index 04a1e685a..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/search_test.js +++ /dev/null @@ -1,62 +0,0 @@ -(function() { - "use strict"; - - function test(name) { - var text = Array.prototype.slice.call(arguments, 1, arguments.length - 1).join("\n"); - var body = arguments[arguments.length - 1]; - return window.test("search_" + name, function() { - body(new CodeMirror.Doc(text)); - }); - } - - function run(doc, query, insensitive) { - var cursor = doc.getSearchCursor(query, null, insensitive); - for (var i = 3; i < arguments.length; i += 4) { - var found = cursor.findNext(); - is(found, "not enough results (forward)"); - eqPos(Pos(arguments[i], arguments[i + 1]), cursor.from(), "from, forward, " + (i - 3) / 4); - eqPos(Pos(arguments[i + 2], arguments[i + 3]), cursor.to(), "to, forward, " + (i - 3) / 4); - } - is(!cursor.findNext(), "too many matches (forward)"); - for (var i = arguments.length - 4; i >= 3; i -= 4) { - var found = cursor.findPrevious(); - is(found, "not enough results (backwards)"); - eqPos(Pos(arguments[i], arguments[i + 1]), cursor.from(), "from, backwards, " + (i - 3) / 4); - eqPos(Pos(arguments[i + 2], arguments[i + 3]), cursor.to(), "to, backwards, " + (i - 3) / 4); - } - is(!cursor.findPrevious(), "too many matches (backwards)"); - } - - test("simple", "abcdefg", "abcdefg", function(doc) { - run(doc, "cde", false, 0, 2, 0, 5, 1, 2, 1, 5); - }); - - test("multiline", "hallo", "goodbye", function(doc) { - run(doc, "llo\ngoo", false, 0, 2, 1, 3); - run(doc, "blah\nhall", false); - run(doc, "bye\neye", false); - }); - - test("regexp", "abcde", "abcde", function(doc) { - run(doc, /bcd/, false, 0, 1, 0, 4, 1, 1, 1, 4); - run(doc, /BCD/, false); - run(doc, /BCD/i, false, 0, 1, 0, 4, 1, 1, 1, 4); - }); - - test("insensitive", "hallo", "HALLO", "oink", "hAllO", function(doc) { - run(doc, "All", false, 3, 1, 3, 4); - run(doc, "All", true, 0, 1, 0, 4, 1, 1, 1, 4, 3, 1, 3, 4); - }); - - test("multilineInsensitive", "zie ginds komT", "De Stoomboot", "uit Spanje weer aan", function(doc) { - run(doc, "komt\nde stoomboot\nuit", false); - run(doc, "komt\nde stoomboot\nuit", true, 0, 10, 2, 3); - run(doc, "kOMt\ndE stOOmboot\nuiT", true, 0, 10, 2, 3); - }); - - test("expandingCaseFold", "İİ İİ", "uu uu", function(doc) { - if (phantom) return; // A Phantom bug makes this hang - run(doc, "", true, 0, 8, 0, 12, 1, 8, 1, 12); - run(doc, "İİ", true, 0, 3, 0, 5, 0, 6, 0, 8); - }); -})(); diff --git a/ajax/libs/codemirror/3.24.0/package/test/test.js b/ajax/libs/codemirror/3.24.0/package/test/test.js deleted file mode 100644 index 9c582c055..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/test.js +++ /dev/null @@ -1,1688 +0,0 @@ -var Pos = CodeMirror.Pos; - -CodeMirror.defaults.rtlMoveVisually = true; - -function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); -} - -function addDoc(cm, width, height) { - var content = [], line = ""; - for (var i = 0; i < width; ++i) line += "x"; - for (var i = 0; i < height; ++i) content.push(line); - cm.setValue(content.join("\n")); -} - -function byClassName(elt, cls) { - if (elt.getElementsByClassName) return elt.getElementsByClassName(cls); - var found = [], re = new RegExp("\\b" + cls + "\\b"); - function search(elt) { - if (elt.nodeType == 3) return; - if (re.test(elt.className)) found.push(elt); - for (var i = 0, e = elt.childNodes.length; i < e; ++i) - search(elt.childNodes[i]); - } - search(elt); - return found; -} - -var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent); -var mac = /Mac/.test(navigator.platform); -var phantom = /PhantomJS/.test(navigator.userAgent); -var opera = /Opera\/\./.test(navigator.userAgent); -var opera_version = opera && navigator.userAgent.match(/Version\/(\d+\.\d+)/); -if (opera_version) opera_version = Number(opera_version); -var opera_lt10 = opera && (!opera_version || opera_version < 10); - -namespace = "core_"; - -test("core_fromTextArea", function() { - var te = document.getElementById("code"); - te.value = "CONTENT"; - var cm = CodeMirror.fromTextArea(te); - is(!te.offsetHeight); - eq(cm.getValue(), "CONTENT"); - cm.setValue("foo\nbar"); - eq(cm.getValue(), "foo\nbar"); - cm.save(); - is(/^foo\r?\nbar$/.test(te.value)); - cm.setValue("xxx"); - cm.toTextArea(); - is(te.offsetHeight); - eq(te.value, "xxx"); -}); - -testCM("getRange", function(cm) { - eq(cm.getLine(0), "1234"); - eq(cm.getLine(1), "5678"); - eq(cm.getLine(2), null); - eq(cm.getLine(-1), null); - eq(cm.getRange(Pos(0, 0), Pos(0, 3)), "123"); - eq(cm.getRange(Pos(0, -1), Pos(0, 200)), "1234"); - eq(cm.getRange(Pos(0, 2), Pos(1, 2)), "34\n56"); - eq(cm.getRange(Pos(1, 2), Pos(100, 0)), "78"); -}, {value: "1234\n5678"}); - -testCM("replaceRange", function(cm) { - eq(cm.getValue(), ""); - cm.replaceRange("foo\n", Pos(0, 0)); - eq(cm.getValue(), "foo\n"); - cm.replaceRange("a\nb", Pos(0, 1)); - eq(cm.getValue(), "fa\nboo\n"); - eq(cm.lineCount(), 3); - cm.replaceRange("xyzzy", Pos(0, 0), Pos(1, 1)); - eq(cm.getValue(), "xyzzyoo\n"); - cm.replaceRange("abc", Pos(0, 0), Pos(10, 0)); - eq(cm.getValue(), "abc"); - eq(cm.lineCount(), 1); -}); - -testCM("selection", function(cm) { - cm.setSelection(Pos(0, 4), Pos(2, 2)); - is(cm.somethingSelected()); - eq(cm.getSelection(), "11\n222222\n33"); - eqPos(cm.getCursor(false), Pos(2, 2)); - eqPos(cm.getCursor(true), Pos(0, 4)); - cm.setSelection(Pos(1, 0)); - is(!cm.somethingSelected()); - eq(cm.getSelection(), ""); - eqPos(cm.getCursor(true), Pos(1, 0)); - cm.replaceSelection("abc"); - eq(cm.getSelection(), "abc"); - eq(cm.getValue(), "111111\nabc222222\n333333"); - cm.replaceSelection("def", "end"); - eq(cm.getSelection(), ""); - eqPos(cm.getCursor(true), Pos(1, 3)); - cm.setCursor(Pos(2, 1)); - eqPos(cm.getCursor(true), Pos(2, 1)); - cm.setCursor(1, 2); - eqPos(cm.getCursor(true), Pos(1, 2)); -}, {value: "111111\n222222\n333333"}); - -testCM("extendSelection", function(cm) { - cm.setExtending(true); - addDoc(cm, 10, 10); - cm.setSelection(Pos(3, 5)); - eqPos(cm.getCursor("head"), Pos(3, 5)); - eqPos(cm.getCursor("anchor"), Pos(3, 5)); - cm.setSelection(Pos(2, 5), Pos(5, 5)); - eqPos(cm.getCursor("head"), Pos(5, 5)); - eqPos(cm.getCursor("anchor"), Pos(2, 5)); - eqPos(cm.getCursor("start"), Pos(2, 5)); - eqPos(cm.getCursor("end"), Pos(5, 5)); - cm.setSelection(Pos(5, 5), Pos(2, 5)); - eqPos(cm.getCursor("head"), Pos(2, 5)); - eqPos(cm.getCursor("anchor"), Pos(5, 5)); - eqPos(cm.getCursor("start"), Pos(2, 5)); - eqPos(cm.getCursor("end"), Pos(5, 5)); - cm.extendSelection(Pos(3, 2)); - eqPos(cm.getCursor("head"), Pos(3, 2)); - eqPos(cm.getCursor("anchor"), Pos(5, 5)); - cm.extendSelection(Pos(6, 2)); - eqPos(cm.getCursor("head"), Pos(6, 2)); - eqPos(cm.getCursor("anchor"), Pos(5, 5)); - cm.extendSelection(Pos(6, 3), Pos(6, 4)); - eqPos(cm.getCursor("head"), Pos(6, 4)); - eqPos(cm.getCursor("anchor"), Pos(5, 5)); - cm.extendSelection(Pos(0, 3), Pos(0, 4)); - eqPos(cm.getCursor("head"), Pos(0, 3)); - eqPos(cm.getCursor("anchor"), Pos(5, 5)); - cm.extendSelection(Pos(4, 5), Pos(6, 5)); - eqPos(cm.getCursor("head"), Pos(6, 5)); - eqPos(cm.getCursor("anchor"), Pos(4, 5)); - cm.setExtending(false); - cm.extendSelection(Pos(0, 3), Pos(0, 4)); - eqPos(cm.getCursor("head"), Pos(0, 4)); - eqPos(cm.getCursor("anchor"), Pos(0, 3)); -}); - -testCM("lines", function(cm) { - eq(cm.getLine(0), "111111"); - eq(cm.getLine(1), "222222"); - eq(cm.getLine(-1), null); - cm.removeLine(1); - cm.setLine(1, "abc"); - eq(cm.getValue(), "111111\nabc"); -}, {value: "111111\n222222\n333333"}); - -testCM("indent", function(cm) { - cm.indentLine(1); - eq(cm.getLine(1), " blah();"); - cm.setOption("indentUnit", 8); - cm.indentLine(1); - eq(cm.getLine(1), "\tblah();"); - cm.setOption("indentUnit", 10); - cm.setOption("tabSize", 4); - cm.indentLine(1); - eq(cm.getLine(1), "\t\t blah();"); -}, {value: "if (x) {\nblah();\n}", indentUnit: 3, indentWithTabs: true, tabSize: 8}); - -testCM("indentByNumber", function(cm) { - cm.indentLine(0, 2); - eq(cm.getLine(0), " foo"); - cm.indentLine(0, -200); - eq(cm.getLine(0), "foo"); - cm.setSelection(Pos(0, 0), Pos(1, 2)); - cm.indentSelection(3); - eq(cm.getValue(), " foo\n bar\nbaz"); -}, {value: "foo\nbar\nbaz"}); - -test("core_defaults", function() { - var defsCopy = {}, defs = CodeMirror.defaults; - for (var opt in defs) defsCopy[opt] = defs[opt]; - defs.indentUnit = 5; - defs.value = "uu"; - defs.indentWithTabs = true; - defs.tabindex = 55; - var place = document.getElementById("testground"), cm = CodeMirror(place); - try { - eq(cm.getOption("indentUnit"), 5); - cm.setOption("indentUnit", 10); - eq(defs.indentUnit, 5); - eq(cm.getValue(), "uu"); - eq(cm.getOption("indentWithTabs"), true); - eq(cm.getInputField().tabIndex, 55); - } - finally { - for (var opt in defsCopy) defs[opt] = defsCopy[opt]; - place.removeChild(cm.getWrapperElement()); - } -}); - -testCM("lineInfo", function(cm) { - eq(cm.lineInfo(-1), null); - var mark = document.createElement("span"); - var lh = cm.setGutterMarker(1, "FOO", mark); - var info = cm.lineInfo(1); - eq(info.text, "222222"); - eq(info.gutterMarkers.FOO, mark); - eq(info.line, 1); - eq(cm.lineInfo(2).gutterMarkers, null); - cm.setGutterMarker(lh, "FOO", null); - eq(cm.lineInfo(1).gutterMarkers, null); - cm.setGutterMarker(1, "FOO", mark); - cm.setGutterMarker(0, "FOO", mark); - cm.clearGutter("FOO"); - eq(cm.lineInfo(0).gutterMarkers, null); - eq(cm.lineInfo(1).gutterMarkers, null); -}, {value: "111111\n222222\n333333"}); - -testCM("coords", function(cm) { - cm.setSize(null, 100); - addDoc(cm, 32, 200); - var top = cm.charCoords(Pos(0, 0)); - var bot = cm.charCoords(Pos(200, 30)); - is(top.left < bot.left); - is(top.top < bot.top); - is(top.top < top.bottom); - cm.scrollTo(null, 100); - var top2 = cm.charCoords(Pos(0, 0)); - is(top.top > top2.top); - eq(top.left, top2.left); -}); - -testCM("coordsChar", function(cm) { - addDoc(cm, 35, 70); - for (var i = 0; i < 2; ++i) { - var sys = i ? "local" : "page"; - for (var ch = 0; ch <= 35; ch += 5) { - for (var line = 0; line < 70; line += 5) { - cm.setCursor(line, ch); - var coords = cm.charCoords(Pos(line, ch), sys); - var pos = cm.coordsChar({left: coords.left + 1, top: coords.top + 1}, sys); - eqPos(pos, Pos(line, ch)); - } - } - } -}, {lineNumbers: true}); - -testCM("posFromIndex", function(cm) { - cm.setValue( - "This function should\n" + - "convert a zero based index\n" + - "to line and ch." - ); - - var examples = [ - { index: -1, line: 0, ch: 0 }, // <- Tests clipping - { index: 0, line: 0, ch: 0 }, - { index: 10, line: 0, ch: 10 }, - { index: 39, line: 1, ch: 18 }, - { index: 55, line: 2, ch: 7 }, - { index: 63, line: 2, ch: 15 }, - { index: 64, line: 2, ch: 15 } // <- Tests clipping - ]; - - for (var i = 0; i < examples.length; i++) { - var example = examples[i]; - var pos = cm.posFromIndex(example.index); - eq(pos.line, example.line); - eq(pos.ch, example.ch); - if (example.index >= 0 && example.index < 64) - eq(cm.indexFromPos(pos), example.index); - } -}); - -testCM("undo", function(cm) { - cm.setLine(0, "def"); - eq(cm.historySize().undo, 1); - cm.undo(); - eq(cm.getValue(), "abc"); - eq(cm.historySize().undo, 0); - eq(cm.historySize().redo, 1); - cm.redo(); - eq(cm.getValue(), "def"); - eq(cm.historySize().undo, 1); - eq(cm.historySize().redo, 0); - cm.setValue("1\n\n\n2"); - cm.clearHistory(); - eq(cm.historySize().undo, 0); - for (var i = 0; i < 20; ++i) { - cm.replaceRange("a", Pos(0, 0)); - cm.replaceRange("b", Pos(3, 0)); - } - eq(cm.historySize().undo, 40); - for (var i = 0; i < 40; ++i) - cm.undo(); - eq(cm.historySize().redo, 40); - eq(cm.getValue(), "1\n\n\n2"); -}, {value: "abc"}); - -testCM("undoDepth", function(cm) { - cm.replaceRange("d", Pos(0)); - cm.replaceRange("e", Pos(0)); - cm.replaceRange("f", Pos(0)); - cm.undo(); cm.undo(); cm.undo(); - eq(cm.getValue(), "abcd"); -}, {value: "abc", undoDepth: 2}); - -testCM("undoDoesntClearValue", function(cm) { - cm.undo(); - eq(cm.getValue(), "x"); -}, {value: "x"}); - -testCM("undoMultiLine", function(cm) { - cm.operation(function() { - cm.replaceRange("x", Pos(0, 0)); - cm.replaceRange("y", Pos(1, 0)); - }); - cm.undo(); - eq(cm.getValue(), "abc\ndef\nghi"); - cm.operation(function() { - cm.replaceRange("y", Pos(1, 0)); - cm.replaceRange("x", Pos(0, 0)); - }); - cm.undo(); - eq(cm.getValue(), "abc\ndef\nghi"); - cm.operation(function() { - cm.replaceRange("y", Pos(2, 0)); - cm.replaceRange("x", Pos(1, 0)); - cm.replaceRange("z", Pos(2, 0)); - }); - cm.undo(); - eq(cm.getValue(), "abc\ndef\nghi", 3); -}, {value: "abc\ndef\nghi"}); - -testCM("undoComposite", function(cm) { - cm.replaceRange("y", Pos(1)); - cm.operation(function() { - cm.replaceRange("x", Pos(0)); - cm.replaceRange("z", Pos(2)); - }); - eq(cm.getValue(), "ax\nby\ncz\n"); - cm.undo(); - eq(cm.getValue(), "a\nby\nc\n"); - cm.undo(); - eq(cm.getValue(), "a\nb\nc\n"); - cm.redo(); cm.redo(); - eq(cm.getValue(), "ax\nby\ncz\n"); -}, {value: "a\nb\nc\n"}); - -testCM("undoSelection", function(cm) { - cm.setSelection(Pos(0, 2), Pos(0, 4)); - cm.replaceSelection(""); - cm.setCursor(Pos(1, 0)); - cm.undo(); - eqPos(cm.getCursor(true), Pos(0, 2)); - eqPos(cm.getCursor(false), Pos(0, 4)); - cm.setCursor(Pos(1, 0)); - cm.redo(); - eqPos(cm.getCursor(true), Pos(0, 2)); - eqPos(cm.getCursor(false), Pos(0, 2)); -}, {value: "abcdefgh\n"}); - -testCM("markTextSingleLine", function(cm) { - forEach([{a: 0, b: 1, c: "", f: 2, t: 5}, - {a: 0, b: 4, c: "", f: 0, t: 2}, - {a: 1, b: 2, c: "x", f: 3, t: 6}, - {a: 4, b: 5, c: "", f: 3, t: 5}, - {a: 4, b: 5, c: "xx", f: 3, t: 7}, - {a: 2, b: 5, c: "", f: 2, t: 3}, - {a: 2, b: 5, c: "abcd", f: 6, t: 7}, - {a: 2, b: 6, c: "x", f: null, t: null}, - {a: 3, b: 6, c: "", f: null, t: null}, - {a: 0, b: 9, c: "hallo", f: null, t: null}, - {a: 4, b: 6, c: "x", f: 3, t: 4}, - {a: 4, b: 8, c: "", f: 3, t: 4}, - {a: 6, b: 6, c: "a", f: 3, t: 6}, - {a: 8, b: 9, c: "", f: 3, t: 6}], function(test) { - cm.setValue("1234567890"); - var r = cm.markText(Pos(0, 3), Pos(0, 6), {className: "foo"}); - cm.replaceRange(test.c, Pos(0, test.a), Pos(0, test.b)); - var f = r.find(); - eq(f && f.from.ch, test.f); eq(f && f.to.ch, test.t); - }); -}); - -testCM("markTextMultiLine", function(cm) { - function p(v) { return v && Pos(v[0], v[1]); } - forEach([{a: [0, 0], b: [0, 5], c: "", f: [0, 0], t: [2, 5]}, - {a: [0, 0], b: [0, 5], c: "foo\n", f: [1, 0], t: [3, 5]}, - {a: [0, 1], b: [0, 10], c: "", f: [0, 1], t: [2, 5]}, - {a: [0, 5], b: [0, 6], c: "x", f: [0, 6], t: [2, 5]}, - {a: [0, 0], b: [1, 0], c: "", f: [0, 0], t: [1, 5]}, - {a: [0, 6], b: [2, 4], c: "", f: [0, 5], t: [0, 7]}, - {a: [0, 6], b: [2, 4], c: "aa", f: [0, 5], t: [0, 9]}, - {a: [1, 2], b: [1, 8], c: "", f: [0, 5], t: [2, 5]}, - {a: [0, 5], b: [2, 5], c: "xx", f: null, t: null}, - {a: [0, 0], b: [2, 10], c: "x", f: null, t: null}, - {a: [1, 5], b: [2, 5], c: "", f: [0, 5], t: [1, 5]}, - {a: [2, 0], b: [2, 3], c: "", f: [0, 5], t: [2, 2]}, - {a: [2, 5], b: [3, 0], c: "a\nb", f: [0, 5], t: [2, 5]}, - {a: [2, 3], b: [3, 0], c: "x", f: [0, 5], t: [2, 3]}, - {a: [1, 1], b: [1, 9], c: "1\n2\n3", f: [0, 5], t: [4, 5]}], function(test) { - cm.setValue("aaaaaaaaaa\nbbbbbbbbbb\ncccccccccc\ndddddddd\n"); - var r = cm.markText(Pos(0, 5), Pos(2, 5), - {className: "CodeMirror-matchingbracket"}); - cm.replaceRange(test.c, p(test.a), p(test.b)); - var f = r.find(); - eqPos(f && f.from, p(test.f)); eqPos(f && f.to, p(test.t)); - }); -}); - -testCM("markTextUndo", function(cm) { - var marker1, marker2, bookmark; - marker1 = cm.markText(Pos(0, 1), Pos(0, 3), - {className: "CodeMirror-matchingbracket"}); - marker2 = cm.markText(Pos(0, 0), Pos(2, 1), - {className: "CodeMirror-matchingbracket"}); - bookmark = cm.setBookmark(Pos(1, 5)); - cm.operation(function(){ - cm.replaceRange("foo", Pos(0, 2)); - cm.replaceRange("bar\nbaz\nbug\n", Pos(2, 0), Pos(3, 0)); - }); - var v1 = cm.getValue(); - cm.setValue(""); - eq(marker1.find(), null); eq(marker2.find(), null); eq(bookmark.find(), null); - cm.undo(); - eqPos(bookmark.find(), Pos(1, 5), "still there"); - cm.undo(); - var m1Pos = marker1.find(), m2Pos = marker2.find(); - eqPos(m1Pos.from, Pos(0, 1)); eqPos(m1Pos.to, Pos(0, 3)); - eqPos(m2Pos.from, Pos(0, 0)); eqPos(m2Pos.to, Pos(2, 1)); - eqPos(bookmark.find(), Pos(1, 5)); - cm.redo(); cm.redo(); - eq(bookmark.find(), null); - cm.undo(); - eqPos(bookmark.find(), Pos(1, 5)); - eq(cm.getValue(), v1); -}, {value: "1234\n56789\n00\n"}); - -testCM("markTextStayGone", function(cm) { - var m1 = cm.markText(Pos(0, 0), Pos(0, 1)); - cm.replaceRange("hi", Pos(0, 2)); - m1.clear(); - cm.undo(); - eq(m1.find(), null); -}, {value: "hello"}); - -testCM("markTextAllowEmpty", function(cm) { - var m1 = cm.markText(Pos(0, 1), Pos(0, 2), {clearWhenEmpty: false}); - is(m1.find()); - cm.replaceRange("x", Pos(0, 0)); - is(m1.find()); - cm.replaceRange("y", Pos(0, 2)); - is(m1.find()); - cm.replaceRange("z", Pos(0, 3), Pos(0, 4)); - is(!m1.find()); - var m2 = cm.markText(Pos(0, 1), Pos(0, 2), {clearWhenEmpty: false, - inclusiveLeft: true, - inclusiveRight: true}); - cm.replaceRange("q", Pos(0, 1), Pos(0, 2)); - is(m2.find()); - cm.replaceRange("", Pos(0, 0), Pos(0, 3)); - is(!m2.find()); - var m3 = cm.markText(Pos(0, 1), Pos(0, 1), {clearWhenEmpty: false}); - cm.replaceRange("a", Pos(0, 3)); - is(m3.find()); - cm.replaceRange("b", Pos(0, 1)); - is(!m3.find()); -}, {value: "abcde"}); - -testCM("markTextStacked", function(cm) { - var m1 = cm.markText(Pos(0, 0), Pos(0, 0), {clearWhenEmpty: false}); - var m2 = cm.markText(Pos(0, 0), Pos(0, 0), {clearWhenEmpty: false}); - cm.replaceRange("B", Pos(0, 1)); - is(m1.find() && m2.find()); -}, {value: "A"}); - -testCM("undoPreservesNewMarks", function(cm) { - cm.markText(Pos(0, 3), Pos(0, 4)); - cm.markText(Pos(1, 1), Pos(1, 3)); - cm.replaceRange("", Pos(0, 3), Pos(3, 1)); - var mBefore = cm.markText(Pos(0, 0), Pos(0, 1)); - var mAfter = cm.markText(Pos(0, 5), Pos(0, 6)); - var mAround = cm.markText(Pos(0, 2), Pos(0, 4)); - cm.undo(); - eqPos(mBefore.find().from, Pos(0, 0)); - eqPos(mBefore.find().to, Pos(0, 1)); - eqPos(mAfter.find().from, Pos(3, 3)); - eqPos(mAfter.find().to, Pos(3, 4)); - eqPos(mAround.find().from, Pos(0, 2)); - eqPos(mAround.find().to, Pos(3, 2)); - var found = cm.findMarksAt(Pos(2, 2)); - eq(found.length, 1); - eq(found[0], mAround); -}, {value: "aaaa\nbbbb\ncccc\ndddd"}); - -testCM("markClearBetween", function(cm) { - cm.setValue("aaa\nbbb\nccc\nddd\n"); - cm.markText(Pos(0, 0), Pos(2)); - cm.replaceRange("aaa\nbbb\nccc", Pos(0, 0), Pos(2)); - eq(cm.findMarksAt(Pos(1, 1)).length, 0); -}); - -testCM("deleteSpanCollapsedInclusiveLeft", function(cm) { - var from = Pos(1, 0), to = Pos(1, 1); - var m = cm.markText(from, to, {collapsed: true, inclusiveLeft: true}); - // Delete collapsed span. - cm.replaceRange("", from, to); -}, {value: "abc\nX\ndef"}); - -testCM("bookmark", function(cm) { - function p(v) { return v && Pos(v[0], v[1]); } - forEach([{a: [1, 0], b: [1, 1], c: "", d: [1, 4]}, - {a: [1, 1], b: [1, 1], c: "xx", d: [1, 7]}, - {a: [1, 4], b: [1, 5], c: "ab", d: [1, 6]}, - {a: [1, 4], b: [1, 6], c: "", d: null}, - {a: [1, 5], b: [1, 6], c: "abc", d: [1, 5]}, - {a: [1, 6], b: [1, 8], c: "", d: [1, 5]}, - {a: [1, 4], b: [1, 4], c: "\n\n", d: [3, 1]}, - {bm: [1, 9], a: [1, 1], b: [1, 1], c: "\n", d: [2, 8]}], function(test) { - cm.setValue("1234567890\n1234567890\n1234567890"); - var b = cm.setBookmark(p(test.bm) || Pos(1, 5)); - cm.replaceRange(test.c, p(test.a), p(test.b)); - eqPos(b.find(), p(test.d)); - }); -}); - -testCM("bookmarkInsertLeft", function(cm) { - var br = cm.setBookmark(Pos(0, 2), {insertLeft: false}); - var bl = cm.setBookmark(Pos(0, 2), {insertLeft: true}); - cm.setCursor(Pos(0, 2)); - cm.replaceSelection("hi"); - eqPos(br.find(), Pos(0, 2)); - eqPos(bl.find(), Pos(0, 4)); - cm.replaceRange("", Pos(0, 4), Pos(0, 5)); - cm.replaceRange("", Pos(0, 2), Pos(0, 4)); - cm.replaceRange("", Pos(0, 1), Pos(0, 2)); - // Verify that deleting next to bookmarks doesn't kill them - eqPos(br.find(), Pos(0, 1)); - eqPos(bl.find(), Pos(0, 1)); -}, {value: "abcdef"}); - -testCM("bookmarkCursor", function(cm) { - var pos01 = cm.cursorCoords(Pos(0, 1)), pos11 = cm.cursorCoords(Pos(1, 1)), - pos20 = cm.cursorCoords(Pos(2, 0)), pos30 = cm.cursorCoords(Pos(3, 0)), - pos41 = cm.cursorCoords(Pos(4, 1)); - cm.setBookmark(Pos(0, 1), {widget: document.createTextNode("←"), insertLeft: true}); - cm.setBookmark(Pos(2, 0), {widget: document.createTextNode("←"), insertLeft: true}); - cm.setBookmark(Pos(1, 1), {widget: document.createTextNode("→")}); - cm.setBookmark(Pos(3, 0), {widget: document.createTextNode("→")}); - var new01 = cm.cursorCoords(Pos(0, 1)), new11 = cm.cursorCoords(Pos(1, 1)), - new20 = cm.cursorCoords(Pos(2, 0)), new30 = cm.cursorCoords(Pos(3, 0)); - is(new01.left == pos01.left && new01.top == pos01.top, "at left, middle of line"); - is(new11.left > pos11.left && new11.top == pos11.top, "at right, middle of line"); - is(new20.left == pos20.left && new20.top == pos20.top, "at left, empty line"); - is(new30.left > pos30.left && new30.top == pos30.top, "at right, empty line"); - cm.setBookmark(Pos(4, 0), {widget: document.createTextNode("→")}); - is(cm.cursorCoords(Pos(4, 1)).left > pos41.left, "single-char bug"); -}, {value: "foo\nbar\n\n\nx\ny"}); - -testCM("multiBookmarkCursor", function(cm) { - if (phantom) return; - var ms = [], m; - function add(insertLeft) { - for (var i = 0; i < 3; ++i) { - var node = document.createElement("span"); - node.innerHTML = "X"; - ms.push(cm.setBookmark(Pos(0, 1), {widget: node, insertLeft: insertLeft})); - } - } - var base1 = cm.cursorCoords(Pos(0, 1)).left, base4 = cm.cursorCoords(Pos(0, 4)).left; - add(true); - is(Math.abs(base1 - cm.cursorCoords(Pos(0, 1)).left) < .1); - while (m = ms.pop()) m.clear(); - add(false); - is(Math.abs(base4 - cm.cursorCoords(Pos(0, 1)).left) < .1); -}, {value: "abcdefg"}); - -testCM("getAllMarks", function(cm) { - addDoc(cm, 10, 10); - var m1 = cm.setBookmark(Pos(0, 2)); - var m2 = cm.markText(Pos(0, 2), Pos(3, 2)); - var m3 = cm.markText(Pos(1, 2), Pos(1, 8)); - var m4 = cm.markText(Pos(8, 0), Pos(9, 0)); - eq(cm.getAllMarks().length, 4); - m1.clear(); - m3.clear(); - eq(cm.getAllMarks().length, 2); -}); - -testCM("bug577", function(cm) { - cm.setValue("a\nb"); - cm.clearHistory(); - cm.setValue("fooooo"); - cm.undo(); -}); - -testCM("scrollSnap", function(cm) { - cm.setSize(100, 100); - addDoc(cm, 200, 200); - cm.setCursor(Pos(100, 180)); - var info = cm.getScrollInfo(); - is(info.left > 0 && info.top > 0); - cm.setCursor(Pos(0, 0)); - info = cm.getScrollInfo(); - is(info.left == 0 && info.top == 0, "scrolled clean to top"); - cm.setCursor(Pos(100, 180)); - cm.setCursor(Pos(199, 0)); - info = cm.getScrollInfo(); - is(info.left == 0 && info.top + 2 > info.height - cm.getScrollerElement().clientHeight, "scrolled clean to bottom"); -}); - -testCM("scrollIntoView", function(cm) { - if (phantom) return; - var outer = cm.getWrapperElement().getBoundingClientRect(); - function test(line, ch) { - var pos = Pos(line, ch); - cm.scrollIntoView(pos); - var box = cm.charCoords(pos, "window"); - is(box.left >= outer.left && box.right <= outer.right && - box.top >= outer.top && box.bottom <= outer.bottom); - } - addDoc(cm, 200, 200); - test(199, 199); - test(0, 0); - test(100, 100); - test(199, 0); - test(0, 199); - test(100, 100); -}); - -testCM("selectionPos", function(cm) { - if (phantom) return; - cm.setSize(100, 100); - addDoc(cm, 200, 100); - cm.setSelection(Pos(1, 100), Pos(98, 100)); - var lineWidth = cm.charCoords(Pos(0, 200), "local").left; - var lineHeight = (cm.charCoords(Pos(99)).top - cm.charCoords(Pos(0)).top) / 100; - cm.scrollTo(0, 0); - var selElt = byClassName(cm.getWrapperElement(), "CodeMirror-selected"); - var outer = cm.getWrapperElement().getBoundingClientRect(); - var sawMiddle, sawTop, sawBottom; - for (var i = 0, e = selElt.length; i < e; ++i) { - var box = selElt[i].getBoundingClientRect(); - var atLeft = box.left - outer.left < 30; - var width = box.right - box.left; - var atRight = box.right - outer.left > .8 * lineWidth; - if (atLeft && atRight) { - sawMiddle = true; - is(box.bottom - box.top > 90 * lineHeight, "middle high"); - is(width > .9 * lineWidth, "middle wide"); - } else { - is(width > .4 * lineWidth, "top/bot wide enough"); - is(width < .6 * lineWidth, "top/bot slim enough"); - if (atLeft) { - sawBottom = true; - is(box.top - outer.top > 96 * lineHeight, "bot below"); - } else if (atRight) { - sawTop = true; - is(box.top - outer.top < 2.1 * lineHeight, "top above"); - } - } - } - is(sawTop && sawBottom && sawMiddle, "all parts"); -}, null); - -testCM("restoreHistory", function(cm) { - cm.setValue("abc\ndef"); - cm.setLine(1, "hello"); - cm.setLine(0, "goop"); - cm.undo(); - var storedVal = cm.getValue(), storedHist = cm.getHistory(); - if (window.JSON) storedHist = JSON.parse(JSON.stringify(storedHist)); - eq(storedVal, "abc\nhello"); - cm.setValue(""); - cm.clearHistory(); - eq(cm.historySize().undo, 0); - cm.setValue(storedVal); - cm.setHistory(storedHist); - cm.redo(); - eq(cm.getValue(), "goop\nhello"); - cm.undo(); cm.undo(); - eq(cm.getValue(), "abc\ndef"); -}); - -testCM("doubleScrollbar", function(cm) { - var dummy = document.body.appendChild(document.createElement("p")); - dummy.style.cssText = "height: 50px; overflow: scroll; width: 50px"; - var scrollbarWidth = dummy.offsetWidth + 1 - dummy.clientWidth; - document.body.removeChild(dummy); - if (scrollbarWidth < 2) return; - cm.setSize(null, 100); - addDoc(cm, 1, 300); - var wrap = cm.getWrapperElement(); - is(wrap.offsetWidth - byClassName(wrap, "CodeMirror-lines")[0].offsetWidth <= scrollbarWidth * 1.5); -}); - -testCM("weirdLinebreaks", function(cm) { - cm.setValue("foo\nbar\rbaz\r\nquux\n\rplop"); - is(cm.getValue(), "foo\nbar\nbaz\nquux\n\nplop"); - is(cm.lineCount(), 6); - cm.setValue("\n\n"); - is(cm.lineCount(), 3); -}); - -testCM("setSize", function(cm) { - cm.setSize(100, 100); - var wrap = cm.getWrapperElement(); - is(wrap.offsetWidth, 100); - is(wrap.offsetHeight, 100); - cm.setSize("100%", "3em"); - is(wrap.style.width, "100%"); - is(wrap.style.height, "3em"); - cm.setSize(null, 40); - is(wrap.style.width, "100%"); - is(wrap.style.height, "40px"); -}); - -function foldLines(cm, start, end, autoClear) { - return cm.markText(Pos(start, 0), Pos(end - 1), { - inclusiveLeft: true, - inclusiveRight: true, - collapsed: true, - clearOnEnter: autoClear - }); -} - -testCM("collapsedLines", function(cm) { - addDoc(cm, 4, 10); - var range = foldLines(cm, 4, 5), cleared = 0; - CodeMirror.on(range, "clear", function() {cleared++;}); - cm.setCursor(Pos(3, 0)); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(5, 0)); - cm.setLine(3, "abcdefg"); - cm.setCursor(Pos(3, 6)); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(5, 4)); - cm.setLine(3, "ab"); - cm.setCursor(Pos(3, 2)); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(5, 2)); - cm.operation(function() {range.clear(); range.clear();}); - eq(cleared, 1); -}); - -testCM("collapsedRangeCoordsChar", function(cm) { - var pos_1_3 = cm.charCoords(Pos(1, 3)); - pos_1_3.left += 2; pos_1_3.top += 2; - var opts = {collapsed: true, inclusiveLeft: true, inclusiveRight: true}; - var m1 = cm.markText(Pos(0, 0), Pos(2, 0), opts); - eqPos(cm.coordsChar(pos_1_3), Pos(3, 3)); - m1.clear(); - var m1 = cm.markText(Pos(0, 0), Pos(1, 1), {collapsed: true, inclusiveLeft: true}); - var m2 = cm.markText(Pos(1, 1), Pos(2, 0), {collapsed: true, inclusiveRight: true}); - eqPos(cm.coordsChar(pos_1_3), Pos(3, 3)); - m1.clear(); m2.clear(); - var m1 = cm.markText(Pos(0, 0), Pos(1, 6), opts); - eqPos(cm.coordsChar(pos_1_3), Pos(3, 3)); -}, {value: "123456\nabcdef\nghijkl\nmnopqr\n"}); - -testCM("hiddenLinesAutoUnfold", function(cm) { - var range = foldLines(cm, 1, 3, true), cleared = 0; - CodeMirror.on(range, "clear", function() {cleared++;}); - cm.setCursor(Pos(3, 0)); - eq(cleared, 0); - cm.execCommand("goCharLeft"); - eq(cleared, 1); - range = foldLines(cm, 1, 3, true); - CodeMirror.on(range, "clear", function() {cleared++;}); - eqPos(cm.getCursor(), Pos(3, 0)); - cm.setCursor(Pos(0, 3)); - cm.execCommand("goCharRight"); - eq(cleared, 2); -}, {value: "abc\ndef\nghi\njkl"}); - -testCM("hiddenLinesSelectAll", function(cm) { // Issue #484 - addDoc(cm, 4, 20); - foldLines(cm, 0, 10); - foldLines(cm, 11, 20); - CodeMirror.commands.selectAll(cm); - eqPos(cm.getCursor(true), Pos(10, 0)); - eqPos(cm.getCursor(false), Pos(10, 4)); -}); - - -testCM("everythingFolded", function(cm) { - addDoc(cm, 2, 2); - function enterPress() { - cm.triggerOnKeyDown({type: "keydown", keyCode: 13, preventDefault: function(){}, stopPropagation: function(){}}); - } - var fold = foldLines(cm, 0, 2); - enterPress(); - eq(cm.getValue(), "xx\nxx"); - fold.clear(); - fold = foldLines(cm, 0, 2, true); - eq(fold.find(), null); - enterPress(); - eq(cm.getValue(), "\nxx\nxx"); -}); - -testCM("structuredFold", function(cm) { - if (phantom) return; - addDoc(cm, 4, 8); - var range = cm.markText(Pos(1, 2), Pos(6, 2), { - replacedWith: document.createTextNode("Q") - }); - cm.setCursor(0, 3); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(6, 2)); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), Pos(1, 2)); - CodeMirror.commands.delCharAfter(cm); - eq(cm.getValue(), "xxxx\nxxxx\nxxxx"); - addDoc(cm, 4, 8); - range = cm.markText(Pos(1, 2), Pos(6, 2), { - replacedWith: document.createTextNode("M"), - clearOnEnter: true - }); - var cleared = 0; - CodeMirror.on(range, "clear", function(){++cleared;}); - cm.setCursor(0, 3); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(6, 2)); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), Pos(6, 1)); - eq(cleared, 1); - range.clear(); - eq(cleared, 1); - range = cm.markText(Pos(1, 2), Pos(6, 2), { - replacedWith: document.createTextNode("Q"), - clearOnEnter: true - }); - range.clear(); - cm.setCursor(1, 2); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), Pos(1, 3)); - range = cm.markText(Pos(2, 0), Pos(4, 4), { - replacedWith: document.createTextNode("M") - }); - cm.setCursor(1, 0); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(2, 0)); -}, null); - -testCM("nestedFold", function(cm) { - addDoc(cm, 10, 3); - function fold(ll, cl, lr, cr) { - return cm.markText(Pos(ll, cl), Pos(lr, cr), {collapsed: true}); - } - var inner1 = fold(0, 6, 1, 3), inner2 = fold(0, 2, 1, 8), outer = fold(0, 1, 2, 3), inner0 = fold(0, 5, 0, 6); - cm.setCursor(0, 1); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), Pos(2, 3)); - inner0.clear(); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), Pos(0, 1)); - outer.clear(); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), Pos(0, 2)); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), Pos(1, 8)); - inner2.clear(); - CodeMirror.commands.goCharLeft(cm); - eqPos(cm.getCursor(), Pos(1, 7)); - cm.setCursor(0, 5); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), Pos(0, 6)); - CodeMirror.commands.goCharRight(cm); - eqPos(cm.getCursor(), Pos(1, 3)); -}); - -testCM("badNestedFold", function(cm) { - addDoc(cm, 4, 4); - cm.markText(Pos(0, 2), Pos(3, 2), {collapsed: true}); - var caught; - try {cm.markText(Pos(0, 1), Pos(0, 3), {collapsed: true});} - catch(e) {caught = e;} - is(caught instanceof Error, "no error"); - is(/overlap/i.test(caught.message), "wrong error"); -}); - -testCM("nestedFoldOnSide", function(cm) { - var m1 = cm.markText(Pos(0, 1), Pos(2, 1), {collapsed: true, inclusiveRight: true}); - var m2 = cm.markText(Pos(0, 1), Pos(0, 2), {collapsed: true}); - cm.markText(Pos(0, 1), Pos(0, 2), {collapsed: true}).clear(); - try { cm.markText(Pos(0, 1), Pos(0, 2), {collapsed: true, inclusiveLeft: true}); } - catch(e) { var caught = e; } - is(caught && /overlap/i.test(caught.message)); - var m3 = cm.markText(Pos(2, 0), Pos(2, 1), {collapsed: true}); - var m4 = cm.markText(Pos(2, 0), Pos(2, 1), {collapse: true, inclusiveRight: true}); - m1.clear(); m4.clear(); - m1 = cm.markText(Pos(0, 1), Pos(2, 1), {collapsed: true}); - cm.markText(Pos(2, 0), Pos(2, 1), {collapsed: true}).clear(); - try { cm.markText(Pos(2, 0), Pos(2, 1), {collapsed: true, inclusiveRight: true}); } - catch(e) { var caught = e; } - is(caught && /overlap/i.test(caught.message)); -}, {value: "ab\ncd\ef"}); - -testCM("wrappingInlineWidget", function(cm) { - cm.setSize("11em"); - var w = document.createElement("span"); - w.style.color = "red"; - w.innerHTML = "one two three four"; - cm.markText(Pos(0, 6), Pos(0, 9), {replacedWith: w}); - var cur0 = cm.cursorCoords(Pos(0, 0)), cur1 = cm.cursorCoords(Pos(0, 10)); - is(cur0.top < cur1.top); - is(cur0.bottom < cur1.bottom); - var curL = cm.cursorCoords(Pos(0, 6)), curR = cm.cursorCoords(Pos(0, 9)); - eq(curL.top, cur0.top); - eq(curL.bottom, cur0.bottom); - eq(curR.top, cur1.top); - eq(curR.bottom, cur1.bottom); - cm.replaceRange("", Pos(0, 9), Pos(0)); - curR = cm.cursorCoords(Pos(0, 9)); - eq(curR.top, cur1.top); - eq(curR.bottom, cur1.bottom); -}, {value: "1 2 3 xxx 4", lineWrapping: true}); - -testCM("changedInlineWidget", function(cm) { - cm.setSize("10em"); - var w = document.createElement("span"); - w.innerHTML = "x"; - var m = cm.markText(Pos(0, 4), Pos(0, 5), {replacedWith: w}); - w.innerHTML = "and now the widget is really really long all of a sudden and a scrollbar is needed"; - m.changed(); - var hScroll = byClassName(cm.getWrapperElement(), "CodeMirror-hscrollbar")[0]; - is(hScroll.scrollWidth > hScroll.clientWidth); -}, {value: "hello there"}); - -testCM("changedBookmark", function(cm) { - cm.setSize("10em"); - var w = document.createElement("span"); - w.innerHTML = "x"; - var m = cm.setBookmark(Pos(0, 4), {widget: w}); - w.innerHTML = "and now the widget is really really long all of a sudden and a scrollbar is needed"; - m.changed(); - var hScroll = byClassName(cm.getWrapperElement(), "CodeMirror-hscrollbar")[0]; - is(hScroll.scrollWidth > hScroll.clientWidth); -}, {value: "abcdefg"}); - -testCM("inlineWidget", function(cm) { - var w = cm.setBookmark(Pos(0, 2), {widget: document.createTextNode("uu")}); - cm.setCursor(0, 2); - CodeMirror.commands.goLineDown(cm); - eqPos(cm.getCursor(), Pos(1, 4)); - cm.setCursor(0, 2); - cm.replaceSelection("hi"); - eqPos(w.find(), Pos(0, 2)); - cm.setCursor(0, 1); - cm.replaceSelection("ay"); - eqPos(w.find(), Pos(0, 4)); - eq(cm.getLine(0), "uayuhiuu"); -}, {value: "uuuu\nuuuuuu"}); - -testCM("wrappingAndResizing", function(cm) { - cm.setSize(null, "auto"); - cm.setOption("lineWrapping", true); - var wrap = cm.getWrapperElement(), h0 = wrap.offsetHeight; - var doc = "xxx xxx xxx xxx xxx"; - cm.setValue(doc); - for (var step = 10, w = cm.charCoords(Pos(0, 18), "div").right;; w += step) { - cm.setSize(w); - if (wrap.offsetHeight <= h0 * (opera_lt10 ? 1.2 : 1.5)) { - if (step == 10) { w -= 10; step = 1; } - else break; - } - } - // Ensure that putting the cursor at the end of the maximally long - // line doesn't cause wrapping to happen. - cm.setCursor(Pos(0, doc.length)); - eq(wrap.offsetHeight, h0); - cm.replaceSelection("x"); - is(wrap.offsetHeight > h0, "wrapping happens"); - // Now add a max-height and, in a document consisting of - // almost-wrapped lines, go over it so that a scrollbar appears. - cm.setValue(doc + "\n" + doc + "\n"); - cm.getScrollerElement().style.maxHeight = "100px"; - cm.replaceRange("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n!\n", Pos(2, 0)); - forEach([Pos(0, doc.length), Pos(0, doc.length - 1), - Pos(0, 0), Pos(1, doc.length), Pos(1, doc.length - 1)], - function(pos) { - var coords = cm.charCoords(pos); - eqPos(pos, cm.coordsChar({left: coords.left + 2, top: coords.top + 5})); - }); -}, null, ie_lt8); - -testCM("measureEndOfLine", function(cm) { - cm.setSize(null, "auto"); - var inner = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild; - var lh = inner.offsetHeight; - for (var step = 10, w = cm.charCoords(Pos(0, 7), "div").right;; w += step) { - cm.setSize(w); - if (inner.offsetHeight < 2.5 * lh) { - if (step == 10) { w -= 10; step = 1; } - else break; - } - } - cm.setValue(cm.getValue() + "\n\n"); - var endPos = cm.charCoords(Pos(0, 18), "local"); - is(endPos.top > lh * .8, "not at top"); - is(endPos.left > w - 20, "not at right"); - endPos = cm.charCoords(Pos(0, 18)); - eqPos(cm.coordsChar({left: endPos.left, top: endPos.top + 5}), Pos(0, 18)); -}, {mode: "text/html", value: "", lineWrapping: true}, ie_lt8 || opera_lt10); - -testCM("scrollVerticallyAndHorizontally", function(cm) { - cm.setSize(100, 100); - addDoc(cm, 40, 40); - cm.setCursor(39); - var wrap = cm.getWrapperElement(), bar = byClassName(wrap, "CodeMirror-vscrollbar")[0]; - is(bar.offsetHeight < wrap.offsetHeight, "vertical scrollbar limited by horizontal one"); - var cursorBox = byClassName(wrap, "CodeMirror-cursor")[0].getBoundingClientRect(); - var editorBox = wrap.getBoundingClientRect(); - is(cursorBox.bottom < editorBox.top + cm.getScrollerElement().clientHeight, - "bottom line visible"); -}, {lineNumbers: true}); - -testCM("moveVstuck", function(cm) { - var lines = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild, h0 = lines.offsetHeight; - var val = "fooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar\n"; - cm.setValue(val); - for (var w = cm.charCoords(Pos(0, 26), "div").right * 2.8;; w += 5) { - cm.setSize(w); - if (lines.offsetHeight <= 3.5 * h0) break; - } - cm.setCursor(Pos(0, val.length - 1)); - cm.moveV(-1, "line"); - eqPos(cm.getCursor(), Pos(0, 26)); -}, {lineWrapping: true}, ie_lt8 || opera_lt10); - -testCM("collapseOnMove", function(cm) { - cm.setSelection(Pos(0, 1), Pos(2, 4)); - cm.execCommand("goLineUp"); - is(!cm.somethingSelected()); - eqPos(cm.getCursor(), Pos(0, 1)); - cm.setSelection(Pos(0, 1), Pos(2, 4)); - cm.execCommand("goPageDown"); - is(!cm.somethingSelected()); - eqPos(cm.getCursor(), Pos(2, 4)); - cm.execCommand("goLineUp"); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(0, 4)); - cm.setSelection(Pos(0, 1), Pos(2, 4)); - cm.execCommand("goCharLeft"); - is(!cm.somethingSelected()); - eqPos(cm.getCursor(), Pos(0, 1)); -}, {value: "aaaaa\nb\nccccc"}); - -testCM("clickTab", function(cm) { - var p0 = cm.charCoords(Pos(0, 0)); - eqPos(cm.coordsChar({left: p0.left + 5, top: p0.top + 5}), Pos(0, 0)); - eqPos(cm.coordsChar({left: p0.right - 5, top: p0.top + 5}), Pos(0, 1)); -}, {value: "\t\n\n", lineWrapping: true, tabSize: 8}); - -testCM("verticalScroll", function(cm) { - cm.setSize(100, 200); - cm.setValue("foo\nbar\nbaz\n"); - var sc = cm.getScrollerElement(), baseWidth = sc.scrollWidth; - cm.setLine(0, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"); - is(sc.scrollWidth > baseWidth, "scrollbar present"); - cm.setLine(0, "foo"); - if (!phantom) eq(sc.scrollWidth, baseWidth, "scrollbar gone"); - cm.setLine(0, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"); - cm.setLine(1, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh"); - is(sc.scrollWidth > baseWidth, "present again"); - var curWidth = sc.scrollWidth; - cm.setLine(0, "foo"); - is(sc.scrollWidth < curWidth, "scrollbar smaller"); - is(sc.scrollWidth > baseWidth, "but still present"); -}); - -testCM("extraKeys", function(cm) { - var outcome; - function fakeKey(expected, code, props) { - if (typeof code == "string") code = code.charCodeAt(0); - var e = {type: "keydown", keyCode: code, preventDefault: function(){}, stopPropagation: function(){}}; - if (props) for (var n in props) e[n] = props[n]; - outcome = null; - cm.triggerOnKeyDown(e); - eq(outcome, expected); - } - CodeMirror.commands.testCommand = function() {outcome = "tc";}; - CodeMirror.commands.goTestCommand = function() {outcome = "gtc";}; - cm.setOption("extraKeys", {"Shift-X": function() {outcome = "sx";}, - "X": function() {outcome = "x";}, - "Ctrl-Alt-U": function() {outcome = "cau";}, - "End": "testCommand", - "Home": "goTestCommand", - "Tab": false}); - fakeKey(null, "U"); - fakeKey("cau", "U", {ctrlKey: true, altKey: true}); - fakeKey(null, "U", {shiftKey: true, ctrlKey: true, altKey: true}); - fakeKey("x", "X"); - fakeKey("sx", "X", {shiftKey: true}); - fakeKey("tc", 35); - fakeKey(null, 35, {shiftKey: true}); - fakeKey("gtc", 36); - fakeKey("gtc", 36, {shiftKey: true}); - fakeKey(null, 9); -}, null, window.opera && mac); - -testCM("wordMovementCommands", function(cm) { - cm.execCommand("goWordLeft"); - eqPos(cm.getCursor(), Pos(0, 0)); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), Pos(0, 7)); - cm.execCommand("goWordLeft"); - eqPos(cm.getCursor(), Pos(0, 5)); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), Pos(0, 12)); - cm.execCommand("goWordLeft"); - eqPos(cm.getCursor(), Pos(0, 9)); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), Pos(0, 24)); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), Pos(1, 9)); - cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), Pos(1, 13)); - cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); - eqPos(cm.getCursor(), Pos(2, 0)); -}, {value: "this is (the) firstline.\na foo12\u00e9\u00f8\u00d7bar\n"}); - -testCM("groupMovementCommands", function(cm) { - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(0, 0)); - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(0, 4)); - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(0, 7)); - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(0, 10)); - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(0, 7)); - cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(0, 15)); - cm.setCursor(Pos(0, 17)); - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(0, 16)); - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(0, 14)); - cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(0, 20)); - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(1, 0)); - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(1, 2)); - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), Pos(1, 5)); - cm.execCommand("goGroupLeft"); cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(1, 0)); - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(0, 20)); - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), Pos(0, 16)); -}, {value: "booo ba---quux. ffff\n abc d"}); - -testCM("groupsAndWhitespace", function(cm) { - var positions = [Pos(0, 0), Pos(0, 2), Pos(0, 5), Pos(0, 9), Pos(0, 11), - Pos(1, 0), Pos(1, 2), Pos(1, 5)]; - for (var i = 1; i < positions.length; i++) { - cm.execCommand("goGroupRight"); - eqPos(cm.getCursor(), positions[i]); - } - for (var i = positions.length - 2; i >= 0; i--) { - cm.execCommand("goGroupLeft"); - eqPos(cm.getCursor(), i == 2 ? Pos(0, 6) : positions[i]); - } -}, {value: " foo +++ \n bar"}); - -testCM("charMovementCommands", function(cm) { - cm.execCommand("goCharLeft"); cm.execCommand("goColumnLeft"); - eqPos(cm.getCursor(), Pos(0, 0)); - cm.execCommand("goCharRight"); cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(0, 2)); - cm.setCursor(Pos(1, 0)); - cm.execCommand("goColumnLeft"); - eqPos(cm.getCursor(), Pos(1, 0)); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), Pos(0, 5)); - cm.execCommand("goColumnRight"); - eqPos(cm.getCursor(), Pos(0, 5)); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(1, 0)); - cm.execCommand("goLineEnd"); - eqPos(cm.getCursor(), Pos(1, 5)); - cm.execCommand("goLineStartSmart"); - eqPos(cm.getCursor(), Pos(1, 1)); - cm.execCommand("goLineStartSmart"); - eqPos(cm.getCursor(), Pos(1, 0)); - cm.setCursor(Pos(2, 0)); - cm.execCommand("goCharRight"); cm.execCommand("goColumnRight"); - eqPos(cm.getCursor(), Pos(2, 0)); -}, {value: "line1\n ine2\n"}); - -testCM("verticalMovementCommands", function(cm) { - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(0, 0)); - cm.execCommand("goLineDown"); - if (!phantom) // This fails in PhantomJS, though not in a real Webkit - eqPos(cm.getCursor(), Pos(1, 0)); - cm.setCursor(Pos(1, 12)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(2, 5)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(3, 0)); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(2, 5)); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(1, 12)); - cm.execCommand("goPageDown"); - eqPos(cm.getCursor(), Pos(5, 0)); - cm.execCommand("goPageDown"); cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(5, 0)); - cm.execCommand("goPageUp"); - eqPos(cm.getCursor(), Pos(0, 0)); -}, {value: "line1\nlong long line2\nline3\n\nline5\n"}); - -testCM("verticalMovementCommandsWrapping", function(cm) { - cm.setSize(120); - cm.setCursor(Pos(0, 5)); - cm.execCommand("goLineDown"); - eq(cm.getCursor().line, 0); - is(cm.getCursor().ch > 5, "moved beyond wrap"); - for (var i = 0; ; ++i) { - is(i < 20, "no endless loop"); - cm.execCommand("goLineDown"); - var cur = cm.getCursor(); - if (cur.line == 1) eq(cur.ch, 5); - if (cur.line == 2) { eq(cur.ch, 1); break; } - } -}, {value: "a very long line that wraps around somehow so that we can test cursor movement\nshortone\nk", - lineWrapping: true}); - -testCM("rtlMovement", function(cm) { - forEach(["خحج", "خحabcخحج", "abخحخحجcd", "abخde", "abخح2342خ1حج", "خ1ح2خح3حxج", - "خحcd", "1خحcd", "abcdeح1ج", "خمرحبها مها!", "foobarر", "خ ة ق", - ""], function(line) { - var inv = line.charAt(0) == "خ"; - cm.setValue(line + "\n"); cm.execCommand(inv ? "goLineEnd" : "goLineStart"); - var cursor = byClassName(cm.getWrapperElement(), "CodeMirror-cursor")[0]; - var prevX = cursor.offsetLeft, prevY = cursor.offsetTop; - for (var i = 0; i <= line.length; ++i) { - cm.execCommand("goCharRight"); - if (i == line.length) is(cursor.offsetTop > prevY, "next line"); - else is(cursor.offsetLeft > prevX, "moved right"); - prevX = cursor.offsetLeft; prevY = cursor.offsetTop; - } - cm.setCursor(0, 0); cm.execCommand(inv ? "goLineStart" : "goLineEnd"); - prevX = cursor.offsetLeft; - for (var i = 0; i < line.length; ++i) { - cm.execCommand("goCharLeft"); - is(cursor.offsetLeft < prevX, "moved left"); - prevX = cursor.offsetLeft; - } - }); -}); - -// Verify that updating a line clears its bidi ordering -testCM("bidiUpdate", function(cm) { - cm.setCursor(Pos(0, 2)); - cm.replaceSelection("خحج", "start"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(0, 4)); -}, {value: "abcd\n"}); - -testCM("movebyTextUnit", function(cm) { - cm.setValue("בְּרֵאשִ\ńéée\n"); - cm.execCommand("goLineEnd"); - for (var i = 0; i < 4; ++i) cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(0, 0)); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(1, 0)); - cm.execCommand("goCharRight"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(1, 3)); - cm.execCommand("goCharRight"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(1, 6)); -}); - -testCM("lineChangeEvents", function(cm) { - addDoc(cm, 3, 5); - var log = [], want = ["ch 0", "ch 1", "del 2", "ch 0", "ch 0", "del 1", "del 3", "del 4"]; - for (var i = 0; i < 5; ++i) { - CodeMirror.on(cm.getLineHandle(i), "delete", function(i) { - return function() {log.push("del " + i);}; - }(i)); - CodeMirror.on(cm.getLineHandle(i), "change", function(i) { - return function() {log.push("ch " + i);}; - }(i)); - } - cm.replaceRange("x", Pos(0, 1)); - cm.replaceRange("xy", Pos(1, 1), Pos(2)); - cm.replaceRange("foo\nbar", Pos(0, 1)); - cm.replaceRange("", Pos(0, 0), Pos(cm.lineCount())); - eq(log.length, want.length, "same length"); - for (var i = 0; i < log.length; ++i) - eq(log[i], want[i]); -}); - -testCM("scrollEntirelyToRight", function(cm) { - if (phantom) return; - addDoc(cm, 500, 2); - cm.setCursor(Pos(0, 500)); - var wrap = cm.getWrapperElement(), cur = byClassName(wrap, "CodeMirror-cursor")[0]; - is(wrap.getBoundingClientRect().right > cur.getBoundingClientRect().left); -}); - -testCM("lineWidgets", function(cm) { - addDoc(cm, 500, 3); - var last = cm.charCoords(Pos(2, 0)); - var node = document.createElement("div"); - node.innerHTML = "hi"; - var widget = cm.addLineWidget(1, node); - is(last.top < cm.charCoords(Pos(2, 0)).top, "took up space"); - cm.setCursor(Pos(1, 1)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(2, 1)); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(1, 1)); -}); - -testCM("lineWidgetFocus", function(cm) { - var place = document.getElementById("testground"); - place.className = "offscreen"; - try { - addDoc(cm, 500, 10); - var node = document.createElement("input"); - var widget = cm.addLineWidget(1, node); - node.focus(); - eq(document.activeElement, node); - cm.replaceRange("new stuff", Pos(1, 0)); - eq(document.activeElement, node); - } finally { - place.className = ""; - } -}); - -testCM("getLineNumber", function(cm) { - addDoc(cm, 2, 20); - var h1 = cm.getLineHandle(1); - eq(cm.getLineNumber(h1), 1); - cm.replaceRange("hi\nbye\n", Pos(0, 0)); - eq(cm.getLineNumber(h1), 3); - cm.setValue(""); - eq(cm.getLineNumber(h1), null); -}); - -testCM("jumpTheGap", function(cm) { - var longLine = "abcdef ghiklmnop qrstuvw xyz "; - longLine += longLine; longLine += longLine; longLine += longLine; - cm.setLine(2, longLine); - cm.setSize("200px", null); - cm.getWrapperElement().style.lineHeight = 2; - cm.refresh(); - cm.setCursor(Pos(0, 1)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(1, 1)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(2, 1)); - cm.execCommand("goLineDown"); - eq(cm.getCursor().line, 2); - is(cm.getCursor().ch > 1); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(2, 1)); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(1, 1)); - var node = document.createElement("div"); - node.innerHTML = "hi"; node.style.height = "30px"; - cm.addLineWidget(0, node); - cm.addLineWidget(1, node.cloneNode(true), {above: true}); - cm.setCursor(Pos(0, 2)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(1, 2)); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(0, 2)); -}, {lineWrapping: true, value: "abc\ndef\nghi\njkl\n"}); - -testCM("addLineClass", function(cm) { - function cls(line, text, bg, wrap) { - var i = cm.lineInfo(line); - eq(i.textClass, text); - eq(i.bgClass, bg); - eq(i.wrapClass, wrap); - } - cm.addLineClass(0, "text", "foo"); - cm.addLineClass(0, "text", "bar"); - cm.addLineClass(1, "background", "baz"); - cm.addLineClass(1, "wrap", "foo"); - cls(0, "foo bar", null, null); - cls(1, null, "baz", "foo"); - var lines = cm.display.lineDiv; - eq(byClassName(lines, "foo").length, 2); - eq(byClassName(lines, "bar").length, 1); - eq(byClassName(lines, "baz").length, 1); - cm.removeLineClass(0, "text", "foo"); - cls(0, "bar", null, null); - cm.removeLineClass(0, "text", "foo"); - cls(0, "bar", null, null); - cm.removeLineClass(0, "text", "bar"); - cls(0, null, null, null); - cm.addLineClass(1, "wrap", "quux"); - cls(1, null, "baz", "foo quux"); - cm.removeLineClass(1, "wrap"); - cls(1, null, "baz", null); -}, {value: "hohoho\n"}); - -testCM("atomicMarker", function(cm) { - addDoc(cm, 10, 10); - function atom(ll, cl, lr, cr, li, ri) { - return cm.markText(Pos(ll, cl), Pos(lr, cr), - {atomic: true, inclusiveLeft: li, inclusiveRight: ri}); - } - var m = atom(0, 1, 0, 5); - cm.setCursor(Pos(0, 1)); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(0, 5)); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), Pos(0, 1)); - m.clear(); - m = atom(0, 0, 0, 5, true); - eqPos(cm.getCursor(), Pos(0, 5), "pushed out"); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), Pos(0, 5)); - m.clear(); - m = atom(8, 4, 9, 10, false, true); - cm.setCursor(Pos(9, 8)); - eqPos(cm.getCursor(), Pos(8, 4), "set"); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(8, 4), "char right"); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(8, 4), "line down"); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), Pos(8, 3)); - m.clear(); - m = atom(1, 1, 3, 8); - cm.setCursor(Pos(0, 0)); - cm.setCursor(Pos(2, 0)); - eqPos(cm.getCursor(), Pos(3, 8)); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), Pos(1, 1)); - cm.execCommand("goCharRight"); - eqPos(cm.getCursor(), Pos(3, 8)); - cm.execCommand("goLineUp"); - eqPos(cm.getCursor(), Pos(1, 1)); - cm.execCommand("goLineDown"); - eqPos(cm.getCursor(), Pos(3, 8)); - cm.execCommand("delCharBefore"); - eq(cm.getValue().length, 80, "del chunk"); - m = atom(3, 0, 5, 5); - cm.setCursor(Pos(3, 0)); - cm.execCommand("delWordAfter"); - eq(cm.getValue().length, 53, "del chunk"); -}); - -testCM("readOnlyMarker", function(cm) { - function mark(ll, cl, lr, cr, at) { - return cm.markText(Pos(ll, cl), Pos(lr, cr), - {readOnly: true, atomic: at}); - } - var m = mark(0, 1, 0, 4); - cm.setCursor(Pos(0, 2)); - cm.replaceSelection("hi", "end"); - eqPos(cm.getCursor(), Pos(0, 2)); - eq(cm.getLine(0), "abcde"); - cm.execCommand("selectAll"); - cm.replaceSelection("oops"); - eq(cm.getValue(), "oopsbcd"); - cm.undo(); - eqPos(m.find().from, Pos(0, 1)); - eqPos(m.find().to, Pos(0, 4)); - m.clear(); - cm.setCursor(Pos(0, 2)); - cm.replaceSelection("hi"); - eq(cm.getLine(0), "abhicde"); - eqPos(cm.getCursor(), Pos(0, 4)); - m = mark(0, 2, 2, 2, true); - cm.setSelection(Pos(1, 1), Pos(2, 4)); - cm.replaceSelection("t", "end"); - eqPos(cm.getCursor(), Pos(2, 3)); - eq(cm.getLine(2), "klto"); - cm.execCommand("goCharLeft"); - cm.execCommand("goCharLeft"); - eqPos(cm.getCursor(), Pos(0, 2)); - cm.setSelection(Pos(0, 1), Pos(0, 3)); - cm.replaceSelection("xx"); - eqPos(cm.getCursor(), Pos(0, 3)); - eq(cm.getLine(0), "axxhicde"); -}, {value: "abcde\nfghij\nklmno\n"}); - -testCM("dirtyBit", function(cm) { - eq(cm.isClean(), true); - cm.replaceSelection("boo"); - eq(cm.isClean(), false); - cm.undo(); - eq(cm.isClean(), true); - cm.replaceSelection("boo"); - cm.replaceSelection("baz"); - cm.undo(); - eq(cm.isClean(), false); - cm.markClean(); - eq(cm.isClean(), true); - cm.undo(); - eq(cm.isClean(), false); - cm.redo(); - eq(cm.isClean(), true); -}); - -testCM("changeGeneration", function(cm) { - cm.replaceSelection("x", null, "+insert"); - var softGen = cm.changeGeneration(); - cm.replaceSelection("x", null, "+insert"); - cm.undo(); - eq(cm.getValue(), ""); - is(!cm.isClean(softGen)); - cm.replaceSelection("x", null, "+insert"); - var hardGen = cm.changeGeneration(true); - cm.replaceSelection("x", null, "+insert"); - cm.undo(); - eq(cm.getValue(), "x"); - is(cm.isClean(hardGen)); -}); - -testCM("addKeyMap", function(cm) { - function sendKey(code) { - cm.triggerOnKeyDown({type: "keydown", keyCode: code, - preventDefault: function(){}, stopPropagation: function(){}}); - } - - sendKey(39); - eqPos(cm.getCursor(), Pos(0, 1)); - var test = 0; - var map1 = {Right: function() { ++test; }}, map2 = {Right: function() { test += 10; }} - cm.addKeyMap(map1); - sendKey(39); - eqPos(cm.getCursor(), Pos(0, 1)); - eq(test, 1); - cm.addKeyMap(map2, true); - sendKey(39); - eq(test, 2); - cm.removeKeyMap(map1); - sendKey(39); - eq(test, 12); - cm.removeKeyMap(map2); - sendKey(39); - eq(test, 12); - eqPos(cm.getCursor(), Pos(0, 2)); - cm.addKeyMap({Right: function() { test = 55; }, name: "mymap"}); - sendKey(39); - eq(test, 55); - cm.removeKeyMap("mymap"); - sendKey(39); - eqPos(cm.getCursor(), Pos(0, 3)); -}, {value: "abc"}); - -testCM("findPosH", function(cm) { - forEach([{from: Pos(0, 0), to: Pos(0, 1), by: 1}, - {from: Pos(0, 0), to: Pos(0, 0), by: -1, hitSide: true}, - {from: Pos(0, 0), to: Pos(0, 4), by: 1, unit: "word"}, - {from: Pos(0, 0), to: Pos(0, 8), by: 2, unit: "word"}, - {from: Pos(0, 0), to: Pos(2, 0), by: 20, unit: "word", hitSide: true}, - {from: Pos(0, 7), to: Pos(0, 5), by: -1, unit: "word"}, - {from: Pos(0, 4), to: Pos(0, 8), by: 1, unit: "word"}, - {from: Pos(1, 0), to: Pos(1, 18), by: 3, unit: "word"}, - {from: Pos(1, 22), to: Pos(1, 5), by: -3, unit: "word"}, - {from: Pos(1, 15), to: Pos(1, 10), by: -5}, - {from: Pos(1, 15), to: Pos(1, 10), by: -5, unit: "column"}, - {from: Pos(1, 15), to: Pos(1, 0), by: -50, unit: "column", hitSide: true}, - {from: Pos(1, 15), to: Pos(1, 24), by: 50, unit: "column", hitSide: true}, - {from: Pos(1, 15), to: Pos(2, 0), by: 50, hitSide: true}], function(t) { - var r = cm.findPosH(t.from, t.by, t.unit || "char"); - eqPos(r, t.to); - eq(!!r.hitSide, !!t.hitSide); - }); -}, {value: "line one\nline two.something.other\n"}); - -testCM("beforeChange", function(cm) { - cm.on("beforeChange", function(cm, change) { - var text = []; - for (var i = 0; i < change.text.length; ++i) - text.push(change.text[i].replace(/\s/g, "_")); - change.update(null, null, text); - }); - cm.setValue("hello, i am a\nnew document\n"); - eq(cm.getValue(), "hello,_i_am_a\nnew_document\n"); - CodeMirror.on(cm.getDoc(), "beforeChange", function(doc, change) { - if (change.from.line == 0) change.cancel(); - }); - cm.setValue("oops"); // Canceled - eq(cm.getValue(), "hello,_i_am_a\nnew_document\n"); - cm.replaceRange("hey hey hey", Pos(1, 0), Pos(2, 0)); - eq(cm.getValue(), "hello,_i_am_a\nhey_hey_hey"); -}, {value: "abcdefghijk"}); - -testCM("beforeChangeUndo", function(cm) { - cm.setLine(0, "hi"); - cm.setLine(0, "bye"); - eq(cm.historySize().undo, 2); - cm.on("beforeChange", function(cm, change) { - is(!change.update); - change.cancel(); - }); - cm.undo(); - eq(cm.historySize().undo, 0); - eq(cm.getValue(), "bye\ntwo"); -}, {value: "one\ntwo"}); - -testCM("beforeSelectionChange", function(cm) { - function notAtEnd(cm, pos) { - var len = cm.getLine(pos.line).length; - if (!len || pos.ch == len) return Pos(pos.line, pos.ch - 1); - return pos; - } - cm.on("beforeSelectionChange", function(cm, sel) { - sel.head = notAtEnd(cm, sel.head); - sel.anchor = notAtEnd(cm, sel.anchor); - }); - - addDoc(cm, 10, 10); - cm.execCommand("goLineEnd"); - eqPos(cm.getCursor(), Pos(0, 9)); - cm.execCommand("selectAll"); - eqPos(cm.getCursor("start"), Pos(0, 0)); - eqPos(cm.getCursor("end"), Pos(9, 9)); -}); - -testCM("change_removedText", function(cm) { - cm.setValue("abc\ndef"); - - var removedText; - cm.on("change", function(cm, change) { - removedText = [change.removed, change.next && change.next.removed]; - }); - - cm.operation(function() { - cm.replaceRange("xyz", Pos(0, 0), Pos(1,1)); - cm.replaceRange("123", Pos(0,0)); - }); - - eq(removedText[0].join("\n"), "abc\nd"); - eq(removedText[1].join("\n"), ""); - - cm.undo(); - eq(removedText[0].join("\n"), "123"); - eq(removedText[1].join("\n"), "xyz"); - - cm.redo(); - eq(removedText[0].join("\n"), "abc\nd"); - eq(removedText[1].join("\n"), ""); -}); - -testCM("lineStyleFromMode", function(cm) { - CodeMirror.defineMode("test_mode", function() { - return {token: function(stream) { - if (stream.match(/^\[[^\]]*\]/)) return " line-brackets "; - if (stream.match(/^\([^\)]*\)/)) return " line-background-parens "; - if (stream.match(/^<[^>]*>/)) return " span line-line line-background-bg "; - stream.match(/^\s+|^\S+/); - }}; - }); - cm.setOption("mode", "test_mode"); - var bracketElts = byClassName(cm.getWrapperElement(), "brackets"); - eq(bracketElts.length, 1); - eq(bracketElts[0].nodeName, "PRE"); - is(!/brackets.*brackets/.test(bracketElts[0].className)); - var parenElts = byClassName(cm.getWrapperElement(), "parens"); - eq(parenElts.length, 1); - eq(parenElts[0].nodeName, "DIV"); - is(!/parens.*parens/.test(parenElts[0].className)); - eq(parenElts[0].parentElement.nodeName, "DIV"); - - eq(byClassName(cm.getWrapperElement(), "bg").length, 1); - eq(byClassName(cm.getWrapperElement(), "line").length, 1); - var spanElts = byClassName(cm.getWrapperElement(), "cm-span"); - eq(spanElts.length, 2); - is(/^\s*cm-span\s*$/.test(spanElts[0].className)); -}, {value: "line1: [br] [br]\nline2: (par) (par)\nline3: "}); - -CodeMirror.registerHelper("xxx", "a", "A"); -CodeMirror.registerHelper("xxx", "b", "B"); -CodeMirror.defineMode("yyy", function() { - return { - token: function(stream) { stream.skipToEnd(); }, - xxx: ["a", "b", "q"] - }; -}); -CodeMirror.registerGlobalHelper("xxx", "c", function(m) { return m.enableC; }, "C"); - -testCM("helpers", function(cm) { - cm.setOption("mode", "yyy"); - eq(cm.getHelpers(Pos(0, 0), "xxx").join("/"), "A/B"); - cm.setOption("mode", {name: "yyy", modeProps: {xxx: "b", enableC: true}}); - eq(cm.getHelpers(Pos(0, 0), "xxx").join("/"), "B/C"); - cm.setOption("mode", "javascript"); - eq(cm.getHelpers(Pos(0, 0), "xxx").join("/"), ""); -}); diff --git a/ajax/libs/codemirror/3.24.0/package/test/vim_test.js b/ajax/libs/codemirror/3.24.0/package/test/vim_test.js deleted file mode 100644 index 7393abfea..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/vim_test.js +++ /dev/null @@ -1,2932 +0,0 @@ -var code = '' + -' wOrd1 (#%\n' + -' word3] \n' + -'aopop pop 0 1 2 3 4\n' + -' (a) [b] {c} \n' + -'int getchar(void) {\n' + -' static char buf[BUFSIZ];\n' + -' static char *bufp = buf;\n' + -' if (n == 0) { /* buffer is empty */\n' + -' n = read(0, buf, sizeof buf);\n' + -' bufp = buf;\n' + -' }\n' + -'\n' + -' return (--n >= 0) ? (unsigned char) *bufp++ : EOF;\n' + -' \n' + -'}\n'; - -var lines = (function() { - lineText = code.split('\n'); - var ret = []; - for (var i = 0; i < lineText.length; i++) { - ret[i] = { - line: i, - length: lineText[i].length, - lineText: lineText[i], - textStart: /^\s*/.exec(lineText[i])[0].length - }; - } - return ret; -})(); -var endOfDocument = makeCursor(lines.length - 1, - lines[lines.length - 1].length); -var wordLine = lines[0]; -var bigWordLine = lines[1]; -var charLine = lines[2]; -var bracesLine = lines[3]; -var seekBraceLine = lines[4]; - -var word1 = { - start: { line: wordLine.line, ch: 1 }, - end: { line: wordLine.line, ch: 5 } -}; -var word2 = { - start: { line: wordLine.line, ch: word1.end.ch + 2 }, - end: { line: wordLine.line, ch: word1.end.ch + 4 } -}; -var word3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 5 } -}; -var bigWord1 = word1; -var bigWord2 = word2; -var bigWord3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 7 } -}; -var bigWord4 = { - start: { line: bigWordLine.line, ch: bigWord1.end.ch + 3 }, - end: { line: bigWordLine.line, ch: bigWord1.end.ch + 7 } -}; - -var oChars = [ { line: charLine.line, ch: 1 }, - { line: charLine.line, ch: 3 }, - { line: charLine.line, ch: 7 } ]; -var pChars = [ { line: charLine.line, ch: 2 }, - { line: charLine.line, ch: 4 }, - { line: charLine.line, ch: 6 }, - { line: charLine.line, ch: 8 } ]; -var numChars = [ { line: charLine.line, ch: 10 }, - { line: charLine.line, ch: 12 }, - { line: charLine.line, ch: 14 }, - { line: charLine.line, ch: 16 }, - { line: charLine.line, ch: 18 }]; -var parens1 = { - start: { line: bracesLine.line, ch: 1 }, - end: { line: bracesLine.line, ch: 3 } -}; -var squares1 = { - start: { line: bracesLine.line, ch: 5 }, - end: { line: bracesLine.line, ch: 7 } -}; -var curlys1 = { - start: { line: bracesLine.line, ch: 9 }, - end: { line: bracesLine.line, ch: 11 } -}; -var seekOutside = { - start: { line: seekBraceLine.line, ch: 1 }, - end: { line: seekBraceLine.line, ch: 16 } -}; -var seekInside = { - start: { line: seekBraceLine.line, ch: 14 }, - end: { line: seekBraceLine.line, ch: 11 } -}; - -function copyCursor(cur) { - return { ch: cur.ch, line: cur.line }; -} - -function forEach(arr, func) { - for (var i = 0; i < arr.length; i++) { - func(arr[i]); - } -} - -function testVim(name, run, opts, expectedFail) { - var vimOpts = { - lineNumbers: true, - vimMode: true, - showCursorWhenSelecting: true, - value: code - }; - for (var prop in opts) { - if (opts.hasOwnProperty(prop)) { - vimOpts[prop] = opts[prop]; - } - } - return test('vim_' + name, function() { - var place = document.getElementById("testground"); - var cm = CodeMirror(place, vimOpts); - var vim = CodeMirror.Vim.maybeInitVimState_(cm); - - function doKeysFn(cm) { - return function(args) { - if (args instanceof Array) { - arguments = args; - } - for (var i = 0; i < arguments.length; i++) { - CodeMirror.Vim.handleKey(cm, arguments[i]); - } - } - } - function doInsertModeKeysFn(cm) { - return function(args) { - if (args instanceof Array) { arguments = args; } - function executeHandler(handler) { - if (typeof handler == 'string') { - CodeMirror.commands[handler](cm); - } else { - handler(cm); - } - return true; - } - for (var i = 0; i < arguments.length; i++) { - var key = arguments[i]; - // Find key in keymap and handle. - var handled = CodeMirror.lookupKey(key, ['vim-insert'], executeHandler); - // Record for insert mode. - if (handled === true && cm.state.vim.insertMode && arguments[i] != 'Esc') { - var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges; - if (lastChange) { - lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key)); - } - } - } - } - } - function doExFn(cm) { - return function(command) { - cm.openDialog = helpers.fakeOpenDialog(command); - helpers.doKeys(':'); - } - } - function assertCursorAtFn(cm) { - return function(line, ch) { - var pos; - if (ch == null && typeof line.line == 'number') { - pos = line; - } else { - pos = makeCursor(line, ch); - } - eqPos(pos, cm.getCursor()); - } - } - function fakeOpenDialog(result) { - return function(text, callback) { - return callback(result); - } - } - function fakeOpenNotification(matcher) { - return function(text) { - matcher(text); - } - } - var helpers = { - doKeys: doKeysFn(cm), - // Warning: Only emulates keymap events, not character insertions. Use - // replaceRange to simulate character insertions. - // Keys are in CodeMirror format, NOT vim format. - doInsertModeKeys: doInsertModeKeysFn(cm), - doEx: doExFn(cm), - assertCursorAt: assertCursorAtFn(cm), - fakeOpenDialog: fakeOpenDialog, - fakeOpenNotification: fakeOpenNotification, - getRegisterController: function() { - return CodeMirror.Vim.getRegisterController(); - } - } - CodeMirror.Vim.resetVimGlobalState_(); - var successful = false; - var savedOpenNotification = cm.openNotification; - try { - run(cm, vim, helpers); - successful = true; - } finally { - cm.openNotification = savedOpenNotification; - if (!successful || verbose) { - place.style.visibility = "visible"; - } else { - place.removeChild(cm.getWrapperElement()); - } - } - }, expectedFail); -}; -testVim('qq@q', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'q', 'l', 'l', 'q'); - helpers.assertCursorAt(0,2); - helpers.doKeys('@', 'q'); - helpers.assertCursorAt(0,4); -}, { value: ' '}); -testVim('@@', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'q', 'l', 'l', 'q'); - helpers.assertCursorAt(0,2); - helpers.doKeys('@', 'q'); - helpers.assertCursorAt(0,4); - helpers.doKeys('@', '@'); - helpers.assertCursorAt(0,6); -}, { value: ' '}); -var jumplistScene = ''+ - 'word\n'+ - '(word)\n'+ - '{word\n'+ - 'word.\n'+ - '\n'+ - 'word search\n'+ - '}word\n'+ - 'word\n'+ - 'word\n'; -function testJumplist(name, keys, endPos, startPos, dialog) { - endPos = makeCursor(endPos[0], endPos[1]); - startPos = makeCursor(startPos[0], startPos[1]); - testVim(name, function(cm, vim, helpers) { - CodeMirror.Vim.resetVimGlobalState_(); - if(dialog)cm.openDialog = helpers.fakeOpenDialog('word'); - cm.setCursor(startPos); - helpers.doKeys.apply(null, keys); - helpers.assertCursorAt(endPos); - }, {value: jumplistScene}); -}; -testJumplist('jumplist_H', ['H', ''], [5,2], [5,2]); -testJumplist('jumplist_M', ['M', ''], [2,2], [2,2]); -testJumplist('jumplist_L', ['L', ''], [2,2], [2,2]); -testJumplist('jumplist_[[', ['[', '[', ''], [5,2], [5,2]); -testJumplist('jumplist_]]', [']', ']', ''], [2,2], [2,2]); -testJumplist('jumplist_G', ['G', ''], [5,2], [5,2]); -testJumplist('jumplist_gg', ['g', 'g', ''], [5,2], [5,2]); -testJumplist('jumplist_%', ['%', ''], [1,5], [1,5]); -testJumplist('jumplist_{', ['{', ''], [1,5], [1,5]); -testJumplist('jumplist_}', ['}', ''], [1,5], [1,5]); -testJumplist('jumplist_\'', ['m', 'a', 'h', '\'', 'a', 'h', ''], [1,0], [1,5]); -testJumplist('jumplist_`', ['m', 'a', 'h', '`', 'a', 'h', ''], [1,5], [1,5]); -testJumplist('jumplist_*_cachedCursor', ['*', ''], [1,3], [1,3]); -testJumplist('jumplist_#_cachedCursor', ['#', ''], [1,3], [1,3]); -testJumplist('jumplist_n', ['#', 'n', ''], [1,1], [2,3]); -testJumplist('jumplist_N', ['#', 'N', ''], [1,1], [2,3]); -testJumplist('jumplist_repeat_', ['*', '*', '*', '3', ''], [2,3], [2,3]); -testJumplist('jumplist_repeat_', ['*', '*', '*', '3', '', '2', ''], [5,0], [2,3]); -testJumplist('jumplist_repeated_motion', ['3', '*', ''], [2,3], [2,3]); -testJumplist('jumplist_/', ['/', ''], [2,3], [2,3], 'dialog'); -testJumplist('jumplist_?', ['?', ''], [2,3], [2,3], 'dialog'); -testJumplist('jumplist_skip_delted_mark', - ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], - [0,2], [0,2]); -testJumplist('jumplist_skip_delted_mark', - ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], - [1,0], [0,2]); - -/** - * @param name Name of the test - * @param keys An array of keys or a string with a single key to simulate. - * @param endPos The expected end position of the cursor. - * @param startPos The position the cursor should start at, defaults to 0, 0. - */ -function testMotion(name, keys, endPos, startPos) { - testVim(name, function(cm, vim, helpers) { - if (!startPos) { - startPos = { line: 0, ch: 0 }; - } - cm.setCursor(startPos); - helpers.doKeys(keys); - helpers.assertCursorAt(endPos); - }); -}; - -function makeCursor(line, ch) { - return { line: line, ch: ch }; -}; - -function offsetCursor(cur, offsetLine, offsetCh) { - return { line: cur.line + offsetLine, ch: cur.ch + offsetCh }; -}; - -// Motion tests -testMotion('|', '|', makeCursor(0, 0), makeCursor(0,4)); -testMotion('|_repeat', ['3', '|'], makeCursor(0, 2), makeCursor(0,4)); -testMotion('h', 'h', makeCursor(0, 0), word1.start); -testMotion('h_repeat', ['3', 'h'], offsetCursor(word1.end, 0, -3), word1.end); -testMotion('l', 'l', makeCursor(0, 1)); -testMotion('l_repeat', ['2', 'l'], makeCursor(0, 2)); -testMotion('j', 'j', offsetCursor(word1.end, 1, 0), word1.end); -testMotion('j_repeat', ['2', 'j'], offsetCursor(word1.end, 2, 0), word1.end); -testMotion('j_repeat_clip', ['1000', 'j'], endOfDocument); -testMotion('k', 'k', offsetCursor(word3.end, -1, 0), word3.end); -testMotion('k_repeat', ['2', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('k_repeat_clip', ['1000', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('w', 'w', word1.start); -testMotion('w_multiple_newlines_no_space', 'w', makeCursor(12, 2), makeCursor(11, 2)); -testMotion('w_multiple_newlines_with_space', 'w', makeCursor(14, 0), makeCursor(12, 51)); -testMotion('w_repeat', ['2', 'w'], word2.start); -testMotion('w_wrap', ['w'], word3.start, word2.start); -testMotion('w_endOfDocument', 'w', endOfDocument, endOfDocument); -testMotion('w_start_to_end', ['1000', 'w'], endOfDocument, makeCursor(0, 0)); -testMotion('W', 'W', bigWord1.start); -testMotion('W_repeat', ['2', 'W'], bigWord3.start, bigWord1.start); -testMotion('e', 'e', word1.end); -testMotion('e_repeat', ['2', 'e'], word2.end); -testMotion('e_wrap', 'e', word3.end, word2.end); -testMotion('e_endOfDocument', 'e', endOfDocument, endOfDocument); -testMotion('e_start_to_end', ['1000', 'e'], endOfDocument, makeCursor(0, 0)); -testMotion('b', 'b', word3.start, word3.end); -testMotion('b_repeat', ['2', 'b'], word2.start, word3.end); -testMotion('b_wrap', 'b', word2.start, word3.start); -testMotion('b_startOfDocument', 'b', makeCursor(0, 0), makeCursor(0, 0)); -testMotion('b_end_to_start', ['1000', 'b'], makeCursor(0, 0), endOfDocument); -testMotion('ge', ['g', 'e'], word2.end, word3.end); -testMotion('ge_repeat', ['2', 'g', 'e'], word1.end, word3.start); -testMotion('ge_wrap', ['g', 'e'], word2.end, word3.start); -testMotion('ge_startOfDocument', ['g', 'e'], makeCursor(0, 0), - makeCursor(0, 0)); -testMotion('ge_end_to_start', ['1000', 'g', 'e'], makeCursor(0, 0), endOfDocument); -testMotion('gg', ['g', 'g'], makeCursor(lines[0].line, lines[0].textStart), - makeCursor(3, 1)); -testMotion('gg_repeat', ['3', 'g', 'g'], - makeCursor(lines[2].line, lines[2].textStart)); -testMotion('G', 'G', - makeCursor(lines[lines.length - 1].line, lines[lines.length - 1].textStart), - makeCursor(3, 1)); -testMotion('G_repeat', ['3', 'G'], makeCursor(lines[2].line, - lines[2].textStart)); -// TODO: Make the test code long enough to test Ctrl-F and Ctrl-B. -testMotion('0', '0', makeCursor(0, 0), makeCursor(0, 8)); -testMotion('^', '^', makeCursor(0, lines[0].textStart), makeCursor(0, 8)); -testMotion('+', '+', makeCursor(1, lines[1].textStart), makeCursor(0, 8)); -testMotion('-', '-', makeCursor(0, lines[0].textStart), makeCursor(1, 4)); -testMotion('_', ['6','_'], makeCursor(5, lines[5].textStart), makeCursor(0, 8)); -testMotion('$', '$', makeCursor(0, lines[0].length - 1), makeCursor(0, 1)); -testMotion('$_repeat', ['2', '$'], makeCursor(1, lines[1].length - 1), - makeCursor(0, 3)); -testMotion('f', ['f', 'p'], pChars[0], makeCursor(charLine.line, 0)); -testMotion('f_repeat', ['2', 'f', 'p'], pChars[2], pChars[0]); -testMotion('f_num', ['f', '2'], numChars[2], makeCursor(charLine.line, 0)); -testMotion('t', ['t','p'], offsetCursor(pChars[0], 0, -1), - makeCursor(charLine.line, 0)); -testMotion('t_repeat', ['2', 't', 'p'], offsetCursor(pChars[2], 0, -1), - pChars[0]); -testMotion('F', ['F', 'p'], pChars[0], pChars[1]); -testMotion('F_repeat', ['2', 'F', 'p'], pChars[0], pChars[2]); -testMotion('T', ['T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[1]); -testMotion('T_repeat', ['2', 'T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[2]); -testMotion('%_parens', ['%'], parens1.end, parens1.start); -testMotion('%_squares', ['%'], squares1.end, squares1.start); -testMotion('%_braces', ['%'], curlys1.end, curlys1.start); -testMotion('%_seek_outside', ['%'], seekOutside.end, seekOutside.start); -testMotion('%_seek_inside', ['%'], seekInside.end, seekInside.start); -testVim('%_seek_skip', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,9); -}, {value:'01234"("()'}); -testVim('%_skip_string', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,4); - cm.setCursor(0,2); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,0); -}, {value:'(")")'}); -(')') -testVim('%_skip_comment', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,6); - cm.setCursor(0,3); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,0); -}, {value:'(/*)*/)'}); -// Make sure that moving down after going to the end of a line always leaves you -// at the end of a line, but preserves the offset in other cases -testVim('Changing lines after Eol operation', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['$']); - helpers.doKeys(['j']); - // After moving to Eol and then down, we should be at Eol of line 2 - helpers.assertCursorAt({ line: 1, ch: lines[1].length - 1 }); - helpers.doKeys(['j']); - // After moving down, we should be at Eol of line 3 - helpers.assertCursorAt({ line: 2, ch: lines[2].length - 1 }); - helpers.doKeys(['h']); - helpers.doKeys(['j']); - // After moving back one space and then down, since line 4 is shorter than line 2, we should - // be at Eol of line 2 - 1 - helpers.assertCursorAt({ line: 3, ch: lines[3].length - 1 }); - helpers.doKeys(['j']); - helpers.doKeys(['j']); - // After moving down again, since line 3 has enough characters, we should be back to the - // same place we were at on line 1 - helpers.assertCursorAt({ line: 5, ch: lines[2].length - 2 }); -}); -//making sure gj and gk recover from clipping -testVim('gj_gk_clipping', function(cm,vim,helpers){ - cm.setCursor(0, 1); - helpers.doKeys('g','j','g','j'); - helpers.assertCursorAt(2, 1); - helpers.doKeys('g','k','g','k'); - helpers.assertCursorAt(0, 1); -},{value: 'line 1\n\nline 2'}); -//testing a mix of j/k and gj/gk -testVim('j_k_and_gj_gk', function(cm,vim,helpers){ - cm.setSize(120); - cm.setCursor(0, 0); - //go to the last character on the first line - helpers.doKeys('$'); - //move up/down on the column within the wrapped line - //side-effect: cursor is not locked to eol anymore - helpers.doKeys('g','k'); - var cur=cm.getCursor(); - eq(cur.line,0); - is((cur.ch<176),'gk didn\'t move cursor back (1)'); - helpers.doKeys('g','j'); - helpers.assertCursorAt(0, 176); - //should move to character 177 on line 2 (j/k preserve character index within line) - helpers.doKeys('j'); - //due to different line wrapping, the cursor can be on a different screen-x now - //gj and gk preserve screen-x on movement, much like moveV - helpers.doKeys('3','g','k'); - cur=cm.getCursor(); - eq(cur.line,1); - is((cur.ch<176),'gk didn\'t move cursor back (2)'); - helpers.doKeys('g','j','2','g','j'); - //should return to the same character-index - helpers.doKeys('k'); - helpers.assertCursorAt(0, 176); -},{ lineWrapping:true, value: 'This line is intentially long to test movement of gj and gk over wrapped lines. I will start on the end of this line, then make a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'}); -testVim('gj_gk', function(cm, vim, helpers) { - if (phantom) return; - cm.setSize(120); - // Test top of document edge case. - cm.setCursor(0, 4); - helpers.doKeys('g', 'j'); - helpers.doKeys('10', 'g', 'k'); - helpers.assertCursorAt(0, 4); - - // Test moving down preserves column position. - helpers.doKeys('g', 'j'); - var pos1 = cm.getCursor(); - var expectedPos2 = { line: 0, ch: (pos1.ch - 4) * 2 + 4}; - helpers.doKeys('g', 'j'); - helpers.assertCursorAt(expectedPos2); - - // Move to the last character - cm.setCursor(0, 0); - // Move left to reset HSPos - helpers.doKeys('h'); - // Test bottom of document edge case. - helpers.doKeys('100', 'g', 'j'); - var endingPos = cm.getCursor(); - is(endingPos != 0, 'gj should not be on wrapped line 0'); - var topLeftCharCoords = cm.charCoords(makeCursor(0, 0)); - var endingCharCoords = cm.charCoords(endingPos); - is(topLeftCharCoords.left == endingCharCoords.left, 'gj should end up on column 0'); -},{ lineNumbers: false, lineWrapping:true, value: 'Thislineisintentiallylongtotestmovementofgjandgkoverwrappedlines.' }); -testVim('}', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(1, 0); - cm.setCursor(0, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(4, 0); - cm.setCursor(0, 0); - helpers.doKeys('6', '}'); - helpers.assertCursorAt(5, 0); -}, { value: 'a\n\nb\nc\n\nd' }); -testVim('{', function(cm, vim, helpers) { - cm.setCursor(5, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(4, 0); - cm.setCursor(5, 0); - helpers.doKeys('2', '{'); - helpers.assertCursorAt(1, 0); - cm.setCursor(5, 0); - helpers.doKeys('6', '{'); - helpers.assertCursorAt(0, 0); -}, { value: 'a\n\nb\nc\n\nd' }); - -// Operator tests -testVim('dl', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'l'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dl_eol', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('d', 'l'); - eq(' word1', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 5); -}, { value: ' word1 ' }); -testVim('dl_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('2', 'd', 'l'); - eq('ord1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' w', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dh', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'h'); - eq(' wrd1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('o', register.toString()); - is(!register.linewise); - eqPos(offsetCursor(curStart, 0 , -1), cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dj', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2\n word3' }); -testVim('dj_end_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dk', function(cm, vim, helpers) { - var curStart = makeCursor(1, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2\n word3' }); -testVim('dk_start_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dw_space', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dw_word', function(cm, vim, helpers) { - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq(' word2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 word2' }); -testVim('dw_only_word', function(cm, vim, helpers) { - // Test that if there is only 1 word left, dw deletes till the end of the - // line. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1 ' }); -testVim('dw_eol', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' \nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1\nword2' }); -testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line and it is followed by multiple newlines. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' \n\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1\n\nword2' }); -testVim('dw_empty_line_followed_by_whitespace', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq(' \nword', cm.getValue()); -}, { value: '\n \nword' }); -testVim('dw_empty_line_followed_by_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('word', cm.getValue()); -}, { value: '\nword' }); -testVim('dw_empty_line_followed_by_empty_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n', cm.getValue()); -}, { value: '\n\n' }); -testVim('dw_whitespace_followed_by_whitespace', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n \n', cm.getValue()); -}, { value: ' \n \n' }); -testVim('dw_whitespace_followed_by_empty_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n\n', cm.getValue()); -}, { value: ' \n\n' }); -testVim('dw_word_whitespace_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n \nword2', cm.getValue()); -}, { value: 'word1\n \nword2'}) -testVim('dw_end_of_document', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('d', 'w'); - eq('\nab', cm.getValue()); -}, { value: '\nabc' }); -testVim('dw_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - cm.setCursor(0, 1); - helpers.doKeys('d', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1\nword2' }); -testVim('de_word_start_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'e'); - eq('\n\n', cm.getValue()); -}, { value: 'word\n\n' }); -testVim('de_word_end_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('d', 'e'); - eq('wor', cm.getValue()); -}, { value: 'word\n\n\n' }); -testVim('de_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'e'); - eq('', cm.getValue()); -}, { value: ' \n\n\n' }); -testVim('de_end_of_document', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('d', 'e'); - eq('\nab', cm.getValue()); -}, { value: '\nabc' }); -testVim('db_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('\n\n', cm.getValue()); -}, { value: '\n\n\n' }); -testVim('db_word_start_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('\nword', cm.getValue()); -}, { value: '\n\nword' }); -testVim('db_word_end_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 3); - helpers.doKeys('d', 'b'); - eq('\n\nd', cm.getValue()); -}, { value: '\n\nword' }); -testVim('db_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('', cm.getValue()); -}, { value: '\n \n' }); -testVim('db_start_of_document', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'b'); - eq('abc\n', cm.getValue()); -}, { value: 'abc\n' }); -testVim('dge_empty_lines', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doKeys('d', 'g', 'e'); - // Note: In real VIM the result should be '', but it's not quite consistent, - // since 2 newlines are deleted. But in the similar case of word\n\n, only - // 1 newline is deleted. We'll diverge from VIM's behavior since it's much - // easier this way. - eq('\n', cm.getValue()); -}, { value: '\n\n' }); -testVim('dge_word_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doKeys('d', 'g', 'e'); - eq('wor\n', cm.getValue()); -}, { value: 'word\n\n'}); -testVim('dge_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'g', 'e'); - eq('', cm.getValue()); -}, { value: '\n \n' }); -testVim('dge_start_of_document', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'g', 'e'); - eq('bc\n', cm.getValue()); -}, { value: 'abc\n' }); -testVim('d_inclusive', function(cm, vim, helpers) { - // Assert that when inclusive is set, the character the cursor is on gets - // deleted too. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'e'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('d_reverse', function(cm, vim, helpers) { - // Test that deleting in reverse works. - cm.setCursor(1, 0); - helpers.doKeys('d', 'b'); - eq(' word2 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\n', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2 ' }); -testVim('dd', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 1, ch: 0 }); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[1].textStart); -}); -testVim('dd_prefix_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('2', 'd', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[2].textStart); -}); -testVim('dd_motion_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('d', '2', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[2].textStart); -}); -testVim('dd_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 6; - helpers.doKeys('2', 'd', '3', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[6].textStart); -}); -testVim('dd_lastline', function(cm, vim, helpers) { - cm.setCursor(cm.lineCount(), 0); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - helpers.assertCursorAt(cm.lineCount() - 1, 0); -}); -// Yank commands should behave the exact same as d commands, expect that nothing -// gets deleted. -testVim('yw_repeat', function(cm, vim, helpers) { - // Assert that yw does yank newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('y', '2', 'w'); - eq(' word1\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('yy_multiply_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount(); - helpers.doKeys('2', 'y', '3', 'y'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - eqPos(curStart, cm.getCursor()); -}); -// Change commands behave like d commands except that it also enters insert -// mode. In addition, when the change is linewise, an additional newline is -// inserted so that insert mode starts on that line. -testVim('cw', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('c', '2', 'w'); - eq(' word3', cm.getValue()); - helpers.assertCursorAt(0, 0); -}, { value: 'word1 word2 word3'}); -testVim('cw_repeat', function(cm, vim, helpers) { - // Assert that cw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('c', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2' }); -testVim('cc_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 5; - helpers.doKeys('2', 'c', '3', 'c'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('cc_append', function(cm, vim, helpers) { - var expectedLineCount = cm.lineCount(); - cm.setCursor(cm.lastLine(), 0); - helpers.doKeys('c', 'c'); - eq(expectedLineCount, cm.lineCount()); -}); -// Swapcase commands edit in place and do not modify registers. -testVim('g~w_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('g', '~', '2', 'w'); - eq(' WORD1\nWORD2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('g~g~', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedLineCount = cm.lineCount(); - var expectedValue = cm.getValue().toUpperCase(); - helpers.doKeys('2', 'g', '~', '3', 'g', '~'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2\nword3\nword4\nword5\nword6' }); -testVim('>{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('>', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('>>', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('2', '>', '>'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('<{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('<', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); -testVim('<<', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('2', '<', '<'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); - -// Edit tests -function testEdit(name, before, pos, edit, after) { - return testVim(name, function(cm, vim, helpers) { - cm.setCursor(0, before.search(pos)); - helpers.doKeys.apply(this, edit.split('')); - eq(after, cm.getValue()); - }, {value: before}); -} - -// These Delete tests effectively cover word-wise Change, Visual & Yank. -// Tabs are used as differentiated whitespace to catch edge cases. -// Normal word: -testEdit('diw_mid_spc', 'foo \tbAr\t baz', /A/, 'diw', 'foo \t\t baz'); -testEdit('daw_mid_spc', 'foo \tbAr\t baz', /A/, 'daw', 'foo \tbaz'); -testEdit('diw_mid_punct', 'foo \tbAr.\t baz', /A/, 'diw', 'foo \t.\t baz'); -testEdit('daw_mid_punct', 'foo \tbAr.\t baz', /A/, 'daw', 'foo.\t baz'); -testEdit('diw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diw', 'foo \t,.\t baz'); -testEdit('daw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daw', 'foo \t,.\t baz'); -testEdit('diw_start_spc', 'bAr \tbaz', /A/, 'diw', ' \tbaz'); -testEdit('daw_start_spc', 'bAr \tbaz', /A/, 'daw', 'baz'); -testEdit('diw_start_punct', 'bAr. \tbaz', /A/, 'diw', '. \tbaz'); -testEdit('daw_start_punct', 'bAr. \tbaz', /A/, 'daw', '. \tbaz'); -testEdit('diw_end_spc', 'foo \tbAr', /A/, 'diw', 'foo \t'); -testEdit('daw_end_spc', 'foo \tbAr', /A/, 'daw', 'foo'); -testEdit('diw_end_punct', 'foo \tbAr.', /A/, 'diw', 'foo \t.'); -testEdit('daw_end_punct', 'foo \tbAr.', /A/, 'daw', 'foo.'); -// Big word: -testEdit('diW_mid_spc', 'foo \tbAr\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_spc', 'foo \tbAr\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_mid_punct', 'foo \tbAr.\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_punct', 'foo \tbAr.\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_start_spc', 'bAr\t baz', /A/, 'diW', '\t baz'); -testEdit('daW_start_spc', 'bAr\t baz', /A/, 'daW', 'baz'); -testEdit('diW_start_punct', 'bAr.\t baz', /A/, 'diW', '\t baz'); -testEdit('daW_start_punct', 'bAr.\t baz', /A/, 'daW', 'baz'); -testEdit('diW_end_spc', 'foo \tbAr', /A/, 'diW', 'foo \t'); -testEdit('daW_end_spc', 'foo \tbAr', /A/, 'daW', 'foo'); -testEdit('diW_end_punct', 'foo \tbAr.', /A/, 'diW', 'foo \t'); -testEdit('daW_end_punct', 'foo \tbAr.', /A/, 'daW', 'foo'); -// Deleting text objects -// Open and close on same line -testEdit('di(_open_spc', 'foo (bAr) baz', /\(/, 'di(', 'foo () baz'); -testEdit('di)_open_spc', 'foo (bAr) baz', /\(/, 'di)', 'foo () baz'); -testEdit('da(_open_spc', 'foo (bAr) baz', /\(/, 'da(', 'foo baz'); -testEdit('da)_open_spc', 'foo (bAr) baz', /\(/, 'da)', 'foo baz'); - -testEdit('di(_middle_spc', 'foo (bAr) baz', /A/, 'di(', 'foo () baz'); -testEdit('di)_middle_spc', 'foo (bAr) baz', /A/, 'di)', 'foo () baz'); -testEdit('da(_middle_spc', 'foo (bAr) baz', /A/, 'da(', 'foo baz'); -testEdit('da)_middle_spc', 'foo (bAr) baz', /A/, 'da)', 'foo baz'); - -testEdit('di(_close_spc', 'foo (bAr) baz', /\)/, 'di(', 'foo () baz'); -testEdit('di)_close_spc', 'foo (bAr) baz', /\)/, 'di)', 'foo () baz'); -testEdit('da(_close_spc', 'foo (bAr) baz', /\)/, 'da(', 'foo baz'); -testEdit('da)_close_spc', 'foo (bAr) baz', /\)/, 'da)', 'foo baz'); - -// Open and close on different lines, equally indented -testEdit('di{_middle_spc', 'a{\n\tbar\n}b', /r/, 'di{', 'a{}b'); -testEdit('di}_middle_spc', 'a{\n\tbar\n}b', /r/, 'di}', 'a{}b'); -testEdit('da{_middle_spc', 'a{\n\tbar\n}b', /r/, 'da{', 'ab'); -testEdit('da}_middle_spc', 'a{\n\tbar\n}b', /r/, 'da}', 'ab'); - -// open and close on diff lines, open indented less than close -testEdit('di{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di{', 'a{}b'); -testEdit('di}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di}', 'a{}b'); -testEdit('da{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da{', 'ab'); -testEdit('da}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da}', 'ab'); - -// open and close on diff lines, open indented more than close -testEdit('di[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di[', 'a\t[]b'); -testEdit('di]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di]', 'a\t[]b'); -testEdit('da[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da[', 'a\tb'); -testEdit('da]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da]', 'a\tb'); - -// Operator-motion tests -testVim('D', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('D'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 2); -}, { value: ' word1\nword2\n word3' }); -testVim('C', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('C'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2\n word3' }); -testVim('Y', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('Y'); - eq(' word1\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\n word3' }); -testVim('~', function(cm, vim, helpers) { - helpers.doKeys('3', '~'); - eq('ABCdefg', cm.getValue()); - helpers.assertCursorAt(0, 3); -}, { value: 'abcdefg' }); - -// Action tests -testVim('ctrl-a', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(''); - eq('-9', cm.getValue()); - helpers.assertCursorAt(0, 1); - helpers.doKeys('2',''); - eq('-7', cm.getValue()); -}, {value: '-10'}); -testVim('ctrl-x', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(''); - eq('-1', cm.getValue()); - helpers.assertCursorAt(0, 1); - helpers.doKeys('2',''); - eq('-3', cm.getValue()); -}, {value: '0'}); -testVim('/ search forward', function(cm, vim, helpers) { - forEach(['', ''], function(key) { - cm.setCursor(0, 0); - helpers.doKeys(key); - helpers.assertCursorAt(0, 5); - helpers.doKeys('l'); - helpers.doKeys(key); - helpers.assertCursorAt(0, 10); - cm.setCursor(0, 11); - helpers.doKeys(key); - helpers.assertCursorAt(0, 11); - }); -}, {value: '__jmp1 jmp2 jmp'}); -testVim('a', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('a'); - helpers.assertCursorAt(0, 2); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('a_eol', function(cm, vim, helpers) { - cm.setCursor(0, lines[0].length - 1); - helpers.doKeys('a'); - helpers.assertCursorAt(0, lines[0].length); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('i', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('i'); - helpers.assertCursorAt(0, 1); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('i_repeat', function(cm, vim, helpers) { - helpers.doKeys('3', 'i'); - cm.replaceRange('test', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - eq('testtesttest', cm.getValue()); - helpers.assertCursorAt(0, 11); -}, { value: '' }); -testVim('i_repeat_delete', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('2', 'i'); - cm.replaceRange('z', cm.getCursor()); - helpers.doInsertModeKeys('Backspace', 'Backspace', 'Esc'); - eq('abe', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'abcde' }); -testVim('A', function(cm, vim, helpers) { - helpers.doKeys('A'); - helpers.assertCursorAt(0, lines[0].length); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('I', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('I'); - helpers.assertCursorAt(0, lines[0].textStart); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('I_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'I'); - cm.replaceRange('test', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - eq('testtesttestblah', cm.getValue()); - helpers.assertCursorAt(0, 11); -}, { value: 'blah' }); -testVim('o', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('o'); - eq('word1\n\nword2', cm.getValue()); - helpers.assertCursorAt(1, 0); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('o_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('3', 'o'); - cm.replaceRange('test', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - eq('\ntest\ntest\ntest', cm.getValue()); - helpers.assertCursorAt(3, 3); -}, { value: '' }); -testVim('O', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('O'); - eq('\nword1\nword2', cm.getValue()); - helpers.assertCursorAt(0, 0); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('J', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('J'); - var expectedValue = 'word1 word2\nword3\n word4'; - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(0, expectedValue.indexOf('word2') - 1); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('J_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('3', 'J'); - var expectedValue = 'word1 word2 word3\n word4'; - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(0, expectedValue.indexOf('word3') - 1); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('p', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('p'); - eq('__abc\ndef_', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').setText('abc\ndef', false); - helpers.doKeys('"', 'a', 'p'); - eq('__abc\ndef_', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_wrong_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').setText('abc\ndef', false); - helpers.doKeys('p'); - eq('___', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: '___' }); -testVim('p_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_lastline', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('P', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('P'); - eq('_abc\ndef__', cm.getValue()); - helpers.assertCursorAt(1, 3); -}, { value: '___' }); -testVim('P_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'P'); - eq(' a\nd\n a\nd\n___', cm.getValue()); - helpers.assertCursorAt(0, 2); -}, { value: '___' }); -testVim('r', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'r', 'u'); - eq('wuuuet\nanother', cm.getValue(),'3r failed'); - helpers.assertCursorAt(0, 3); - cm.setCursor(0, 4); - helpers.doKeys('v', 'j', 'h', 'r', ''); - eq('wuuu \n her', cm.getValue(),'Replacing selection by space-characters failed'); -}, { value: 'wordet\nanother' }); -testVim('R', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('R'); - helpers.assertCursorAt(0, 1); - eq('vim-replace', cm.getOption('keyMap')); - is(cm.state.overwrite, 'Setting overwrite state failed'); -}); -testVim('mark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('`', 't'); - helpers.assertCursorAt(2, 2); - cm.setCursor(2, 0); - cm.replaceRange(' h', cm.getCursor()); - cm.setCursor(0, 0); - helpers.doKeys('\'', 't'); - helpers.assertCursorAt(2, 3); -}); -testVim('jumpToMark_next', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 2); - cm.setCursor(0, 0); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_next_repeat', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(0, 0); - helpers.doKeys('2', ']', '`'); - helpers.assertCursorAt(3, 2); - cm.setCursor(0, 0); - helpers.doKeys('2', ']', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_next_sameline', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 2); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 4); -}); -testVim('jumpToMark_next_onlyprev', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(4, 0); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(4, 0); -}); -testVim('jumpToMark_next_nomark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 2); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_next_linewise_over', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 1); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_next_action', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('d', ']', '`'); - helpers.assertCursorAt(0, 0); - var actual = cm.getLine(0); - var expected = 'pop pop 0 1 2 3 4'; - eq(actual, expected, "Deleting while jumping to the next mark failed."); -}); -testVim('jumpToMark_next_line_action', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('d', ']', '\''); - helpers.assertCursorAt(0, 1); - var actual = cm.getLine(0); - var expected = ' (a) [b] {c} ' - eq(actual, expected, "Deleting while jumping to the next mark line failed."); -}); -testVim('jumpToMark_prev', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(4, 0); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 2); - cm.setCursor(4, 0); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_repeat', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(5, 0); - helpers.doKeys('2', '[', '`'); - helpers.assertCursorAt(3, 2); - cm.setCursor(5, 0); - helpers.doKeys('2', '[', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_prev_sameline', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 2); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_onlynext', function(cm, vim, helpers) { - cm.setCursor(4, 4); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 0); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_nomark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 2); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_linewise_over', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 6); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('delmark_single', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 't'); - helpers.doEx('delmarks t'); - cm.setCursor(0, 0); - helpers.doKeys('`', 't'); - helpers.assertCursorAt(0, 0); -}); -testVim('delmark_range', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks b-d'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_multi', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks bcd'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_multi_space', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks b c d'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_all', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks a b-de'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(0, 0); -}); -testVim('visual', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l'); - helpers.assertCursorAt(0, 3); - eqPos(makeCursor(0, 1), cm.getCursor('anchor')); - helpers.doKeys('d'); - eq('15', cm.getValue()); -}, { value: '12345' }); -testVim('visual_line', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'd'); - eq(' 4\n 5', cm.getValue()); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('visual_marks', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l', 'j', 'j', 'v'); - // Test visual mode marks - cm.setCursor(2, 1); - helpers.doKeys('\'', '<'); - helpers.assertCursorAt(0, 1); - helpers.doKeys('\'', '>'); - helpers.assertCursorAt(2, 0); -}); -testVim('visual_join', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'J'); - eq(' 1 2 3\n 4\n 5', cm.getValue()); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('visual_blank', function(cm, vim, helpers) { - helpers.doKeys('v', 'k'); - eq(vim.visualMode, true); -}, { value: '\n' }); -testVim('reselect_visual', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l', 'y', 'g', 'v'); - helpers.assertCursorAt(0, 3); - eqPos(makeCursor(0, 1), cm.getCursor('anchor')); - helpers.doKeys('d'); - eq('15', cm.getValue()); -}, { value: '12345' }); -testVim('reselect_visual_line', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'V', 'g', 'v', 'd'); - eq(' 4\n 5', cm.getValue()); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('s_normal', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('s'); - helpers.doInsertModeKeys('Esc'); - helpers.assertCursorAt(0, 0); - eq('ac', cm.getValue()); -}, { value: 'abc'}); -testVim('s_visual', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v', 's'); - helpers.doInsertModeKeys('Esc'); - helpers.assertCursorAt(0, 0); - eq('ac', cm.getValue()); -}, { value: 'abc'}); -testVim('o_visual', function(cm,vim,helpers) { - cm.setCursor(0,0); - helpers.doKeys('v','l','l','l','o'); - helpers.assertCursorAt(0,0); - helpers.doKeys('v','v','j','j','j','o'); - helpers.assertCursorAt(0,0); - helpers.doKeys('o'); - helpers.doKeys('l','l') - helpers.assertCursorAt(3,2); - helpers.doKeys('d'); - eq('p',cm.getValue()); -}, { value: 'abcd\nefgh\nijkl\nmnop'}); - -testVim('S_normal', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('j', 'S'); - helpers.doInsertModeKeys('Esc'); - helpers.assertCursorAt(1, 0); - eq('aa\n\ncc', cm.getValue()); -}, { value: 'aa\nbb\ncc'}); -testVim('S_visual', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v', 'j', 'S'); - helpers.doInsertModeKeys('Esc'); - helpers.assertCursorAt(0, 0); - eq('\ncc', cm.getValue()); -}, { value: 'aa\nbb\ncc'}); - -testVim('/ and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 11); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 6); - helpers.doKeys('N'); - helpers.assertCursorAt(0, 11); - - cm.setCursor(0, 0); - helpers.doKeys('2', '/'); - helpers.assertCursorAt(1, 6); -}, { value: 'match nope match \n nope Match' }); -testVim('/_case', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('Match'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 6); -}, { value: 'match nope match \n nope Match' }); -testVim('/_2_pcre', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', true); - cm.openDialog = helpers.fakeOpenDialog('(word){2}'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 9); - helpers.doKeys('n'); - helpers.assertCursorAt(2, 1); -}, { value: 'word\n another wordword\n wordwordword\n' }); -testVim('/_2_nopcre', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', false); - cm.openDialog = helpers.fakeOpenDialog('\\(word\\)\\{2}'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 9); - helpers.doKeys('n'); - helpers.assertCursorAt(2, 1); -}, { value: 'word\n another wordword\n wordwordword\n' }); -testVim('/_nongreedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('aa'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('?_nongreedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('aa'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('/_greedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a+'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('?_greedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a+'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('/_greedy_0_or_more', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a*'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 5); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 0); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa\n aa'}); -testVim('?_greedy_0_or_more', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a*'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 0); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 5); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa\n aa'}); -testVim('? and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 6); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 11); - helpers.doKeys('N'); - helpers.assertCursorAt(1, 6); - - cm.setCursor(0, 0); - helpers.doKeys('2', '?'); - helpers.assertCursorAt(0, 11); -}, { value: 'match nope match \n nope Match' }); -testVim('*', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 22); - - cm.setCursor(0, 9); - helpers.doKeys('2', '*'); - helpers.assertCursorAt(1, 8); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_no_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 0); -}, { value: ' \n match \n' }); -testVim('*_symbol', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(1, 0); -}, { value: ' /}\n/} match \n' }); -testVim('#', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('#'); - helpers.assertCursorAt(1, 8); - - cm.setCursor(0, 9); - helpers.doKeys('2', '#'); - helpers.assertCursorAt(0, 22); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_seek', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 22); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('#', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('#'); - helpers.assertCursorAt(1, 8); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('g*', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('g', '*'); - helpers.assertCursorAt(0, 18); - cm.setCursor(0, 8); - helpers.doKeys('3', 'g', '*'); - helpers.assertCursorAt(1, 8); -}, { value: 'matches match alsoMatch\nmatchme matching' }); -testVim('g#', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('g', '#'); - helpers.assertCursorAt(0, 0); - cm.setCursor(0, 8); - helpers.doKeys('3', 'g', '#'); - helpers.assertCursorAt(1, 0); -}, { value: 'matches match alsoMatch\nmatchme matching' }); -testVim('macro_insert', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '0', 'i'); - cm.replaceRange('foo', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('q', '@', 'a'); - eq('foofoo', cm.getValue()); -}, { value: ''}); -testVim('macro_space', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', ''); - helpers.assertCursorAt(0, 2); - helpers.doKeys('q', 'a', '', '', 'q'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0, 6); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0, 8); -}, { value: 'one line of text.'}); -testVim('macro_t_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 't', 'e', 'q'); - helpers.assertCursorAt(0, 1); - helpers.doKeys('l', '@', 'a'); - helpers.assertCursorAt(0, 6); - helpers.doKeys('l', ';'); - helpers.assertCursorAt(0, 12); -}, { value: 'one line of text.'}); -testVim('macro_f_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'b', 'f', 'e', 'q'); - helpers.assertCursorAt(0, 2); - helpers.doKeys('@', 'b'); - helpers.assertCursorAt(0, 7); - helpers.doKeys(';'); - helpers.assertCursorAt(0, 13); -}, { value: 'one line of text.'}); -testVim('macro_slash_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'c'); - cm.openDialog = helpers.fakeOpenDialog('e'); - helpers.doKeys('/', 'q'); - helpers.assertCursorAt(0, 2); - helpers.doKeys('@', 'c'); - helpers.assertCursorAt(0, 7); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 13); -}, { value: 'one line of text.'}); -testVim('macro_multislash_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'd'); - cm.openDialog = helpers.fakeOpenDialog('e'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('t'); - helpers.doKeys('/', 'q'); - helpers.assertCursorAt(0, 12); - helpers.doKeys('@', 'd'); - helpers.assertCursorAt(0, 15); -}, { value: 'one line of text to rule them all.'}); -testVim('macro_parens', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'z', 'i'); - cm.replaceRange('(', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('e', 'a'); - cm.replaceRange(')', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('q'); - helpers.doKeys('w', '@', 'z'); - helpers.doKeys('w', '@', 'z'); - eq('(see) (spot) (run)', cm.getValue()); -}, { value: 'see spot run'}); -testVim('macro_overwrite', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'z', '0', 'i'); - cm.replaceRange('I ', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('q'); - helpers.doKeys('e'); - // Now replace the macro with something else. - helpers.doKeys('q', 'z', 'a'); - cm.replaceRange('.', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('q'); - helpers.doKeys('e', '@', 'z'); - helpers.doKeys('e', '@', 'z'); - eq('I see. spot. run.', cm.getValue()); -}, { value: 'see spot run'}); -testVim('macro_search_f', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'f', ' '); - helpers.assertCursorAt(0,3); - helpers.doKeys('q', '0'); - helpers.assertCursorAt(0,0); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0,3); -}, { value: 'The quick brown fox jumped over the lazy dog.'}); -testVim('macro_search_2f', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '2', 'f', ' '); - helpers.assertCursorAt(0,9); - helpers.doKeys('q', '0'); - helpers.assertCursorAt(0,0); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0,9); -}, { value: 'The quick brown fox jumped over the lazy dog.'}); -testVim('yank_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'b', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo/.test(text)); - is(/b\s+bar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('macro_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'i'); - cm.replaceRange('gangnam', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('q'); - helpers.doKeys('q', 'b', 'o'); - cm.replaceRange('style', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('q'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+i/.test(text)); - is(/b\s+o/.test(text)); - }); - helpers.doKeys(':'); -}, { value: ''}); -testVim('._register', function(cm,vim,helpers) { - cm.setCursor(0,0); - helpers.doKeys('i'); - cm.replaceRange('foo',cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/\.\s+foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim(':_register', function(cm,vim,helpers) { - helpers.doEx('bar'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/:\s+bar/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('.', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('2', 'd', 'w'); - helpers.doKeys('.'); - eq('5 6', cm.getValue()); -}, { value: '1 2 3 4 5 6'}); -testVim('._repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('2', 'd', 'w'); - helpers.doKeys('3', '.'); - eq('6', cm.getValue()); -}, { value: '1 2 3 4 5 6'}); -testVim('._insert', function(cm, vim, helpers) { - helpers.doKeys('i'); - cm.replaceRange('test', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('.'); - eq('testestt', cm.getValue()); - helpers.assertCursorAt(0, 6); -}, { value: ''}); -testVim('._insert_repeat', function(cm, vim, helpers) { - helpers.doKeys('i'); - cm.replaceRange('test', cm.getCursor()); - cm.setCursor(0, 4); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('2', '.'); - eq('testesttestt', cm.getValue()); - helpers.assertCursorAt(0, 10); -}, { value: ''}); -testVim('._repeat_insert', function(cm, vim, helpers) { - helpers.doKeys('3', 'i'); - cm.replaceRange('te', cm.getCursor()); - cm.setCursor(0, 2); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('.'); - eq('tetettetetee', cm.getValue()); - helpers.assertCursorAt(0, 10); -}, { value: ''}); -testVim('._insert_o', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - cm.setCursor(1, 1); - helpers.doInsertModeKeys('Esc'); - helpers.doKeys('.'); - eq('\nz\nz', cm.getValue()); - helpers.assertCursorAt(2, 0); -}, { value: ''}); -testVim('._insert_o_repeat', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - cm.setCursor(1, 0); - helpers.doKeys('2', '.'); - eq('\nz\nz\nz', cm.getValue()); - helpers.assertCursorAt(3, 0); -}, { value: ''}); -testVim('._insert_o_indent', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - cm.setCursor(1, 2); - helpers.doKeys('.'); - eq('{\n z\n z', cm.getValue()); - helpers.assertCursorAt(2, 2); -}, { value: '{'}); -testVim('._insert_cw', function(cm, vim, helpers) { - helpers.doKeys('c', 'w'); - cm.replaceRange('test', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - cm.setCursor(0, 3); - helpers.doKeys('2', 'l'); - helpers.doKeys('.'); - eq('test test word3', cm.getValue()); - helpers.assertCursorAt(0, 8); -}, { value: 'word1 word2 word3' }); -testVim('._insert_cw_repeat', function(cm, vim, helpers) { - // For some reason, repeat cw in desktop VIM will does not repeat insert mode - // changes. Will conform to that behavior. - helpers.doKeys('c', 'w'); - cm.replaceRange('test', cm.getCursor()); - helpers.doInsertModeKeys('Esc'); - cm.setCursor(0, 4); - helpers.doKeys('l'); - helpers.doKeys('2', '.'); - eq('test test', cm.getValue()); - helpers.assertCursorAt(0, 8); -}, { value: 'word1 word2 word3' }); -testVim('._delete', function(cm, vim, helpers) { - cm.setCursor(0, 5); - helpers.doKeys('i'); - helpers.doInsertModeKeys('Backspace', 'Esc'); - helpers.doKeys('.'); - eq('zace', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'zabcde'}); -testVim('._delete_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('i'); - helpers.doInsertModeKeys('Backspace', 'Esc'); - helpers.doKeys('2', '.'); - eq('zzce', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'zzabcde'}); -testVim('f;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(9, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('F;', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('F', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(2, cm.getCursor().ch); -}, { value: '01x3xx6x8x'}); -testVim('t;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(8, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('T;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(2, cm.getCursor().ch); -}, { value: '0xx3xx678x'}); -testVim('f,', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('f', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(2, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('F,', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('F', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(9, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('t,', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('t', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(3, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('T,', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('T', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(8, cm.getCursor().ch); -}, { value: '01x3xx67xx'}); -testVim('fd,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('d', ';'); - eq('56789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('d', ','); - eq('01239', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fd,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('d', ';'); - eq('01239', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('d', ','); - eq('56789', cm.getValue()); -}, { value: '0123456789'}); -testVim('td,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('d', ';'); - eq('456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('d', ','); - eq('012349', cm.getValue()); -}, { value: '0123456789'}); -testVim('Td,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('d', ';'); - eq('012349', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('d', ','); - eq('456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('fc,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('c', ';', 'Esc'); - eq('56789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('c', ','); - eq('01239', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fc,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('c', ';', 'Esc'); - eq('01239', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('c', ','); - eq('56789', cm.getValue()); -}, { value: '0123456789'}); -testVim('tc,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('c', ';', 'Esc'); - eq('456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('c', ','); - eq('012349', cm.getValue()); -}, { value: '0123456789'}); -testVim('Tc,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('c', ';', 'Esc'); - eq('012349', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('c', ','); - eq('456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('fy,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('y', ';', 'P'); - eq('012340123456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('y', ',', 'P'); - eq('012345678456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fy,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('y', ';', 'p'); - eq('012345678945678', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('y', ',', 'P'); - eq('012340123456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('ty,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('y', ';', 'P'); - eq('01230123456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('y', ',', 'p'); - eq('01234567895678', cm.getValue()); -}, { value: '0123456789'}); -testVim('Ty,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('y', ';', 'p'); - eq('01234567895678', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('y', ',', 'P'); - eq('01230123456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('HML', function(cm, vim, helpers) { - var lines = 35; - var textHeight = cm.defaultTextHeight(); - cm.setSize(600, lines*textHeight); - cm.setCursor(120, 0); - helpers.doKeys('H'); - helpers.assertCursorAt(86, 2); - helpers.doKeys('L'); - helpers.assertCursorAt(120, 4); - helpers.doKeys('M'); - helpers.assertCursorAt(103,4); -}, { value: (function(){ - var lines = new Array(100); - var upper = ' xx\n'; - var lower = ' xx\n'; - upper = lines.join(upper); - lower = lines.join(lower); - return upper + lower; -})()}); - -var zVals = ['zb','zz','zt','z-','z.','z'].map(function(e, idx){ - var lineNum = 250; - var lines = 35; - testVim(e, function(cm, vim, helpers) { - var k1 = e[0]; - var k2 = e.substring(1); - var textHeight = cm.defaultTextHeight(); - cm.setSize(600, lines*textHeight); - cm.setCursor(lineNum, 0); - helpers.doKeys(k1, k2); - zVals[idx] = cm.getScrollInfo().top; - }, { value: (function(){ - return new Array(500).join('\n'); - })()}); -}); -testVim('zb', function(cm, vim, helpers){ - eq(zVals[2], zVals[5]); -}); - -var moveTillCharacterSandbox = - 'The quick brown fox \n' - 'jumped over the lazy dog.' -testVim('moveTillCharacter', function(cm, vim, helpers){ - cm.setCursor(0, 0); - // Search for the 'q'. - cm.openDialog = helpers.fakeOpenDialog('q'); - helpers.doKeys('/'); - eq(4, cm.getCursor().ch); - // Jump to just before the first o in the list. - helpers.doKeys('t'); - helpers.doKeys('o'); - eq('The quick brown fox \n', cm.getValue()); - // Delete that one character. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('o'); - eq('The quick bown fox \n', cm.getValue()); - // Delete everything until the next 'o'. - helpers.doKeys('.'); - eq('The quick box \n', cm.getValue()); - // An unmatched character should have no effect. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('q'); - eq('The quick box \n', cm.getValue()); - // Matches should only be possible on single lines. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('z'); - eq('The quick box \n', cm.getValue()); - // After all that, the search for 'q' should still be active, so the 'N' command - // can run it again in reverse. Use that to delete everything back to the 'q'. - helpers.doKeys('d'); - helpers.doKeys('N'); - eq('The ox \n', cm.getValue()); - eq(4, cm.getCursor().ch); -}, { value: moveTillCharacterSandbox}); -testVim('searchForPipe', function(cm, vim, helpers){ - CodeMirror.Vim.setOption('pcre', false); - cm.setCursor(0, 0); - // Search for the '|'. - cm.openDialog = helpers.fakeOpenDialog('|'); - helpers.doKeys('/'); - eq(4, cm.getCursor().ch); -}, { value: 'this|that'}); - - -var scrollMotionSandbox = - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'; -testVim('scrollMotion', function(cm, vim, helpers){ - var prevCursor, prevScrollInfo; - cm.setCursor(0, 0); - // ctrl-y at the top of the file should have no effect. - helpers.doKeys(''); - eq(0, cm.getCursor().line); - prevScrollInfo = cm.getScrollInfo(); - helpers.doKeys(''); - eq(1, cm.getCursor().line); - eq(true, prevScrollInfo.top < cm.getScrollInfo().top); - // Jump to the end of the sandbox. - cm.setCursor(1000, 0); - prevCursor = cm.getCursor(); - // ctrl-e at the bottom of the file should have no effect. - helpers.doKeys(''); - eq(prevCursor.line, cm.getCursor().line); - prevScrollInfo = cm.getScrollInfo(); - helpers.doKeys(''); - eq(prevCursor.line - 1, cm.getCursor().line); - eq(true, prevScrollInfo.top > cm.getScrollInfo().top); -}, { value: scrollMotionSandbox}); - -var squareBracketMotionSandbox = ''+ - '({\n'+//0 - ' ({\n'+//11 - ' /*comment {\n'+//2 - ' */(\n'+//3 - '#else \n'+//4 - ' /* )\n'+//5 - '#if }\n'+//6 - ' )}*/\n'+//7 - ')}\n'+//8 - '{}\n'+//9 - '#else {{\n'+//10 - '{}\n'+//11 - '}\n'+//12 - '{\n'+//13 - '#endif\n'+//14 - '}\n'+//15 - '}\n'+//16 - '#else';//17 -testVim('[[, ]]', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(']', ']'); - helpers.assertCursorAt(9,0); - helpers.doKeys('2', ']', ']'); - helpers.assertCursorAt(13,0); - helpers.doKeys(']', ']'); - helpers.assertCursorAt(17,0); - helpers.doKeys('[', '['); - helpers.assertCursorAt(13,0); - helpers.doKeys('2', '[', '['); - helpers.assertCursorAt(9,0); - helpers.doKeys('[', '['); - helpers.assertCursorAt(0,0); -}, { value: squareBracketMotionSandbox}); -testVim('[], ][', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(']', '['); - helpers.assertCursorAt(12,0); - helpers.doKeys('2', ']', '['); - helpers.assertCursorAt(16,0); - helpers.doKeys(']', '['); - helpers.assertCursorAt(17,0); - helpers.doKeys('[', ']'); - helpers.assertCursorAt(16,0); - helpers.doKeys('2', '[', ']'); - helpers.assertCursorAt(12,0); - helpers.doKeys('[', ']'); - helpers.assertCursorAt(0,0); -}, { value: squareBracketMotionSandbox}); -testVim('[{, ]}', function(cm, vim, helpers) { - cm.setCursor(4, 10); - helpers.doKeys('[', '{'); - helpers.assertCursorAt(2,12); - helpers.doKeys('2', '[', '{'); - helpers.assertCursorAt(0,1); - cm.setCursor(4, 10); - helpers.doKeys(']', '}'); - helpers.assertCursorAt(6,11); - helpers.doKeys('2', ']', '}'); - helpers.assertCursorAt(8,1); - cm.setCursor(0,1); - helpers.doKeys(']', '}'); - helpers.assertCursorAt(8,1); - helpers.doKeys('[', '{'); - helpers.assertCursorAt(0,1); -}, { value: squareBracketMotionSandbox}); -testVim('[(, ])', function(cm, vim, helpers) { - cm.setCursor(4, 10); - helpers.doKeys('[', '('); - helpers.assertCursorAt(3,14); - helpers.doKeys('2', '[', '('); - helpers.assertCursorAt(0,0); - cm.setCursor(4, 10); - helpers.doKeys(']', ')'); - helpers.assertCursorAt(5,11); - helpers.doKeys('2', ']', ')'); - helpers.assertCursorAt(8,0); - helpers.doKeys('[', '('); - helpers.assertCursorAt(0,0); - helpers.doKeys(']', ')'); - helpers.assertCursorAt(8,0); -}, { value: squareBracketMotionSandbox}); -testVim('[*, ]*, [/, ]/', function(cm, vim, helpers) { - forEach(['*', '/'], function(key){ - cm.setCursor(7, 0); - helpers.doKeys('2', '[', key); - helpers.assertCursorAt(2,2); - helpers.doKeys('2', ']', key); - helpers.assertCursorAt(7,5); - }); -}, { value: squareBracketMotionSandbox}); -testVim('[#, ]#', function(cm, vim, helpers) { - cm.setCursor(10, 3); - helpers.doKeys('2', '[', '#'); - helpers.assertCursorAt(4,0); - helpers.doKeys('5', ']', '#'); - helpers.assertCursorAt(17,0); - cm.setCursor(10, 3); - helpers.doKeys(']', '#'); - helpers.assertCursorAt(14,0); -}, { value: squareBracketMotionSandbox}); -testVim('[m, ]m, [M, ]M', function(cm, vim, helpers) { - cm.setCursor(11, 0); - helpers.doKeys('[', 'm'); - helpers.assertCursorAt(10,7); - helpers.doKeys('4', '[', 'm'); - helpers.assertCursorAt(1,3); - helpers.doKeys('5', ']', 'm'); - helpers.assertCursorAt(11,0); - helpers.doKeys('[', 'M'); - helpers.assertCursorAt(9,1); - helpers.doKeys('3', ']', 'M'); - helpers.assertCursorAt(15,0); - helpers.doKeys('5', '[', 'M'); - helpers.assertCursorAt(7,3); -}, { value: squareBracketMotionSandbox}); - -// Ex mode tests -testVim('ex_go_to_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doEx('4'); - helpers.assertCursorAt(3, 0); -}, { value: 'a\nb\nc\nd\ne\n'}); -testVim('ex_write', function(cm, vim, helpers) { - var tmp = CodeMirror.commands.save; - var written; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - // Test that w, wr, wri ... write all trigger :write. - var command = 'write'; - for (var i = 1; i < command.length; i++) { - written = false; - actualCm = null; - helpers.doEx(command.substring(0, i)); - eq(written, true); - eq(actualCm, cm); - } - CodeMirror.commands.save = tmp; -}); -testVim('ex_sort', function(cm, vim, helpers) { - helpers.doEx('sort'); - eq('Z\na\nb\nc\nd', cm.getValue()); -}, { value: 'b\nZ\nd\nc\na'}); -testVim('ex_sort_reverse', function(cm, vim, helpers) { - helpers.doEx('sort!'); - eq('d\nc\nb\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_range', function(cm, vim, helpers) { - helpers.doEx('2,3sort'); - eq('b\nc\nd\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_oneline', function(cm, vim, helpers) { - helpers.doEx('2sort'); - // Expect no change. - eq('b\nd\nc\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_ignoreCase', function(cm, vim, helpers) { - helpers.doEx('sort i'); - eq('a\nb\nc\nd\nZ', cm.getValue()); -}, { value: 'b\nZ\nd\nc\na'}); -testVim('ex_sort_unique', function(cm, vim, helpers) { - helpers.doEx('sort u'); - eq('Z\na\nb\nc\nd', cm.getValue()); -}, { value: 'b\nZ\na\na\nd\na\nc\na'}); -testVim('ex_sort_decimal', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('d3\n s5\n6\n.9', cm.getValue()); -}, { value: '6\nd3\n s5\n.9'}); -testVim('ex_sort_decimal_negative', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('z-9\nd3\n s5\n6\n.9', cm.getValue()); -}, { value: '6\nd3\n s5\n.9\nz-9'}); -testVim('ex_sort_decimal_reverse', function(cm, vim, helpers) { - helpers.doEx('sort! d'); - eq('.9\n6\n s5\nd3', cm.getValue()); -}, { value: '6\nd3\n s5\n.9'}); -testVim('ex_sort_hex', function(cm, vim, helpers) { - helpers.doEx('sort x'); - eq(' s5\n6\n.9\n&0xB\nd3', cm.getValue()); -}, { value: '6\nd3\n s5\n&0xB\n.9'}); -testVim('ex_sort_octal', function(cm, vim, helpers) { - helpers.doEx('sort o'); - eq('.8\n.9\nd3\n s5\n6', cm.getValue()); -}, { value: '6\nd3\n s5\n.9\n.8'}); -testVim('ex_sort_decimal_mixed', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('y\nz\nc1\nb2\na3', cm.getValue()); -}, { value: 'a3\nz\nc1\ny\nb2'}); -testVim('ex_sort_decimal_mixed_reverse', function(cm, vim, helpers) { - helpers.doEx('sort! d'); - eq('a3\nb2\nc1\nz\ny', cm.getValue()); -}, { value: 'a3\nz\nc1\ny\nb2'}); - -// Basic substitute tests. -testVim('ex_substitute_same_line', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('s/one/two'); - eq('one one\n two two', cm.getValue()); -}, { value: 'one one\n one one'}); -testVim('ex_substitute_global', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('%s/one/two'); - eq('two two\n two two', cm.getValue()); -}, { value: 'one one\n one one'}); -testVim('ex_substitute_input_range', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('1,3s/\\d/0'); - eq('0\n0\n0\n4', cm.getValue()); -}, { value: '1\n2\n3\n4' }); -testVim('ex_substitute_visual_range', function(cm, vim, helpers) { - cm.setCursor(1, 0); - // Set last visual mode selection marks '< and '> at lines 2 and 4 - helpers.doKeys('V', '2', 'j', 'v'); - helpers.doEx('\'<,\'>s/\\d/0'); - eq('1\n0\n0\n0\n5', cm.getValue()); -}, { value: '1\n2\n3\n4\n5' }); -testVim('ex_substitute_empty_query', function(cm, vim, helpers) { - // If the query is empty, use last query. - cm.setCursor(1, 0); - cm.openDialog = helpers.fakeOpenDialog('1'); - helpers.doKeys('/'); - helpers.doEx('s//b'); - eq('abb ab2 ab3', cm.getValue()); -}, { value: 'a11 a12 a13' }); -testVim('ex_substitute_javascript', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', false); - cm.setCursor(1, 0); - // Throw all the things that javascript likes to treat as special values - // into the replace part. All should be literal (this is VIM). - helpers.doEx('s/\\(\\d+\\)/$$ $\' $` $& \\1/') - eq('a $$ $\' $` $& 0 b', cm.getValue()); -}, { value: 'a 0 b' }); -testVim('ex_substitute_empty_arguments', function(cm,vim,helpers) { - cm.setCursor(0, 0); - helpers.doEx('s/a/b'); - cm.setCursor(1, 0); - helpers.doEx('s'); - eq('b b\nb b', cm.getValue()); -}, {value: 'a a\na a'}); - -// More complex substitute tests that test both pcre and nopcre options. -function testSubstitute(name, options) { - testVim(name + '_pcre', function(cm, vim, helpers) { - cm.setCursor(1, 0); - CodeMirror.Vim.setOption('pcre', true); - helpers.doEx(options.expr); - eq(options.expectedValue, cm.getValue()); - }, options); - // If no noPcreExpr is defined, assume that it's the same as the expr. - var noPcreExpr = options.noPcreExpr ? options.noPcreExpr : options.expr; - testVim(name + '_nopcre', function(cm, vim, helpers) { - cm.setCursor(1, 0); - CodeMirror.Vim.setOption('pcre', false); - helpers.doEx(noPcreExpr); - eq(options.expectedValue, cm.getValue()); - }, options); -} -testSubstitute('ex_substitute_capture', { - value: 'a11 a12 a13', - expectedValue: 'a1111 a1212 a1313', - // $n is a backreference - expr: 's/(\\d+)/$1$1/', - // \n is a backreference. - noPcreExpr: 's/\\(\\d+\\)/\\1\\1/'}); -testSubstitute('ex_substitute_capture2', { - value: 'a 0 b', - expectedValue: 'a $00 b', - expr: 's/(\\d+)/$$$1$1/', - noPcreExpr: 's/\\(\\d+\\)/$\\1\\1/'}); -testSubstitute('ex_substitute_nocapture', { - value: 'a11 a12 a13', - expectedValue: 'a$1$1 a$1$1 a$1$1', - expr: 's/(\\d+)/$$1$$1', - noPcreExpr: 's/\\(\\d+\\)/$1$1/'}); -testSubstitute('ex_substitute_nocapture2', { - value: 'a 0 b', - expectedValue: 'a $10 b', - expr: 's/(\\d+)/$$1$1', - noPcreExpr: 's/\\(\\d+\\)/\\$1\\1/'}); -testSubstitute('ex_substitute_nocapture', { - value: 'a b c', - expectedValue: 'a $ c', - expr: 's/b/$$/', - noPcreExpr: 's/b/$/'}); -testSubstitute('ex_substitute_slash_regex', { - value: 'one/two \n three/four', - expectedValue: 'one|two \n three|four', - expr: '%s/\\//|'}); -testSubstitute('ex_substitute_pipe_regex', { - value: 'one|two \n three|four', - expectedValue: 'one,two \n three,four', - expr: '%s/\\|/,/', - noPcreExpr: '%s/|/,/'}); -testSubstitute('ex_substitute_or_regex', { - value: 'one|two \n three|four', - expectedValue: 'ana|twa \n thraa|faar', - expr: '%s/o|e|u/a', - noPcreExpr: '%s/o\\|e\\|u/a'}); -testSubstitute('ex_substitute_or_word_regex', { - value: 'one|two \n three|four', - expectedValue: 'five|five \n three|four', - expr: '%s/(one|two)/five/', - noPcreExpr: '%s/\\(one\\|two\\)/five'}); -testSubstitute('ex_substitute_backslashslash_regex', { - value: 'one\\two \n three\\four', - expectedValue: 'one,two \n three,four', - expr: '%s/\\\\/,'}); -testSubstitute('ex_substitute_slash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one/two \n three/four', - expr: '%s/,/\\/'}); -testSubstitute('ex_substitute_backslash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one\\two \n three\\four', - expr: '%s/,/\\\\/g'}); -testSubstitute('ex_substitute_multibackslash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one\\\\\\\\two \n three\\\\\\\\four', // 2*8 backslashes. - expr: '%s/,/\\\\\\\\\\\\\\\\/g'}); // 16 backslashes. -testSubstitute('ex_substitute_braces_word', { - value: 'ababab abb ab{2}', - expectedValue: 'ab abb ab{2}', - expr: '%s/(ab){2}//g', - noPcreExpr: '%s/\\(ab\\)\\{2\\}//g'}); -testSubstitute('ex_substitute_braces_range', { - value: 'a aa aaa aaaa', - expectedValue: 'a a', - expr: '%s/a{2,3}//g', - noPcreExpr: '%s/a\\{2,3\\}//g'}); -testSubstitute('ex_substitute_braces_literal', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab abb ', - expr: '%s/ab\\{2\\}//g', - noPcreExpr: '%s/ab{2}//g'}); -testSubstitute('ex_substitute_braces_char', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab ab{2}', - expr: '%s/ab{2}//g', - noPcreExpr: '%s/ab\\{2\\}//g'}); -testSubstitute('ex_substitute_braces_no_escape', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab ab{2}', - expr: '%s/ab{2}//g', - noPcreExpr: '%s/ab\\{2}//g'}); -testSubstitute('ex_substitute_count', { - value: '1\n2\n3\n4', - expectedValue: '1\n0\n0\n4', - expr: 's/\\d/0/i 2'}); -testSubstitute('ex_substitute_count_with_range', { - value: '1\n2\n3\n4', - expectedValue: '1\n2\n0\n0', - expr: '1,3s/\\d/0/ 3'}); -function testSubstituteConfirm(name, command, initialValue, expectedValue, keys, finalPos) { - testVim(name, function(cm, vim, helpers) { - var savedOpenDialog = cm.openDialog; - var savedKeyName = CodeMirror.keyName; - var onKeyDown; - var recordedCallback; - var closed = true; // Start out closed, set false on second openDialog. - function close() { - closed = true; - } - // First openDialog should save callback. - cm.openDialog = function(template, callback, options) { - recordedCallback = callback; - } - // Do first openDialog. - helpers.doKeys(':'); - // Second openDialog should save keyDown handler. - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - closed = false; - }; - // Return the command to Vim and trigger second openDialog. - recordedCallback(command); - // The event should really use keyCode, but here just mock it out and use - // key and replace keyName to just return key. - CodeMirror.keyName = function (e) { return e.key; } - keys = keys.toUpperCase(); - for (var i = 0; i < keys.length; i++) { - is(!closed); - onKeyDown({ key: keys.charAt(i) }, '', close); - } - try { - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(finalPos); - is(closed); - } catch(e) { - throw e - } finally { - // Restore overriden functions. - CodeMirror.keyName = savedKeyName; - cm.openDialog = savedOpenDialog; - } - }, { value: initialValue }); -}; -testSubstituteConfirm('ex_substitute_confirm_emptydoc', - '%s/x/b/c', '', '', '', makeCursor(0, 0)); -testSubstituteConfirm('ex_substitute_confirm_nomatch', - '%s/x/b/c', 'ba a\nbab', 'ba a\nbab', '', makeCursor(0, 0)); -testSubstituteConfirm('ex_substitute_confirm_accept', - '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'yyy', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_random_keys', - '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'ysdkywerty', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_some', - '%s/a/b/c', 'ba a\nbab', 'bb a\nbbb', 'yny', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_all', - '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'a', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_accept_then_all', - '%s/a/b/c', 'ba a\nbab', 'bb b\nbbb', 'ya', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_quit', - '%s/a/b/c', 'ba a\nbab', 'bb a\nbab', 'yq', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_last', - '%s/a/b/c', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_oneline', - '1s/a/b/c', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_range_accept', - '1,2s/a/b/c', 'aa\na \na\na', 'bb\nb \na\na', 'yyy', makeCursor(1, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_some', - '1,3s/a/b/c', 'aa\na \na\na', 'ba\nb \nb\na', 'ynyy', makeCursor(2, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_all', - '1,3s/a/b/c', 'aa\na \na\na', 'bb\nb \nb\na', 'a', makeCursor(2, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_last', - '1,3s/a/b/c', 'aa\na \na\na', 'bb\nb \na\na', 'yyl', makeCursor(1, 0)); -//:noh should clear highlighting of search-results but allow to resume search through n -testVim('ex_noh_clearSearchHighlight', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.doEx('noh'); - eq(vim.searchState_.getOverlay(),null,'match-highlighting wasn\'t cleared'); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 11,'can\'t resume search after clearing highlighting'); -}, { value: 'match nope match \n nope Match' }); -testVim('set_boolean', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', true, 'boolean'); - // Test default value is set. - is(CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set to non-boolean - CodeMirror.Vim.setOption('testoption', '5'); - fail(); - } catch (expected) {}; - // Test setOption - CodeMirror.Vim.setOption('testoption', false); - is(!CodeMirror.Vim.getOption('testoption')); -}); -testVim('ex_set_boolean', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', true, 'boolean'); - // Test default value is set. - is(CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set to non-boolean - helpers.doEx('set testoption=22'); - fail(); - } catch (expected) {}; - // Test setOption - helpers.doEx('set notestoption'); - is(!CodeMirror.Vim.getOption('testoption')); -}); -testVim('set_string', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', 'a', 'string'); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set non-string. - CodeMirror.Vim.setOption('testoption', true); - fail(); - } catch (expected) {}; - try { - // Test fail to set 'notestoption' - CodeMirror.Vim.setOption('notestoption', 'b'); - fail(); - } catch (expected) {}; - // Test setOption - CodeMirror.Vim.setOption('testoption', 'c'); - eq('c', CodeMirror.Vim.getOption('testoption')); -}); -testVim('ex_set_string', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', 'a', 'string'); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set 'notestoption' - helpers.doEx('set notestoption=b'); - fail(); - } catch (expected) {}; - // Test setOption - helpers.doEx('set testoption=c') - eq('c', CodeMirror.Vim.getOption('testoption')); -}); -// TODO: Reset key maps after each test. -testVim('ex_map_key2key', function(cm, vim, helpers) { - helpers.doEx('map a x'); - helpers.doKeys('a'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); -testVim('ex_unmap_key2key', function(cm, vim, helpers) { - helpers.doEx('unmap a'); - helpers.doKeys('a'); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'abc' }); -testVim('ex_unmap_key2key_does_not_remove_default', function(cm, vim, helpers) { - try { - helpers.doEx('unmap a'); - fail(); - } catch (expected) {} - helpers.doKeys('a'); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'abc' }); -testVim('ex_map_key2key_to_colon', function(cm, vim, helpers) { - helpers.doEx('map ; :'); - var dialogOpened = false; - cm.openDialog = function() { - dialogOpened = true; - } - helpers.doKeys(';'); - eq(dialogOpened, true); -}); -testVim('ex_map_ex2key:', function(cm, vim, helpers) { - helpers.doEx('map :del x'); - helpers.doEx('del'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); -testVim('ex_map_ex2ex', function(cm, vim, helpers) { - helpers.doEx('map :del :w'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - helpers.doEx('del'); - CodeMirror.commands.save = tmp; - eq(written, true); - eq(actualCm, cm); -}); -testVim('ex_map_key2ex', function(cm, vim, helpers) { - helpers.doEx('map a :w'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - helpers.doKeys('a'); - CodeMirror.commands.save = tmp; - eq(written, true); - eq(actualCm, cm); -}); -testVim('ex_map_key2key_visual_api', function(cm, vim, helpers) { - CodeMirror.Vim.map('b', ':w', 'visual'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - // Mapping should not work in normal mode. - helpers.doKeys('b'); - eq(written, false); - // Mapping should work in visual mode. - helpers.doKeys('v', 'b'); - eq(written, true); - eq(actualCm, cm); - - CodeMirror.commands.save = tmp; -}); - -// Testing registration of functions as ex-commands and mapping to -keys -testVim('ex_api_test', function(cm, vim, helpers) { - var res=false; - var val='from'; - CodeMirror.Vim.defineEx('extest','ext',function(cm,params){ - if(params.args)val=params.args[0]; - else res=true; - }); - helpers.doEx(':ext to'); - eq(val,'to','Defining ex-command failed'); - CodeMirror.Vim.map('',':ext'); - helpers.doKeys('',''); - is(res,'Mapping to key failed'); -}); -// For now, this test needs to be last because it messes up : for future tests. -testVim('ex_map_key2key_from_colon', function(cm, vim, helpers) { - helpers.doEx('map : x'); - helpers.doKeys(':'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); diff --git a/ajax/libs/codemirror/3.24.0/package/test/widget_test.js b/ajax/libs/codemirror/3.24.0/package/test/widget_test.js deleted file mode 100644 index 61b22d009..000000000 --- a/ajax/libs/codemirror/3.24.0/package/test/widget_test.js +++ /dev/null @@ -1,53 +0,0 @@ -(function() { - "use strict"; - - namespace = "widget_"; - - function makeLineWidget(cm, line, height, options) { - var widgetEl = document.createElement('div'); - widgetEl.style.height = height + 'px'; - widgetEl.textContent = 'dummy text'; - - return { - el : widgetEl, - widget : cm.addLineWidget(line, widgetEl, options || {}) - }; - } - - function testWidgetsAffectDocumentHeight(tagline, docLines, widgetLine, viewportLine) { - var initialHeight = 100; - var changedHeight = 150; - - testCM('lineWidgetDocHeight_' + tagline, function(cm) { - var startingDocHeight = cm.getScrollInfo().height; - - if (viewportLine != null) { - cm.scrollIntoView({ line : viewportLine, ch: 0 }); - } - - var widgetInfo = makeLineWidget(cm, widgetLine, initialHeight); - eq(startingDocHeight + initialHeight, cm.getScrollInfo().height, 'addLineWidget(): widget height should be added to document height.'); - - widgetInfo.el.style.height = changedHeight + 'px'; - widgetInfo.widget.changed(); - eq(startingDocHeight + changedHeight, cm.getScrollInfo().height, 'widget.changed(): widget height should be updated in document height.'); - - widgetInfo.widget.clear(); - eq(startingDocHeight, cm.getScrollInfo().height, 'widget.clear(): widget height should be removed from document height.'); - }, { - value : new Array(docLines + 1).join('blah\n') - }) - } - - testWidgetsAffectDocumentHeight('shortFile_WidgetAtTop', 50, 0); - testWidgetsAffectDocumentHeight('shortFile_WidgetAtBottom', 50, 49); - - testWidgetsAffectDocumentHeight('longFile_WidgetAtTop', 1000, 1); - testWidgetsAffectDocumentHeight('longFile_WidgetAtMiddle', 1000, 500); - testWidgetsAffectDocumentHeight('longFile_WidgetAtBottom', 1000, 1000); - - testWidgetsAffectDocumentHeight('longFile_WidgetAtTop_viewportBottom', 1000, 0, 999); - testWidgetsAffectDocumentHeight('longFile_WidgetAtMiddle_viewportBottom', 1000, 499, 999); - testWidgetsAffectDocumentHeight('longFile_WidgetAtBottom_viewportBottom', 1000, 999, 999); - -})(); diff --git a/ajax/libs/codemirror/3.24.0/package/theme/3024-day.css b/ajax/libs/codemirror/3.24.0/theme/3024-day.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/3024-day.css rename to ajax/libs/codemirror/3.24.0/theme/3024-day.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/3024-night.css b/ajax/libs/codemirror/3.24.0/theme/3024-night.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/3024-night.css rename to ajax/libs/codemirror/3.24.0/theme/3024-night.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/ambiance-mobile.css b/ajax/libs/codemirror/3.24.0/theme/ambiance-mobile.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/ambiance-mobile.css rename to ajax/libs/codemirror/3.24.0/theme/ambiance-mobile.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/ambiance.css b/ajax/libs/codemirror/3.24.0/theme/ambiance.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/ambiance.css rename to ajax/libs/codemirror/3.24.0/theme/ambiance.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/base16-dark.css b/ajax/libs/codemirror/3.24.0/theme/base16-dark.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/base16-dark.css rename to ajax/libs/codemirror/3.24.0/theme/base16-dark.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/base16-light.css b/ajax/libs/codemirror/3.24.0/theme/base16-light.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/base16-light.css rename to ajax/libs/codemirror/3.24.0/theme/base16-light.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/blackboard.css b/ajax/libs/codemirror/3.24.0/theme/blackboard.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/blackboard.css rename to ajax/libs/codemirror/3.24.0/theme/blackboard.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/cobalt.css b/ajax/libs/codemirror/3.24.0/theme/cobalt.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/cobalt.css rename to ajax/libs/codemirror/3.24.0/theme/cobalt.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/eclipse.css b/ajax/libs/codemirror/3.24.0/theme/eclipse.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/eclipse.css rename to ajax/libs/codemirror/3.24.0/theme/eclipse.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/elegant.css b/ajax/libs/codemirror/3.24.0/theme/elegant.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/elegant.css rename to ajax/libs/codemirror/3.24.0/theme/elegant.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/erlang-dark.css b/ajax/libs/codemirror/3.24.0/theme/erlang-dark.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/erlang-dark.css rename to ajax/libs/codemirror/3.24.0/theme/erlang-dark.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/lesser-dark.css b/ajax/libs/codemirror/3.24.0/theme/lesser-dark.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/lesser-dark.css rename to ajax/libs/codemirror/3.24.0/theme/lesser-dark.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/mbo.css b/ajax/libs/codemirror/3.24.0/theme/mbo.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/mbo.css rename to ajax/libs/codemirror/3.24.0/theme/mbo.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/mdn-like.css b/ajax/libs/codemirror/3.24.0/theme/mdn-like.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/mdn-like.css rename to ajax/libs/codemirror/3.24.0/theme/mdn-like.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/midnight.css b/ajax/libs/codemirror/3.24.0/theme/midnight.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/midnight.css rename to ajax/libs/codemirror/3.24.0/theme/midnight.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/monokai.css b/ajax/libs/codemirror/3.24.0/theme/monokai.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/monokai.css rename to ajax/libs/codemirror/3.24.0/theme/monokai.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/neat.css b/ajax/libs/codemirror/3.24.0/theme/neat.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/neat.css rename to ajax/libs/codemirror/3.24.0/theme/neat.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/night.css b/ajax/libs/codemirror/3.24.0/theme/night.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/night.css rename to ajax/libs/codemirror/3.24.0/theme/night.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/paraiso-dark.css b/ajax/libs/codemirror/3.24.0/theme/paraiso-dark.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/paraiso-dark.css rename to ajax/libs/codemirror/3.24.0/theme/paraiso-dark.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/paraiso-light.css b/ajax/libs/codemirror/3.24.0/theme/paraiso-light.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/paraiso-light.css rename to ajax/libs/codemirror/3.24.0/theme/paraiso-light.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/pastel-on-dark.css b/ajax/libs/codemirror/3.24.0/theme/pastel-on-dark.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/pastel-on-dark.css rename to ajax/libs/codemirror/3.24.0/theme/pastel-on-dark.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/rubyblue.css b/ajax/libs/codemirror/3.24.0/theme/rubyblue.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/rubyblue.css rename to ajax/libs/codemirror/3.24.0/theme/rubyblue.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/solarized.css b/ajax/libs/codemirror/3.24.0/theme/solarized.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/solarized.css rename to ajax/libs/codemirror/3.24.0/theme/solarized.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/the-matrix.css b/ajax/libs/codemirror/3.24.0/theme/the-matrix.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/the-matrix.css rename to ajax/libs/codemirror/3.24.0/theme/the-matrix.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/tomorrow-night-eighties.css b/ajax/libs/codemirror/3.24.0/theme/tomorrow-night-eighties.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/tomorrow-night-eighties.css rename to ajax/libs/codemirror/3.24.0/theme/tomorrow-night-eighties.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/twilight.css b/ajax/libs/codemirror/3.24.0/theme/twilight.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/twilight.css rename to ajax/libs/codemirror/3.24.0/theme/twilight.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/vibrant-ink.css b/ajax/libs/codemirror/3.24.0/theme/vibrant-ink.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/vibrant-ink.css rename to ajax/libs/codemirror/3.24.0/theme/vibrant-ink.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/xq-dark.css b/ajax/libs/codemirror/3.24.0/theme/xq-dark.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/xq-dark.css rename to ajax/libs/codemirror/3.24.0/theme/xq-dark.css diff --git a/ajax/libs/codemirror/3.24.0/package/theme/xq-light.css b/ajax/libs/codemirror/3.24.0/theme/xq-light.css similarity index 100% rename from ajax/libs/codemirror/3.24.0/package/theme/xq-light.css rename to ajax/libs/codemirror/3.24.0/theme/xq-light.css