ace-rails-ap 4.1.3 → 4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitmodules +1 -1
- data/Gemfile +2 -3
- data/ace-rails-ap.gemspec +0 -2
- data/lib/ace/rails/version.rb +1 -1
- data/update.sh +1 -1
- data/vendor/assets/javascripts/ace/ace.js +5192 -3414
- data/vendor/assets/javascripts/ace/ext-beautify.js +281 -288
- data/vendor/assets/javascripts/ace/ext-code_lens.js +238 -0
- data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +6 -3
- data/vendor/assets/javascripts/ace/ext-emmet.js +353 -246
- data/vendor/assets/javascripts/ace/ext-error_marker.js +6 -3
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +61 -38
- data/vendor/assets/javascripts/ace/ext-language_tools.js +532 -343
- data/vendor/assets/javascripts/ace/ext-linking.js +8 -5
- data/vendor/assets/javascripts/ace/ext-modelist.js +46 -12
- data/vendor/assets/javascripts/ace/ext-options.js +793 -0
- data/vendor/assets/javascripts/ace/ext-prompt.js +2783 -0
- data/vendor/assets/javascripts/ace/ext-rtl.js +122 -0
- data/vendor/assets/javascripts/ace/ext-searchbox.js +45 -40
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +520 -369
- data/vendor/assets/javascripts/ace/ext-spellcheck.js +6 -4
- data/vendor/assets/javascripts/ace/ext-split.js +7 -46
- data/vendor/assets/javascripts/ace/ext-static_highlight.js +90 -22
- data/vendor/assets/javascripts/ace/ext-statusbar.js +9 -6
- data/vendor/assets/javascripts/ace/ext-textarea.js +21 -18
- data/vendor/assets/javascripts/ace/ext-themelist.js +10 -6
- data/vendor/assets/javascripts/ace/ext-whitespace.js +13 -6
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +49 -61
- data/vendor/assets/javascripts/ace/keybinding-sublime.js +422 -0
- data/vendor/assets/javascripts/ace/keybinding-vim.js +620 -287
- data/vendor/assets/javascripts/ace/keybinding-vscode.js +262 -0
- data/vendor/assets/javascripts/ace/mode-abap.js +10 -3
- data/vendor/assets/javascripts/ace/mode-abc.js +14 -4
- data/vendor/assets/javascripts/ace/mode-actionscript.js +13 -5
- data/vendor/assets/javascripts/ace/mode-ada.js +54 -4
- data/vendor/assets/javascripts/ace/mode-alda.js +311 -0
- data/vendor/assets/javascripts/ace/mode-apache_conf.js +12 -5
- data/vendor/assets/javascripts/ace/mode-apex.js +457 -0
- data/vendor/assets/javascripts/ace/mode-applescript.js +11 -4
- data/vendor/assets/javascripts/ace/mode-aql.js +102 -0
- data/vendor/assets/javascripts/ace/mode-asciidoc.js +9 -2
- data/vendor/assets/javascripts/ace/mode-asl.js +422 -0
- data/vendor/assets/javascripts/ace/mode-assembly_x86.js +11 -4
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +17 -8
- data/vendor/assets/javascripts/ace/mode-batchfile.js +12 -5
- data/vendor/assets/javascripts/ace/mode-c9search.js +9 -3
- data/vendor/assets/javascripts/ace/mode-c_cpp.js +23 -7
- data/vendor/assets/javascripts/ace/mode-cirru.js +11 -4
- data/vendor/assets/javascripts/ace/mode-clojure.js +9 -1
- data/vendor/assets/javascripts/ace/mode-cobol.js +8 -1
- data/vendor/assets/javascripts/ace/mode-coffee.js +12 -4
- data/vendor/assets/javascripts/ace/mode-coldfusion.js +163 -134
- data/vendor/assets/javascripts/ace/mode-crystal.js +642 -0
- data/vendor/assets/javascripts/ace/mode-csharp.js +13 -6
- data/vendor/assets/javascripts/ace/mode-csound_document.js +4036 -0
- data/vendor/assets/javascripts/ace/mode-csound_orchestra.js +2966 -0
- data/vendor/assets/javascripts/ace/mode-csound_score.js +462 -0
- data/vendor/assets/javascripts/ace/mode-csp.js +59 -0
- data/vendor/assets/javascripts/ace/mode-css.js +48 -27
- data/vendor/assets/javascripts/ace/mode-curly.js +162 -133
- data/vendor/assets/javascripts/ace/mode-d.js +12 -5
- data/vendor/assets/javascripts/ace/mode-dart.js +46 -20
- data/vendor/assets/javascripts/ace/mode-diff.js +11 -3
- data/vendor/assets/javascripts/ace/mode-django.js +164 -134
- data/vendor/assets/javascripts/ace/mode-dockerfile.js +12 -4
- data/vendor/assets/javascripts/ace/mode-dot.js +11 -4
- data/vendor/assets/javascripts/ace/mode-drools.js +46 -5
- data/vendor/assets/javascripts/ace/mode-edifact.js +166 -0
- data/vendor/assets/javascripts/ace/mode-eiffel.js +8 -1
- data/vendor/assets/javascripts/ace/mode-ejs.js +832 -298
- data/vendor/assets/javascripts/ace/mode-elixir.js +11 -4
- data/vendor/assets/javascripts/ace/mode-elm.js +10 -3
- data/vendor/assets/javascripts/ace/mode-erlang.js +13 -5
- data/vendor/assets/javascripts/ace/mode-forth.js +12 -5
- data/vendor/assets/javascripts/ace/mode-fortran.js +10 -3
- data/vendor/assets/javascripts/ace/mode-fsharp.js +316 -0
- data/vendor/assets/javascripts/ace/{mode-mipsassembler.js → mode-fsl.js} +91 -28
- data/vendor/assets/javascripts/ace/mode-ftl.js +23 -12
- data/vendor/assets/javascripts/ace/mode-gcode.js +8 -1
- data/vendor/assets/javascripts/ace/mode-gherkin.js +9 -4
- data/vendor/assets/javascripts/ace/mode-gitignore.js +8 -1
- data/vendor/assets/javascripts/ace/mode-glsl.js +24 -8
- data/vendor/assets/javascripts/ace/mode-gobstones.js +267 -99
- data/vendor/assets/javascripts/ace/mode-golang.js +11 -4
- data/vendor/assets/javascripts/ace/mode-graphqlschema.js +11 -3
- data/vendor/assets/javascripts/ace/mode-groovy.js +14 -5
- data/vendor/assets/javascripts/ace/mode-haml.js +442 -116
- data/vendor/assets/javascripts/ace/mode-handlebars.js +162 -133
- data/vendor/assets/javascripts/ace/mode-haskell.js +14 -6
- data/vendor/assets/javascripts/ace/mode-haskell_cabal.js +8 -1
- data/vendor/assets/javascripts/ace/mode-haxe.js +11 -4
- data/vendor/assets/javascripts/ace/mode-hjson.js +13 -6
- data/vendor/assets/javascripts/ace/mode-html.js +162 -133
- data/vendor/assets/javascripts/ace/mode-html_elixir.js +165 -136
- data/vendor/assets/javascripts/ace/mode-html_ruby.js +832 -298
- data/vendor/assets/javascripts/ace/mode-ini.js +8 -1
- data/vendor/assets/javascripts/ace/mode-io.js +14 -12
- data/vendor/assets/javascripts/ace/mode-jack.js +10 -3
- data/vendor/assets/javascripts/ace/mode-jade.js +272 -376
- data/vendor/assets/javascripts/ace/mode-java.js +110 -7
- data/vendor/assets/javascripts/ace/mode-javascript.js +14 -5
- data/vendor/assets/javascripts/ace/mode-json.js +13 -3
- data/vendor/assets/javascripts/ace/mode-json5.js +360 -0
- data/vendor/assets/javascripts/ace/mode-jsoniq.js +25 -12
- data/vendor/assets/javascripts/ace/mode-jsp.js +60 -15
- data/vendor/assets/javascripts/ace/mode-jssm.js +325 -0
- data/vendor/assets/javascripts/ace/mode-jsx.js +11 -4
- data/vendor/assets/javascripts/ace/mode-julia.js +12 -5
- data/vendor/assets/javascripts/ace/mode-kotlin.js +18 -7
- data/vendor/assets/javascripts/ace/mode-latex.js +87 -15
- data/vendor/assets/javascripts/ace/mode-less.js +47 -27
- data/vendor/assets/javascripts/ace/mode-liquid.js +2030 -472
- data/vendor/assets/javascripts/ace/mode-lisp.js +9 -2
- data/vendor/assets/javascripts/ace/mode-livescript.js +10 -2
- data/vendor/assets/javascripts/ace/mode-logiql.js +10 -3
- data/vendor/assets/javascripts/ace/mode-logtalk.js +352 -0
- data/vendor/assets/javascripts/ace/mode-lsl.js +11 -3
- data/vendor/assets/javascripts/ace/mode-lua.js +40 -12
- data/vendor/assets/javascripts/ace/mode-luapage.js +194 -144
- data/vendor/assets/javascripts/ace/mode-lucene.js +106 -22
- data/vendor/assets/javascripts/ace/mode-makefile.js +11 -3
- data/vendor/assets/javascripts/ace/mode-markdown.js +530 -201
- data/vendor/assets/javascripts/ace/mode-mask.js +101 -84
- data/vendor/assets/javascripts/ace/mode-matlab.js +8 -1
- data/vendor/assets/javascripts/ace/mode-maze.js +11 -3
- data/vendor/assets/javascripts/ace/mode-mediawiki.js +592 -0
- data/vendor/assets/javascripts/ace/mode-mel.js +11 -4
- data/vendor/assets/javascripts/ace/mode-mixal.js +122 -0
- data/vendor/assets/javascripts/ace/mode-mushcode.js +9 -2
- data/vendor/assets/javascripts/ace/mode-mysql.js +11 -4
- data/vendor/assets/javascripts/ace/mode-nginx.js +298 -0
- data/vendor/assets/javascripts/ace/mode-nim.js +363 -0
- data/vendor/assets/javascripts/ace/mode-nix.js +23 -7
- data/vendor/assets/javascripts/ace/mode-nsis.js +15 -8
- data/vendor/assets/javascripts/ace/mode-nunjucks.js +2698 -0
- data/vendor/assets/javascripts/ace/mode-objectivec.js +23 -8
- data/vendor/assets/javascripts/ace/mode-ocaml.js +8 -1
- data/vendor/assets/javascripts/ace/mode-pascal.js +92 -67
- data/vendor/assets/javascripts/ace/mode-perl.js +11 -3
- data/vendor/assets/javascripts/ace/mode-perl6.js +593 -0
- data/vendor/assets/javascripts/ace/mode-pgsql.js +314 -71
- data/vendor/assets/javascripts/ace/mode-php.js +1042 -995
- data/vendor/assets/javascripts/ace/mode-php_laravel_blade.js +13104 -0
- data/vendor/assets/javascripts/ace/mode-pig.js +13 -6
- data/vendor/assets/javascripts/ace/mode-plain_text.js +8 -1
- data/vendor/assets/javascripts/ace/mode-powershell.js +10 -3
- data/vendor/assets/javascripts/ace/mode-praat.js +17 -7
- data/vendor/assets/javascripts/ace/mode-prisma.js +489 -0
- data/vendor/assets/javascripts/ace/mode-prolog.js +12 -5
- data/vendor/assets/javascripts/ace/mode-properties.js +8 -1
- data/vendor/assets/javascripts/ace/mode-protobuf.js +23 -7
- data/vendor/assets/javascripts/ace/mode-puppet.js +368 -0
- data/vendor/assets/javascripts/ace/mode-python.js +306 -63
- data/vendor/assets/javascripts/ace/mode-qml.js +381 -0
- data/vendor/assets/javascripts/ace/mode-r.js +15 -4
- data/vendor/assets/javascripts/ace/mode-razor.js +166 -136
- data/vendor/assets/javascripts/ace/mode-rdoc.js +41 -3
- data/vendor/assets/javascripts/ace/mode-red.js +450 -0
- data/vendor/assets/javascripts/ace/mode-redshift.js +360 -0
- data/vendor/assets/javascripts/ace/mode-rhtml.js +162 -133
- data/vendor/assets/javascripts/ace/mode-rst.js +9 -1
- data/vendor/assets/javascripts/ace/mode-ruby.js +678 -166
- data/vendor/assets/javascripts/ace/mode-rust.js +16 -7
- data/vendor/assets/javascripts/ace/mode-sass.js +211 -116
- data/vendor/assets/javascripts/ace/mode-scad.js +11 -4
- data/vendor/assets/javascripts/ace/mode-scala.js +14 -5
- data/vendor/assets/javascripts/ace/mode-scheme.js +9 -2
- data/vendor/assets/javascripts/ace/mode-scss.js +412 -125
- data/vendor/assets/javascripts/ace/mode-sh.js +12 -4
- data/vendor/assets/javascripts/ace/mode-sjs.js +16 -7
- data/vendor/assets/javascripts/ace/mode-slim.js +5240 -0
- data/vendor/assets/javascripts/ace/mode-smarty.js +164 -135
- data/vendor/assets/javascripts/ace/mode-snippets.js +24 -16
- data/vendor/assets/javascripts/ace/mode-soy_template.js +164 -135
- data/vendor/assets/javascripts/ace/mode-space.js +8 -1
- data/vendor/assets/javascripts/ace/mode-sparql.js +13 -6
- data/vendor/assets/javascripts/ace/mode-sql.js +10 -2
- data/vendor/assets/javascripts/ace/mode-sqlserver.js +13 -5
- data/vendor/assets/javascripts/ace/mode-stylus.js +20 -10
- data/vendor/assets/javascripts/ace/mode-svg.js +27 -13
- data/vendor/assets/javascripts/ace/mode-swift.js +21 -8
- data/vendor/assets/javascripts/ace/mode-tcl.js +14 -3
- data/vendor/assets/javascripts/ace/mode-terraform.js +400 -0
- data/vendor/assets/javascripts/ace/mode-tex.js +9 -1
- data/vendor/assets/javascripts/ace/mode-text.js +8 -0
- data/vendor/assets/javascripts/ace/mode-textile.js +9 -1
- data/vendor/assets/javascripts/ace/mode-toml.js +9 -2
- data/vendor/assets/javascripts/ace/mode-tsx.js +28 -31
- data/vendor/assets/javascripts/ace/mode-turtle.js +13 -6
- data/vendor/assets/javascripts/ace/mode-twig.js +163 -134
- data/vendor/assets/javascripts/ace/mode-typescript.js +28 -31
- data/vendor/assets/javascripts/ace/mode-vala.js +14 -6
- data/vendor/assets/javascripts/ace/mode-vbscript.js +453 -17
- data/vendor/assets/javascripts/ace/mode-velocity.js +163 -133
- data/vendor/assets/javascripts/ace/mode-verilog.js +19 -5
- data/vendor/assets/javascripts/ace/mode-vhdl.js +13 -7
- data/vendor/assets/javascripts/ace/mode-visualforce.js +2640 -0
- data/vendor/assets/javascripts/ace/mode-wollok.js +17 -8
- data/vendor/assets/javascripts/ace/mode-xml.js +21 -9
- data/vendor/assets/javascripts/ace/mode-xquery.js +25 -12
- data/vendor/assets/javascripts/ace/mode-yaml.js +59 -18
- data/vendor/assets/javascripts/ace/mode-zeek.js +539 -0
- data/vendor/assets/javascripts/ace/snippets/abap.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/abc.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/actionscript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ada.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/alda.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/apache_conf.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/apex.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/applescript.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/aql.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/asciidoc.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/asl.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/autohotkey.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/batchfile.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/c9search.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/c_cpp.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/cirru.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/clojure.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/cobol.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/coffee.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/coldfusion.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/crystal.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/csharp.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/csound_document.js +24 -0
- data/vendor/assets/javascripts/ace/snippets/csound_orchestra.js +61 -0
- data/vendor/assets/javascripts/ace/snippets/csound_score.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/csp.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/css.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/curly.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/d.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/dart.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/diff.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/django.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/dockerfile.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/dot.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/drools.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/edifact.js +254 -0
- data/vendor/assets/javascripts/ace/snippets/eiffel.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/ejs.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/elixir.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/elm.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/erlang.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/forth.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/fortran.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/fsharp.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/fsl.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/ftl.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/gcode.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/gherkin.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/gitignore.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/glsl.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/gobstones.js +1701 -24
- data/vendor/assets/javascripts/ace/snippets/golang.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/graphqlschema.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/groovy.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/haml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/handlebars.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/haskell.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/haxe.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/hjson.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/html.js +36 -2
- data/vendor/assets/javascripts/ace/snippets/html_elixir.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/html_ruby.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/ini.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/io.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jack.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/jade.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/java.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/javascript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/json.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/json5.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/jsoniq.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jsp.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jssm.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/jsx.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/julia.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/kotlin.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/latex.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/less.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/liquid.js +890 -2
- data/vendor/assets/javascripts/ace/snippets/lisp.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/livescript.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/logiql.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/logtalk.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/lsl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/lua.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/luapage.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/lucene.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/makefile.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/markdown.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/mask.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/matlab.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/maze.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/mediawiki.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/mel.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/mixal.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/mushcode.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/mysql.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/nginx.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/nim.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/nix.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/nsis.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/nunjucks.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/objectivec.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/ocaml.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/pascal.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/perl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/perl6.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/pgsql.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/php.js +49 -36
- data/vendor/assets/javascripts/ace/snippets/php_laravel_blade.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/pig.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/plain_text.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/powershell.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/praat.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/prisma.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/prolog.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/properties.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/protobuf.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/puppet.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/python.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/qml.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/r.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/razor.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/rdoc.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/red.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/redshift.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/rhtml.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/rst.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ruby.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/rust.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/sass.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/scad.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/scala.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/scheme.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/scss.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/sh.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sjs.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/slim.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/smarty.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/snippets.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/soy_template.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/space.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/sparql.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/sql.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sqlserver.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/stylus.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/svg.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/swift.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/tcl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/terraform.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/tex.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/text.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/textile.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/toml.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/tsx.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/turtle.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/twig.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/typescript.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/vala.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/vbscript.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/velocity.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/verilog.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/vhdl.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/visualforce.js +9 -0
- data/vendor/assets/javascripts/ace/snippets/wollok.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/xml.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/xquery.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/yaml.js +8 -6
- data/vendor/assets/javascripts/ace/snippets/zeek.js +9 -0
- data/vendor/assets/javascripts/ace/theme-ambiance.js +11 -8
- data/vendor/assets/javascripts/ace/theme-chaos.js +9 -2
- data/vendor/assets/javascripts/ace/theme-chrome.js +8 -1
- data/vendor/assets/javascripts/ace/theme-clouds.js +8 -1
- data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +8 -1
- data/vendor/assets/javascripts/ace/theme-cobalt.js +8 -1
- data/vendor/assets/javascripts/ace/theme-crimson_editor.js +8 -1
- data/vendor/assets/javascripts/ace/theme-dawn.js +8 -1
- data/vendor/assets/javascripts/ace/theme-dracula.js +135 -0
- data/vendor/assets/javascripts/ace/theme-dreamweaver.js +8 -1
- data/vendor/assets/javascripts/ace/theme-eclipse.js +8 -1
- data/vendor/assets/javascripts/ace/theme-github.js +8 -1
- data/vendor/assets/javascripts/ace/theme-gob.js +8 -1
- data/vendor/assets/javascripts/ace/theme-gruvbox.js +8 -1
- data/vendor/assets/javascripts/ace/theme-idle_fingers.js +8 -1
- data/vendor/assets/javascripts/ace/theme-iplastic.js +8 -1
- data/vendor/assets/javascripts/ace/theme-katzenmilch.js +8 -1
- data/vendor/assets/javascripts/ace/theme-kr_theme.js +8 -1
- data/vendor/assets/javascripts/ace/theme-kuroir.js +8 -1
- data/vendor/assets/javascripts/ace/theme-merbivore.js +8 -1
- data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +8 -1
- data/vendor/assets/javascripts/ace/theme-mono_industrial.js +8 -1
- data/vendor/assets/javascripts/ace/theme-monokai.js +8 -1
- data/vendor/assets/javascripts/ace/theme-nord_dark.js +102 -0
- data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +8 -1
- data/vendor/assets/javascripts/ace/theme-solarized_dark.js +8 -1
- data/vendor/assets/javascripts/ace/theme-solarized_light.js +9 -2
- data/vendor/assets/javascripts/ace/theme-sqlserver.js +8 -1
- data/vendor/assets/javascripts/ace/theme-terminal.js +8 -1
- data/vendor/assets/javascripts/ace/theme-textmate.js +9 -1
- data/vendor/assets/javascripts/ace/theme-tomorrow.js +8 -1
- data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +8 -1
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +8 -1
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +8 -1
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +8 -1
- data/vendor/assets/javascripts/ace/theme-twilight.js +8 -1
- data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +8 -1
- data/vendor/assets/javascripts/ace/theme-xcode.js +8 -1
- data/vendor/assets/javascripts/ace/worker-base.js +1421 -0
- data/vendor/assets/javascripts/ace/worker-coffee.js +55 -742
- data/vendor/assets/javascripts/ace/worker-css.js +66 -739
- data/vendor/assets/javascripts/ace/worker-html.js +55 -738
- data/vendor/assets/javascripts/ace/worker-javascript.js +6693 -4209
- data/vendor/assets/javascripts/ace/worker-json.js +56 -737
- data/vendor/assets/javascripts/ace/worker-lua.js +56 -738
- data/vendor/assets/javascripts/ace/worker-php.js +897 -1512
- data/vendor/assets/javascripts/ace/worker-xml.js +129 -808
- data/vendor/assets/javascripts/ace/worker-xquery.js +54 -737
- metadata +74 -19
- data/vendor/assets/javascripts/ace/ext-chromevox.js +0 -540
- data/vendor/assets/javascripts/ace/ext-old_ie.js +0 -502
- data/vendor/assets/javascripts/ace/mode-bash.js +0 -247
- data/vendor/assets/javascripts/ace/mode-bro.js +0 -327
- data/vendor/assets/javascripts/ace/mode-lean.js +0 -281
- data/vendor/assets/javascripts/ace/mode-live_script.js +0 -481
- data/vendor/assets/javascripts/ace/mode-mips_assembler.js +0 -235
- data/vendor/assets/javascripts/ace/mode-swig.js +0 -1099
- data/vendor/assets/javascripts/ace/snippets/bro.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/lean.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/live_script.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/swig.js +0 -7
@@ -1,334 +1,327 @@
|
|
1
|
-
define("ace/ext/beautify
|
1
|
+
define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
|
2
2
|
"use strict";
|
3
|
-
var TokenIterator = require("
|
4
|
-
exports.newLines = [{
|
5
|
-
type: 'support.php_tag',
|
6
|
-
value: '<?php'
|
7
|
-
}, {
|
8
|
-
type: 'support.php_tag',
|
9
|
-
value: '<?'
|
10
|
-
}, {
|
11
|
-
type: 'support.php_tag',
|
12
|
-
value: '?>'
|
13
|
-
}, {
|
14
|
-
type: 'paren.lparen',
|
15
|
-
value: '{',
|
16
|
-
indent: true
|
17
|
-
}, {
|
18
|
-
type: 'paren.rparen',
|
19
|
-
breakBefore: true,
|
20
|
-
value: '}',
|
21
|
-
indent: false
|
22
|
-
}, {
|
23
|
-
type: 'paren.rparen',
|
24
|
-
breakBefore: true,
|
25
|
-
value: '})',
|
26
|
-
indent: false,
|
27
|
-
dontBreak: true
|
28
|
-
}, {
|
29
|
-
type: 'comment'
|
30
|
-
}, {
|
31
|
-
type: 'text',
|
32
|
-
value: ';'
|
33
|
-
}, {
|
34
|
-
type: 'text',
|
35
|
-
value: ':',
|
36
|
-
context: 'php'
|
37
|
-
}, {
|
38
|
-
type: 'keyword',
|
39
|
-
value: 'case',
|
40
|
-
indent: true,
|
41
|
-
dontBreak: true
|
42
|
-
}, {
|
43
|
-
type: 'keyword',
|
44
|
-
value: 'default',
|
45
|
-
indent: true,
|
46
|
-
dontBreak: true
|
47
|
-
}, {
|
48
|
-
type: 'keyword',
|
49
|
-
value: 'break',
|
50
|
-
indent: false,
|
51
|
-
dontBreak: true
|
52
|
-
}, {
|
53
|
-
type: 'punctuation.doctype.end',
|
54
|
-
value: '>'
|
55
|
-
}, {
|
56
|
-
type: 'meta.tag.punctuation.end',
|
57
|
-
value: '>'
|
58
|
-
}, {
|
59
|
-
type: 'meta.tag.punctuation.begin',
|
60
|
-
value: '<',
|
61
|
-
blockTag: true,
|
62
|
-
indent: true,
|
63
|
-
dontBreak: true
|
64
|
-
}, {
|
65
|
-
type: 'meta.tag.punctuation.begin',
|
66
|
-
value: '</',
|
67
|
-
indent: false,
|
68
|
-
breakBefore: true,
|
69
|
-
dontBreak: true
|
70
|
-
}, {
|
71
|
-
type: 'punctuation.operator',
|
72
|
-
value: ';'
|
73
|
-
}];
|
3
|
+
var TokenIterator = require("../token_iterator").TokenIterator;
|
74
4
|
|
75
|
-
|
76
|
-
type
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
prepend: true
|
81
|
-
}, {
|
82
|
-
type: 'storage.type',
|
83
|
-
value: 'var',
|
84
|
-
append: true
|
85
|
-
}, {
|
86
|
-
type: 'storage.type',
|
87
|
-
value: 'function',
|
88
|
-
append: true
|
89
|
-
}, {
|
90
|
-
type: 'keyword.operator',
|
91
|
-
value: '='
|
92
|
-
}, {
|
93
|
-
type: 'keyword',
|
94
|
-
value: 'as',
|
95
|
-
prepend: true,
|
96
|
-
append: true
|
97
|
-
}, {
|
98
|
-
type: 'keyword',
|
99
|
-
value: 'function',
|
100
|
-
append: true
|
101
|
-
}, {
|
102
|
-
type: 'support.function',
|
103
|
-
next: /[^\(]/,
|
104
|
-
append: true
|
105
|
-
}, {
|
106
|
-
type: 'keyword',
|
107
|
-
value: 'or',
|
108
|
-
append: true,
|
109
|
-
prepend: true
|
110
|
-
}, {
|
111
|
-
type: 'keyword',
|
112
|
-
value: 'and',
|
113
|
-
append: true,
|
114
|
-
prepend: true
|
115
|
-
}, {
|
116
|
-
type: 'keyword',
|
117
|
-
value: 'case',
|
118
|
-
append: true
|
119
|
-
}, {
|
120
|
-
type: 'keyword.operator',
|
121
|
-
value: '||',
|
122
|
-
append: true,
|
123
|
-
prepend: true
|
124
|
-
}, {
|
125
|
-
type: 'keyword.operator',
|
126
|
-
value: '&&',
|
127
|
-
append: true,
|
128
|
-
prepend: true
|
129
|
-
}];
|
130
|
-
exports.singleTags = ['!doctype','area','base','br','hr','input','img','link','meta'];
|
5
|
+
function is(token, type) {
|
6
|
+
return token.type.lastIndexOf(type + ".xml") > -1;
|
7
|
+
}
|
8
|
+
exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
|
9
|
+
exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];
|
131
10
|
|
132
|
-
exports.
|
11
|
+
exports.beautify = function(session) {
|
12
|
+
var iterator = new TokenIterator(session, 0, 0);
|
133
13
|
var token = iterator.getCurrentToken();
|
134
|
-
|
135
|
-
var
|
136
|
-
var
|
137
|
-
var
|
14
|
+
var tabString = session.getTabString();
|
15
|
+
var singletonTags = exports.singletonTags;
|
16
|
+
var blockTags = exports.blockTags;
|
17
|
+
var nextToken;
|
18
|
+
var breakBefore = false;
|
19
|
+
var spaceBefore = false;
|
20
|
+
var spaceAfter = false;
|
21
|
+
var code = "";
|
22
|
+
var value = "";
|
23
|
+
var tagName = "";
|
24
|
+
var depth = 0;
|
25
|
+
var lastDepth = 0;
|
26
|
+
var lastIndent = 0;
|
27
|
+
var indent = 0;
|
28
|
+
var unindent = 0;
|
29
|
+
var roundDepth = 0;
|
30
|
+
var curlyDepth = 0;
|
31
|
+
var row;
|
32
|
+
var curRow = 0;
|
33
|
+
var rowsToAdd = 0;
|
34
|
+
var rowTokens = [];
|
35
|
+
var abort = false;
|
36
|
+
var i;
|
37
|
+
var indentNextLine = false;
|
38
|
+
var inTag = false;
|
39
|
+
var inCSS = false;
|
40
|
+
var inBlock = false;
|
41
|
+
var levels = {0: 0};
|
42
|
+
var parents = [];
|
138
43
|
|
139
|
-
var
|
44
|
+
var trimNext = function() {
|
45
|
+
if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
|
46
|
+
nextToken.value = nextToken.value.replace(/^\s*/, "");
|
47
|
+
};
|
140
48
|
|
141
|
-
var
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
var
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
var value = '';
|
150
|
-
|
151
|
-
while (token!==null) {
|
152
|
-
console.log(token);
|
153
|
-
|
154
|
-
if( !token ){
|
155
|
-
token = iterator.stepForward();
|
156
|
-
continue;
|
157
|
-
}
|
158
|
-
if( token.type == 'support.php_tag' && token.value != '?>' ){
|
159
|
-
context = 'php';
|
160
|
-
}
|
161
|
-
else if( token.type == 'support.php_tag' && token.value == '?>' ){
|
162
|
-
context = 'html';
|
163
|
-
}
|
164
|
-
else if( token.type == 'meta.tag.name.style' && context != 'css' ){
|
165
|
-
context = 'css';
|
166
|
-
}
|
167
|
-
else if( token.type == 'meta.tag.name.style' && context == 'css' ){
|
168
|
-
context = 'html';
|
169
|
-
}
|
170
|
-
else if( token.type == 'meta.tag.name.script' && context != 'js' ){
|
171
|
-
context = 'js';
|
172
|
-
}
|
173
|
-
else if( token.type == 'meta.tag.name.script' && context == 'js' ){
|
174
|
-
context = 'html';
|
175
|
-
}
|
49
|
+
var trimLine = function() {
|
50
|
+
code = code.replace(/ +$/, "");
|
51
|
+
};
|
52
|
+
|
53
|
+
var trimCode = function() {
|
54
|
+
code = code.trimRight();
|
55
|
+
breakBefore = false;
|
56
|
+
};
|
176
57
|
|
58
|
+
while (token !== null) {
|
59
|
+
curRow = iterator.getCurrentTokenRow();
|
60
|
+
rowTokens = iterator.$rowTokens;
|
177
61
|
nextToken = iterator.stepForward();
|
178
|
-
if (nextToken && nextToken.type.indexOf('meta.tag.name') == 0) {
|
179
|
-
nextTag = nextToken.value;
|
180
|
-
}
|
181
|
-
if ( lastToken.type == 'support.php_tag' && lastToken.value == '<?=') {
|
182
|
-
dontBreak = true;
|
183
|
-
}
|
184
|
-
if (token.type == 'meta.tag.name') {
|
185
|
-
token.value = token.value.toLowerCase();
|
186
|
-
}
|
187
|
-
if (token.type == 'text') {
|
188
|
-
token.value = token.value.trim();
|
189
|
-
}
|
190
|
-
if (!token.value) {
|
191
|
-
token = nextToken;
|
192
|
-
continue;
|
193
|
-
}
|
194
|
-
value = token.value;
|
195
|
-
for (var i in spaces) {
|
196
|
-
if (
|
197
|
-
token.type == spaces[i].type &&
|
198
|
-
(!spaces[i].value || token.value == spaces[i].value) &&
|
199
|
-
(
|
200
|
-
nextToken &&
|
201
|
-
(!spaces[i].next || spaces[i].next.test(nextToken.value))
|
202
|
-
)
|
203
|
-
) {
|
204
|
-
if (spaces[i].prepend) {
|
205
|
-
value = ' ' + token.value;
|
206
|
-
}
|
207
62
|
|
208
|
-
|
209
|
-
|
63
|
+
if (typeof token !== "undefined") {
|
64
|
+
value = token.value;
|
65
|
+
unindent = 0;
|
66
|
+
inCSS = (tagName === "style" || session.$modeId === "ace/mode/css");
|
67
|
+
if (is(token, "tag-open")) {
|
68
|
+
inTag = true;
|
69
|
+
if (nextToken)
|
70
|
+
inBlock = (blockTags.indexOf(nextToken.value) !== -1);
|
71
|
+
if (value === "</") {
|
72
|
+
if (inBlock && !breakBefore && rowsToAdd < 1)
|
73
|
+
rowsToAdd++;
|
74
|
+
|
75
|
+
if (inCSS)
|
76
|
+
rowsToAdd = 1;
|
77
|
+
|
78
|
+
unindent = 1;
|
79
|
+
inBlock = false;
|
210
80
|
}
|
81
|
+
} else if (is(token, "tag-close")) {
|
82
|
+
inTag = false;
|
83
|
+
} else if (is(token, "comment.start")) {
|
84
|
+
inBlock = true;
|
85
|
+
} else if (is(token, "comment.end")) {
|
86
|
+
inBlock = false;
|
87
|
+
}
|
88
|
+
if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
|
89
|
+
rowsToAdd++;
|
90
|
+
}
|
91
|
+
if (curRow !== row) {
|
92
|
+
rowsToAdd = curRow;
|
93
|
+
|
94
|
+
if (row)
|
95
|
+
rowsToAdd -= row;
|
211
96
|
}
|
212
|
-
}
|
213
|
-
if (token.type.indexOf('meta.tag.name') == 0) {
|
214
|
-
tag = token.value;
|
215
|
-
}
|
216
|
-
breakAdded = false;
|
217
|
-
for (i in newLines) {
|
218
|
-
if (
|
219
|
-
token.type == newLines[i].type &&
|
220
|
-
(
|
221
|
-
!newLines[i].value ||
|
222
|
-
token.value == newLines[i].value
|
223
|
-
) &&
|
224
|
-
(
|
225
|
-
!newLines[i].blockTag ||
|
226
|
-
singleTags.indexOf(nextTag) === -1
|
227
|
-
) &&
|
228
|
-
(
|
229
|
-
!newLines[i].context ||
|
230
|
-
newLines[i].context === context
|
231
|
-
)
|
232
|
-
) {
|
233
|
-
if (newLines[i].indent === false) {
|
234
|
-
indentation--;
|
235
|
-
}
|
236
97
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
) {
|
98
|
+
if (rowsToAdd) {
|
99
|
+
trimCode();
|
100
|
+
for (; rowsToAdd > 0; rowsToAdd--)
|
241
101
|
code += "\n";
|
242
|
-
breakAdded = true;
|
243
|
-
for (i = 0; i < indentation; i++) {
|
244
|
-
code += "\t";
|
245
|
-
}
|
246
|
-
}
|
247
102
|
|
248
|
-
|
103
|
+
breakBefore = true;
|
104
|
+
if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
|
105
|
+
value = value.trimLeft();
|
249
106
|
}
|
250
|
-
}
|
251
107
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
(
|
257
|
-
|
258
|
-
)
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
)
|
267
|
-
|
268
|
-
|
269
|
-
|
108
|
+
if (value) {
|
109
|
+
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
|
110
|
+
parents[depth] = value;
|
111
|
+
|
112
|
+
trimNext();
|
113
|
+
spaceAfter = true;
|
114
|
+
if (value.match(/^(else|elseif)$/)) {
|
115
|
+
if (code.match(/\}[\s]*$/)) {
|
116
|
+
trimCode();
|
117
|
+
spaceBefore = true;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
} else if (token.type === "paren.lparen") {
|
121
|
+
trimNext();
|
122
|
+
if (value.substr(-1) === "{") {
|
123
|
+
spaceAfter = true;
|
124
|
+
indentNextLine = false;
|
125
|
+
|
126
|
+
if(!inTag)
|
127
|
+
rowsToAdd = 1;
|
128
|
+
}
|
129
|
+
if (value.substr(0, 1) === "{") {
|
130
|
+
spaceBefore = true;
|
131
|
+
if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
|
132
|
+
trimCode();
|
133
|
+
spaceBefore = false;
|
134
|
+
} else if (code.trimRight().substr(-1) === ')') {
|
135
|
+
trimCode();
|
136
|
+
} else {
|
137
|
+
trimLine();
|
138
|
+
}
|
270
139
|
}
|
140
|
+
} else if (token.type === "paren.rparen") {
|
141
|
+
unindent = 1;
|
142
|
+
if (value.substr(0, 1) === "}") {
|
143
|
+
if (parents[depth-1] === 'case')
|
144
|
+
unindent++;
|
271
145
|
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
146
|
+
if (code.trimRight().substr(-1) === '{') {
|
147
|
+
trimCode();
|
148
|
+
} else {
|
149
|
+
spaceBefore = true;
|
150
|
+
|
151
|
+
if (inCSS)
|
152
|
+
rowsToAdd+=2;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
if (value.substr(0, 1) === "]") {
|
156
|
+
if (code.substr(-1) !== '}' && code.trimRight().substr(-1) === '}') {
|
157
|
+
spaceBefore = false;
|
158
|
+
indent++;
|
159
|
+
trimCode();
|
160
|
+
}
|
161
|
+
}
|
162
|
+
if (value.substr(0, 1) === ")") {
|
163
|
+
if (code.substr(-1) !== '(' && code.trimRight().substr(-1) === '(') {
|
164
|
+
spaceBefore = false;
|
165
|
+
indent++;
|
166
|
+
trimCode();
|
276
167
|
}
|
277
168
|
}
|
278
169
|
|
279
|
-
|
170
|
+
trimLine();
|
171
|
+
} else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
|
172
|
+
trimCode();
|
173
|
+
trimNext();
|
174
|
+
spaceBefore = true;
|
175
|
+
spaceAfter = true;
|
176
|
+
} else if (token.type === "punctuation.operator" && value === ';') {
|
177
|
+
trimCode();
|
178
|
+
trimNext();
|
179
|
+
spaceAfter = true;
|
180
|
+
|
181
|
+
if (inCSS)
|
182
|
+
rowsToAdd++;
|
183
|
+
} else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
|
184
|
+
trimCode();
|
185
|
+
trimNext();
|
186
|
+
if (value.match(/^(,)$/) && curlyDepth>0 && roundDepth===0) {
|
187
|
+
rowsToAdd++;
|
188
|
+
} else {
|
189
|
+
spaceAfter = true;
|
190
|
+
breakBefore = false;
|
191
|
+
}
|
192
|
+
} else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
|
193
|
+
trimCode();
|
194
|
+
spaceBefore = true;
|
195
|
+
} else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
|
196
|
+
spaceBefore = true;
|
197
|
+
} else if (is(token, "attribute-equals")) {
|
198
|
+
trimLine();
|
199
|
+
trimNext();
|
200
|
+
} else if (is(token, "tag-close")) {
|
201
|
+
trimLine();
|
202
|
+
if(value === "/>")
|
203
|
+
spaceBefore = true;
|
280
204
|
}
|
281
|
-
|
282
|
-
}
|
205
|
+
if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"]$/))) {
|
283
206
|
|
284
|
-
|
285
|
-
if ( lastToken.type == 'support.php_tag' && lastToken.value == '?>' ) {
|
286
|
-
dontBreak = false;
|
287
|
-
}
|
288
|
-
lastTag = tag;
|
207
|
+
indent = lastIndent;
|
289
208
|
|
290
|
-
|
209
|
+
if(depth > lastDepth) {
|
210
|
+
indent++;
|
291
211
|
|
292
|
-
|
212
|
+
for (i=depth; i > lastDepth; i--)
|
213
|
+
levels[i] = indent;
|
214
|
+
} else if(depth < lastDepth)
|
215
|
+
indent = levels[depth];
|
293
216
|
|
294
|
-
|
295
|
-
|
296
|
-
}
|
297
|
-
}
|
298
|
-
|
299
|
-
return code;
|
300
|
-
};
|
217
|
+
lastDepth = depth;
|
218
|
+
lastIndent = indent;
|
301
219
|
|
220
|
+
if(unindent)
|
221
|
+
indent -= unindent;
|
302
222
|
|
223
|
+
if (indentNextLine && !roundDepth) {
|
224
|
+
indent++;
|
225
|
+
indentNextLine = false;
|
226
|
+
}
|
303
227
|
|
304
|
-
|
228
|
+
for (i = 0; i < indent; i++)
|
229
|
+
code += tabString;
|
230
|
+
}
|
305
231
|
|
306
|
-
define("ace/ext/beautify",["require","exports","module","ace/token_iterator","ace/ext/beautify/php_rules"], function(require, exports, module) {
|
307
|
-
"use strict";
|
308
|
-
var TokenIterator = require("ace/token_iterator").TokenIterator;
|
309
232
|
|
310
|
-
|
233
|
+
if (token.type === "keyword" && value.match(/^(case|default)$/)) {
|
234
|
+
parents[depth] = value;
|
235
|
+
depth++;
|
236
|
+
}
|
311
237
|
|
312
|
-
exports.beautify = function(session) {
|
313
|
-
var iterator = new TokenIterator(session, 0, 0);
|
314
|
-
var token = iterator.getCurrentToken();
|
315
238
|
|
316
|
-
|
239
|
+
if (token.type === "keyword" && value.match(/^(break)$/)) {
|
240
|
+
if(parents[depth-1] && parents[depth-1].match(/^(case|default)$/)) {
|
241
|
+
depth--;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
if (token.type === "paren.lparen") {
|
245
|
+
roundDepth += (value.match(/\(/g) || []).length;
|
246
|
+
curlyDepth += (value.match(/\{/g) || []).length;
|
247
|
+
depth += value.length;
|
248
|
+
}
|
249
|
+
|
250
|
+
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
|
251
|
+
indentNextLine = true;
|
252
|
+
roundDepth = 0;
|
253
|
+
} else if (!roundDepth && value.trim() && token.type !== "comment")
|
254
|
+
indentNextLine = false;
|
255
|
+
|
256
|
+
if (token.type === "paren.rparen") {
|
257
|
+
roundDepth -= (value.match(/\)/g) || []).length;
|
258
|
+
curlyDepth -= (value.match(/\}/g) || []).length;
|
259
|
+
|
260
|
+
for (i = 0; i < value.length; i++) {
|
261
|
+
depth--;
|
262
|
+
if(value.substr(i, 1)==='}' && parents[depth]==='case') {
|
263
|
+
depth--;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
if (token.type == "text")
|
269
|
+
value = value.replace(/\s+$/, " ");
|
270
|
+
if (spaceBefore && !breakBefore) {
|
271
|
+
trimLine();
|
272
|
+
if (code.substr(-1) !== "\n")
|
273
|
+
code += " ";
|
274
|
+
}
|
275
|
+
|
276
|
+
code += value;
|
277
|
+
|
278
|
+
if (spaceAfter)
|
279
|
+
code += " ";
|
280
|
+
|
281
|
+
breakBefore = false;
|
282
|
+
spaceBefore = false;
|
283
|
+
spaceAfter = false;
|
284
|
+
if ((is(token, "tag-close") && (inBlock || blockTags.indexOf(tagName) !== -1)) || (is(token, "doctype") && value === ">")) {
|
285
|
+
if (inBlock && nextToken && nextToken.value === "</")
|
286
|
+
rowsToAdd = -1;
|
287
|
+
else
|
288
|
+
rowsToAdd = 1;
|
289
|
+
}
|
290
|
+
if (is(token, "tag-open") && value === "</") {
|
291
|
+
depth--;
|
292
|
+
} else if (is(token, "tag-open") && value === "<" && singletonTags.indexOf(nextToken.value) === -1) {
|
293
|
+
depth++;
|
294
|
+
} else if (is(token, "tag-name")) {
|
295
|
+
tagName = value;
|
296
|
+
} else if (is(token, "tag-close") && value === "/>" && singletonTags.indexOf(tagName) === -1){
|
297
|
+
depth--;
|
298
|
+
}
|
299
|
+
|
300
|
+
row = curRow;
|
301
|
+
}
|
302
|
+
}
|
317
303
|
|
318
|
-
|
304
|
+
token = nextToken;
|
305
|
+
}
|
306
|
+
|
307
|
+
code = code.trim();
|
319
308
|
session.doc.setValue(code);
|
320
309
|
};
|
321
310
|
|
322
311
|
exports.commands = [{
|
323
312
|
name: "beautify",
|
313
|
+
description: "Format selection (Beautify)",
|
324
314
|
exec: function(editor) {
|
325
315
|
exports.beautify(editor.session);
|
326
316
|
},
|
327
317
|
bindKey: "Ctrl-Shift-B"
|
328
|
-
}]
|
318
|
+
}];
|
329
319
|
|
330
|
-
});
|
331
|
-
|
332
|
-
|
320
|
+
}); (function() {
|
321
|
+
window.require(["ace/ext/beautify"], function(m) {
|
322
|
+
if (typeof module == "object" && typeof exports == "object" && module) {
|
323
|
+
module.exports = m;
|
324
|
+
}
|
325
|
+
});
|
333
326
|
})();
|
334
327
|
|