ace-oqc 1.4.13 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +71 -0
- package/package.json +3 -3
- package/src-noconflict/ace.js +0 -21402
- package/src-noconflict/ext-beautify.js +0 -331
- package/src-noconflict/ext-elastic_tabstops_lite.js +0 -277
- package/src-noconflict/ext-emmet.js +0 -1331
- package/src-noconflict/ext-error_marker.js +0 -9
- package/src-noconflict/ext-keybinding_menu.js +0 -193
- package/src-noconflict/ext-language_tools.js +0 -2166
- package/src-noconflict/ext-linking.js +0 -64
- package/src-noconflict/ext-modelist.js +0 -248
- package/src-noconflict/ext-options.js +0 -799
- package/src-noconflict/ext-prompt.js +0 -2806
- package/src-noconflict/ext-rtl.js +0 -122
- package/src-noconflict/ext-searchbox.js +0 -514
- package/src-noconflict/ext-settings_menu.js +0 -820
- package/src-noconflict/ext-spellcheck.js +0 -73
- package/src-noconflict/ext-split.js +0 -207
- package/src-noconflict/ext-static_highlight.js +0 -229
- package/src-noconflict/ext-statusbar.js +0 -56
- package/src-noconflict/ext-textarea.js +0 -430
- package/src-noconflict/ext-themelist.js +0 -67
- package/src-noconflict/ext-whitespace.js +0 -213
- package/src-noconflict/keybinding-emacs.js +0 -1169
- package/src-noconflict/keybinding-sublime.js +0 -422
- package/src-noconflict/keybinding-vim.js +0 -6198
- package/src-noconflict/mode-abap.js +0 -221
- package/src-noconflict/mode-abc.js +0 -271
- package/src-noconflict/mode-actionscript.js +0 -275
- package/src-noconflict/mode-ada.js +0 -137
- package/src-noconflict/mode-apache_conf.js +0 -363
- package/src-noconflict/mode-apex.js +0 -457
- package/src-noconflict/mode-applescript.js +0 -278
- package/src-noconflict/mode-aql.js +0 -102
- package/src-noconflict/mode-asciidoc.js +0 -349
- package/src-noconflict/mode-asl.js +0 -422
- package/src-noconflict/mode-assembly_x86.js +0 -193
- package/src-noconflict/mode-autohotkey.js +0 -244
- package/src-noconflict/mode-batchfile.js +0 -230
- package/src-noconflict/mode-c9search.js +0 -293
- package/src-noconflict/mode-c_cpp.js +0 -503
- package/src-noconflict/mode-cirru.js +0 -210
- package/src-noconflict/mode-clojure.js +0 -315
- package/src-noconflict/mode-cobol.js +0 -101
- package/src-noconflict/mode-coffee.js +0 -400
- package/src-noconflict/mode-coldfusion.js +0 -2596
- package/src-noconflict/mode-crystal.js +0 -642
- package/src-noconflict/mode-csharp.js +0 -502
- package/src-noconflict/mode-csound_document.js +0 -4105
- package/src-noconflict/mode-csound_orchestra.js +0 -3035
- package/src-noconflict/mode-csound_score.js +0 -462
- package/src-noconflict/mode-csp.js +0 -59
- package/src-noconflict/mode-css.js +0 -720
- package/src-noconflict/mode-curly.js +0 -2564
- package/src-noconflict/mode-d.js +0 -520
- package/src-noconflict/mode-dart.js +0 -715
- package/src-noconflict/mode-diff.js +0 -147
- package/src-noconflict/mode-django.js +0 -2595
- package/src-noconflict/mode-dockerfile.js +0 -500
- package/src-noconflict/mode-dot.js +0 -417
- package/src-noconflict/mode-drools.js +0 -498
- package/src-noconflict/mode-edifact.js +0 -166
- package/src-noconflict/mode-eiffel.js +0 -135
- package/src-noconflict/mode-ejs.js +0 -3533
- package/src-noconflict/mode-elixir.js +0 -501
- package/src-noconflict/mode-elm.js +0 -306
- package/src-noconflict/mode-erlang.js +0 -1010
- package/src-noconflict/mode-forth.js +0 -297
- package/src-noconflict/mode-fortran.js +0 -430
- package/src-noconflict/mode-fsharp.js +0 -316
- package/src-noconflict/mode-fsl.js +0 -259
- package/src-noconflict/mode-ftl.js +0 -1193
- package/src-noconflict/mode-gcode.js +0 -93
- package/src-noconflict/mode-gherkin.js +0 -168
- package/src-noconflict/mode-gitignore.js +0 -59
- package/src-noconflict/mode-glsl.js +0 -580
- package/src-noconflict/mode-gobstones.js +0 -1090
- package/src-noconflict/mode-golang.js +0 -413
- package/src-noconflict/mode-graphqlschema.js +0 -214
- package/src-noconflict/mode-groovy.js +0 -989
- package/src-noconflict/mode-haml.js +0 -1873
- package/src-noconflict/mode-handlebars.js +0 -2622
- package/src-noconflict/mode-haskell.js +0 -380
- package/src-noconflict/mode-haskell_cabal.js +0 -141
- package/src-noconflict/mode-haxe.js +0 -386
- package/src-noconflict/mode-hjson.js +0 -353
- package/src-noconflict/mode-html.js +0 -2509
- package/src-noconflict/mode-html_elixir.js +0 -3088
- package/src-noconflict/mode-html_ruby.js +0 -3550
- package/src-noconflict/mode-ini.js +0 -162
- package/src-noconflict/mode-io.js +0 -248
- package/src-noconflict/mode-jack.js +0 -346
- package/src-noconflict/mode-jade.js +0 -2025
- package/src-noconflict/mode-java.js +0 -1038
- package/src-noconflict/mode-javascript.js +0 -798
- package/src-noconflict/mode-json.js +0 -329
- package/src-noconflict/mode-jsoniq.js +0 -2632
- package/src-noconflict/mode-jsp.js +0 -1433
- package/src-noconflict/mode-jssm.js +0 -325
- package/src-noconflict/mode-jsx.js +0 -411
- package/src-noconflict/mode-julia.js +0 -303
- package/src-noconflict/mode-kotlin.js +0 -797
- package/src-noconflict/mode-latex.js +0 -296
- package/src-noconflict/mode-less.js +0 -839
- package/src-noconflict/mode-liquid.js +0 -2742
- package/src-noconflict/mode-lisp.js +0 -112
- package/src-noconflict/mode-livescript.js +0 -279
- package/src-noconflict/mode-logiql.js +0 -317
- package/src-noconflict/mode-logtalk.js +0 -352
- package/src-noconflict/mode-lsl.js +0 -343
- package/src-noconflict/mode-lua.js +0 -452
- package/src-noconflict/mode-luapage.js +0 -3028
- package/src-noconflict/mode-lucene.js +0 -154
- package/src-noconflict/mode-makefile.js +0 -412
- package/src-noconflict/mode-markdown.js +0 -3194
- package/src-noconflict/mode-mask.js +0 -1803
- package/src-noconflict/mode-matlab.js +0 -263
- package/src-noconflict/mode-maze.js +0 -292
- package/src-noconflict/mode-mel.js +0 -263
- package/src-noconflict/mode-mixal.js +0 -122
- package/src-noconflict/mode-mushcode.js +0 -681
- package/src-noconflict/mode-mysql.js +0 -167
- package/src-noconflict/mode-nginx.js +0 -298
- package/src-noconflict/mode-nim.js +0 -363
- package/src-noconflict/mode-nix.js +0 -647
- package/src-noconflict/mode-nsis.js +0 -312
- package/src-noconflict/mode-objectivec.js +0 -740
- package/src-noconflict/mode-ocaml.js +0 -421
- package/src-noconflict/mode-pascal.js +0 -223
- package/src-noconflict/mode-perl.js +0 -381
- package/src-noconflict/mode-pgsql.js +0 -1743
- package/src-noconflict/mode-php.js +0 -13110
- package/src-noconflict/mode-php_laravel_blade.js +0 -13311
- package/src-noconflict/mode-pig.js +0 -310
- package/src-noconflict/mode-plain_text.js +0 -32
- package/src-noconflict/mode-powershell.js +0 -418
- package/src-noconflict/mode-praat.js +0 -478
- package/src-noconflict/mode-prolog.js +0 -371
- package/src-noconflict/mode-properties.js +0 -80
- package/src-noconflict/mode-protobuf.js +0 -593
- package/src-noconflict/mode-puppet.js +0 -368
- package/src-noconflict/mode-python.js +0 -508
- package/src-noconflict/mode-r.js +0 -312
- package/src-noconflict/mode-razor.js +0 -2875
- package/src-noconflict/mode-rdoc.js +0 -243
- package/src-noconflict/mode-red.js +0 -450
- package/src-noconflict/mode-redshift.js +0 -360
- package/src-noconflict/mode-rhtml.js +0 -2808
- package/src-noconflict/mode-rst.js +0 -257
- package/src-noconflict/mode-ruby.js +0 -1003
- package/src-noconflict/mode-rust.js +0 -282
- package/src-noconflict/mode-sass.js +0 -529
- package/src-noconflict/mode-scad.js +0 -414
- package/src-noconflict/mode-scala.js +0 -984
- package/src-noconflict/mode-scheme.js +0 -232
- package/src-noconflict/mode-scss.js +0 -873
- package/src-noconflict/mode-sh.js +0 -449
- package/src-noconflict/mode-sjs.js +0 -1015
- package/src-noconflict/mode-slim.js +0 -5240
- package/src-noconflict/mode-smarty.js +0 -2635
- package/src-noconflict/mode-snippets.js +0 -207
- package/src-noconflict/mode-soy_template.js +0 -2848
- package/src-noconflict/mode-space.js +0 -167
- package/src-noconflict/mode-sparql.js +0 -320
- package/src-noconflict/mode-sql.js +0 -271
- package/src-noconflict/mode-sqlserver.js +0 -445
- package/src-noconflict/mode-stylus.js +0 -472
- package/src-noconflict/mode-svg.js +0 -1582
- package/src-noconflict/mode-swift.js +0 -395
- package/src-noconflict/mode-tcl.js +0 -387
- package/src-noconflict/mode-terraform.js +0 -400
- package/src-noconflict/mode-tex.js +0 -160
- package/src-noconflict/mode-text.js +0 -9
- package/src-noconflict/mode-textile.js +0 -150
- package/src-noconflict/mode-toml.js +0 -153
- package/src-noconflict/mode-tsx.js +0 -888
- package/src-noconflict/mode-turtle.js +0 -296
- package/src-noconflict/mode-twig.js +0 -2693
- package/src-noconflict/mode-typescript.js +0 -869
- package/src-noconflict/mode-vala.js +0 -677
- package/src-noconflict/mode-vbscript.js +0 -635
- package/src-noconflict/mode-velocity.js +0 -2792
- package/src-noconflict/mode-verilog.js +0 -118
- package/src-noconflict/mode-vhdl.js +0 -116
- package/src-noconflict/mode-visualforce.js +0 -2640
- package/src-noconflict/mode-wollok.js +0 -914
- package/src-noconflict/mode-xml.js +0 -676
- package/src-noconflict/mode-xquery.js +0 -2644
- package/src-noconflict/mode-yaml.js +0 -330
- package/src-noconflict/mode-zeek.js +0 -539
- package/src-noconflict/qurator-mode.js +0 -120
- package/src-noconflict/qurator-worker.js +0 -91
- package/src-noconflict/snippets/abap.js +0 -9
- package/src-noconflict/snippets/abc.js +0 -45
- package/src-noconflict/snippets/actionscript.js +0 -171
- package/src-noconflict/snippets/ada.js +0 -9
- package/src-noconflict/snippets/apache_conf.js +0 -9
- package/src-noconflict/snippets/apex.js +0 -9
- package/src-noconflict/snippets/applescript.js +0 -9
- package/src-noconflict/snippets/aql.js +0 -9
- package/src-noconflict/snippets/asciidoc.js +0 -9
- package/src-noconflict/snippets/asl.js +0 -9
- package/src-noconflict/snippets/assembly_x86.js +0 -9
- package/src-noconflict/snippets/autohotkey.js +0 -9
- package/src-noconflict/snippets/batchfile.js +0 -9
- package/src-noconflict/snippets/c9search.js +0 -9
- package/src-noconflict/snippets/c_cpp.js +0 -145
- package/src-noconflict/snippets/cirru.js +0 -9
- package/src-noconflict/snippets/clojure.js +0 -104
- package/src-noconflict/snippets/cobol.js +0 -9
- package/src-noconflict/snippets/coffee.js +0 -109
- package/src-noconflict/snippets/coldfusion.js +0 -9
- package/src-noconflict/snippets/crystal.js +0 -9
- package/src-noconflict/snippets/csharp.js +0 -9
- package/src-noconflict/snippets/csound_document.js +0 -24
- package/src-noconflict/snippets/csound_orchestra.js +0 -61
- package/src-noconflict/snippets/csound_score.js +0 -9
- package/src-noconflict/snippets/csp.js +0 -9
- package/src-noconflict/snippets/css.js +0 -981
- package/src-noconflict/snippets/curly.js +0 -9
- package/src-noconflict/snippets/d.js +0 -9
- package/src-noconflict/snippets/dart.js +0 -97
- package/src-noconflict/snippets/diff.js +0 -25
- package/src-noconflict/snippets/django.js +0 -122
- package/src-noconflict/snippets/dockerfile.js +0 -9
- package/src-noconflict/snippets/dot.js +0 -9
- package/src-noconflict/snippets/drools.js +0 -33
- package/src-noconflict/snippets/edifact.js +0 -254
- package/src-noconflict/snippets/eiffel.js +0 -9
- package/src-noconflict/snippets/ejs.js +0 -9
- package/src-noconflict/snippets/elixir.js +0 -9
- package/src-noconflict/snippets/elm.js +0 -9
- package/src-noconflict/snippets/erlang.js +0 -174
- package/src-noconflict/snippets/forth.js +0 -9
- package/src-noconflict/snippets/fortran.js +0 -9
- package/src-noconflict/snippets/fsharp.js +0 -9
- package/src-noconflict/snippets/fsl.js +0 -14
- package/src-noconflict/snippets/ftl.js +0 -9
- package/src-noconflict/snippets/gcode.js +0 -9
- package/src-noconflict/snippets/gherkin.js +0 -9
- package/src-noconflict/snippets/gitignore.js +0 -9
- package/src-noconflict/snippets/glsl.js +0 -9
- package/src-noconflict/snippets/gobstones.js +0 -1718
- package/src-noconflict/snippets/golang.js +0 -9
- package/src-noconflict/snippets/graphqlschema.js +0 -46
- package/src-noconflict/snippets/groovy.js +0 -9
- package/src-noconflict/snippets/haml.js +0 -34
- package/src-noconflict/snippets/handlebars.js +0 -9
- package/src-noconflict/snippets/haskell.js +0 -96
- package/src-noconflict/snippets/haskell_cabal.js +0 -9
- package/src-noconflict/snippets/haxe.js +0 -9
- package/src-noconflict/snippets/hjson.js +0 -9
- package/src-noconflict/snippets/html.js +0 -867
- package/src-noconflict/snippets/html_elixir.js +0 -9
- package/src-noconflict/snippets/html_ruby.js +0 -9
- package/src-noconflict/snippets/ini.js +0 -9
- package/src-noconflict/snippets/io.js +0 -76
- package/src-noconflict/snippets/jack.js +0 -9
- package/src-noconflict/snippets/jade.js +0 -9
- package/src-noconflict/snippets/java.js +0 -254
- package/src-noconflict/snippets/javascript.js +0 -209
- package/src-noconflict/snippets/json.js +0 -9
- package/src-noconflict/snippets/jsoniq.js +0 -75
- package/src-noconflict/snippets/jsp.js +0 -113
- package/src-noconflict/snippets/jssm.js +0 -9
- package/src-noconflict/snippets/jsx.js +0 -9
- package/src-noconflict/snippets/julia.js +0 -9
- package/src-noconflict/snippets/kotlin.js +0 -9
- package/src-noconflict/snippets/latex.js +0 -9
- package/src-noconflict/snippets/less.js +0 -9
- package/src-noconflict/snippets/liquid.js +0 -895
- package/src-noconflict/snippets/lisp.js +0 -9
- package/src-noconflict/snippets/livescript.js +0 -9
- package/src-noconflict/snippets/logiql.js +0 -9
- package/src-noconflict/snippets/logtalk.js +0 -9
- package/src-noconflict/snippets/lsl.js +0 -1246
- package/src-noconflict/snippets/lua.js +0 -35
- package/src-noconflict/snippets/luapage.js +0 -9
- package/src-noconflict/snippets/lucene.js +0 -9
- package/src-noconflict/snippets/makefile.js +0 -18
- package/src-noconflict/snippets/markdown.js +0 -102
- package/src-noconflict/snippets/mask.js +0 -9
- package/src-noconflict/snippets/matlab.js +0 -9
- package/src-noconflict/snippets/maze.js +0 -23
- package/src-noconflict/snippets/mel.js +0 -9
- package/src-noconflict/snippets/mixal.js +0 -9
- package/src-noconflict/snippets/mushcode.js +0 -9
- package/src-noconflict/snippets/mysql.js +0 -9
- package/src-noconflict/snippets/nginx.js +0 -9
- package/src-noconflict/snippets/nim.js +0 -9
- package/src-noconflict/snippets/nix.js +0 -9
- package/src-noconflict/snippets/nsis.js +0 -9
- package/src-noconflict/snippets/objectivec.js +0 -9
- package/src-noconflict/snippets/ocaml.js +0 -9
- package/src-noconflict/snippets/pascal.js +0 -9
- package/src-noconflict/snippets/perl.js +0 -361
- package/src-noconflict/snippets/pgsql.js +0 -9
- package/src-noconflict/snippets/php.js +0 -397
- package/src-noconflict/snippets/php_laravel_blade.js +0 -9
- package/src-noconflict/snippets/pig.js +0 -9
- package/src-noconflict/snippets/plain_text.js +0 -9
- package/src-noconflict/snippets/powershell.js +0 -9
- package/src-noconflict/snippets/praat.js +0 -9
- package/src-noconflict/snippets/prolog.js +0 -9
- package/src-noconflict/snippets/properties.js +0 -9
- package/src-noconflict/snippets/protobuf.js +0 -9
- package/src-noconflict/snippets/puppet.js +0 -9
- package/src-noconflict/snippets/python.js +0 -172
- package/src-noconflict/snippets/r.js +0 -135
- package/src-noconflict/snippets/razor.js +0 -17
- package/src-noconflict/snippets/rdoc.js +0 -9
- package/src-noconflict/snippets/red.js +0 -9
- package/src-noconflict/snippets/redshift.js +0 -9
- package/src-noconflict/snippets/rhtml.js +0 -9
- package/src-noconflict/snippets/rst.js +0 -36
- package/src-noconflict/snippets/ruby.js +0 -942
- package/src-noconflict/snippets/rust.js +0 -9
- package/src-noconflict/snippets/sass.js +0 -9
- package/src-noconflict/snippets/scad.js +0 -9
- package/src-noconflict/snippets/scala.js +0 -9
- package/src-noconflict/snippets/scheme.js +0 -9
- package/src-noconflict/snippets/scss.js +0 -9
- package/src-noconflict/snippets/sh.js +0 -97
- package/src-noconflict/snippets/sjs.js +0 -9
- package/src-noconflict/snippets/slim.js +0 -9
- package/src-noconflict/snippets/smarty.js +0 -9
- package/src-noconflict/snippets/snippets.js +0 -23
- package/src-noconflict/snippets/soy_template.js +0 -9
- package/src-noconflict/snippets/space.js +0 -9
- package/src-noconflict/snippets/sparql.js +0 -9
- package/src-noconflict/snippets/sql.js +0 -40
- package/src-noconflict/snippets/sqlserver.js +0 -83
- package/src-noconflict/snippets/stylus.js +0 -9
- package/src-noconflict/snippets/svg.js +0 -9
- package/src-noconflict/snippets/swift.js +0 -9
- package/src-noconflict/snippets/tcl.js +0 -106
- package/src-noconflict/snippets/terraform.js +0 -9
- package/src-noconflict/snippets/tex.js +0 -204
- package/src-noconflict/snippets/text.js +0 -9
- package/src-noconflict/snippets/textile.js +0 -44
- package/src-noconflict/snippets/toml.js +0 -9
- package/src-noconflict/snippets/tsx.js +0 -9
- package/src-noconflict/snippets/turtle.js +0 -9
- package/src-noconflict/snippets/twig.js +0 -9
- package/src-noconflict/snippets/typescript.js +0 -9
- package/src-noconflict/snippets/vala.js +0 -200
- package/src-noconflict/snippets/vbscript.js +0 -9
- package/src-noconflict/snippets/velocity.js +0 -43
- package/src-noconflict/snippets/verilog.js +0 -9
- package/src-noconflict/snippets/vhdl.js +0 -9
- package/src-noconflict/snippets/visualforce.js +0 -9
- package/src-noconflict/snippets/wollok.js +0 -98
- package/src-noconflict/snippets/xml.js +0 -9
- package/src-noconflict/snippets/xquery.js +0 -75
- package/src-noconflict/snippets/yaml.js +0 -9
- package/src-noconflict/snippets/zeek.js +0 -9
- package/src-noconflict/theme-ambiance.js +0 -185
- package/src-noconflict/theme-chaos.js +0 -163
- package/src-noconflict/theme-chrome.js +0 -135
- package/src-noconflict/theme-clouds.js +0 -102
- package/src-noconflict/theme-clouds_midnight.js +0 -103
- package/src-noconflict/theme-cobalt.js +0 -120
- package/src-noconflict/theme-crimson_editor.js +0 -125
- package/src-noconflict/theme-dawn.js +0 -115
- package/src-noconflict/theme-dracula.js +0 -135
- package/src-noconflict/theme-dreamweaver.js +0 -148
- package/src-noconflict/theme-eclipse.js +0 -105
- package/src-noconflict/theme-github.js +0 -110
- package/src-noconflict/theme-gob.js +0 -119
- package/src-noconflict/theme-gruvbox.js +0 -89
- package/src-noconflict/theme-idle_fingers.js +0 -103
- package/src-noconflict/theme-iplastic.js +0 -128
- package/src-noconflict/theme-katzenmilch.js +0 -128
- package/src-noconflict/theme-kr_theme.js +0 -111
- package/src-noconflict/theme-kuroir.js +0 -68
- package/src-noconflict/theme-merbivore.js +0 -102
- package/src-noconflict/theme-merbivore_soft.js +0 -103
- package/src-noconflict/theme-mono_industrial.js +0 -114
- package/src-noconflict/theme-monokai.js +0 -112
- package/src-noconflict/theme-pastel_on_dark.js +0 -115
- package/src-noconflict/theme-solarized_dark.js +0 -95
- package/src-noconflict/theme-solarized_light.js +0 -98
- package/src-noconflict/theme-sqlserver.js +0 -145
- package/src-noconflict/theme-terminal.js +0 -121
- package/src-noconflict/theme-textmate.js +0 -137
- package/src-noconflict/theme-tomorrow.js +0 -115
- package/src-noconflict/theme-tomorrow_night.js +0 -115
- package/src-noconflict/theme-tomorrow_night_blue.js +0 -113
- package/src-noconflict/theme-tomorrow_night_bright.js +0 -128
- package/src-noconflict/theme-tomorrow_night_eighties.js +0 -115
- package/src-noconflict/theme-twilight.js +0 -116
- package/src-noconflict/theme-vibrant_ink.js +0 -101
- package/src-noconflict/theme-xcode.js +0 -95
- package/src-noconflict/worker-coffee.js +0 -1470
- package/src-noconflict/worker-css.js +0 -9000
- package/src-noconflict/worker-html.js +0 -10922
- package/src-noconflict/worker-javascript.js +0 -15001
- package/src-noconflict/worker-json.js +0 -1715
- package/src-noconflict/worker-lua.js +0 -3608
- package/src-noconflict/worker-php.js +0 -3687
- package/src-noconflict/worker-xml.js +0 -3208
- package/src-noconflict/worker-xquery.js +0 -57668
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var TokenIterator = require("../token_iterator").TokenIterator;
|
|
4
|
-
|
|
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"];
|
|
10
|
-
|
|
11
|
-
exports.beautify = function(session) {
|
|
12
|
-
var iterator = new TokenIterator(session, 0, 0);
|
|
13
|
-
var token = iterator.getCurrentToken();
|
|
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 = [];
|
|
43
|
-
var caseBody = false;
|
|
44
|
-
|
|
45
|
-
var trimNext = function() {
|
|
46
|
-
if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
|
|
47
|
-
nextToken.value = nextToken.value.replace(/^\s*/, "");
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
var trimLine = function() {
|
|
51
|
-
code = code.replace(/ +$/, "");
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var trimCode = function() {
|
|
55
|
-
code = code.trimRight();
|
|
56
|
-
breakBefore = false;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
while (token !== null) {
|
|
60
|
-
curRow = iterator.getCurrentTokenRow();
|
|
61
|
-
rowTokens = iterator.$rowTokens;
|
|
62
|
-
nextToken = iterator.stepForward();
|
|
63
|
-
|
|
64
|
-
if (typeof token !== "undefined") {
|
|
65
|
-
value = token.value;
|
|
66
|
-
unindent = 0;
|
|
67
|
-
inCSS = (tagName === "style" || session.$modeId === "ace/mode/css");
|
|
68
|
-
if (is(token, "tag-open")) {
|
|
69
|
-
inTag = true;
|
|
70
|
-
if (nextToken)
|
|
71
|
-
inBlock = (blockTags.indexOf(nextToken.value) !== -1);
|
|
72
|
-
if (value === "</") {
|
|
73
|
-
if (inBlock && !breakBefore && rowsToAdd < 1)
|
|
74
|
-
rowsToAdd++;
|
|
75
|
-
|
|
76
|
-
if (inCSS)
|
|
77
|
-
rowsToAdd = 1;
|
|
78
|
-
|
|
79
|
-
unindent = 1;
|
|
80
|
-
inBlock = false;
|
|
81
|
-
}
|
|
82
|
-
} else if (is(token, "tag-close")) {
|
|
83
|
-
inTag = false;
|
|
84
|
-
} else if (is(token, "comment.start")) {
|
|
85
|
-
inBlock = true;
|
|
86
|
-
} else if (is(token, "comment.end")) {
|
|
87
|
-
inBlock = false;
|
|
88
|
-
}
|
|
89
|
-
if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
|
|
90
|
-
rowsToAdd++;
|
|
91
|
-
}
|
|
92
|
-
if (curRow !== row) {
|
|
93
|
-
rowsToAdd = curRow;
|
|
94
|
-
|
|
95
|
-
if (row)
|
|
96
|
-
rowsToAdd -= row;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (rowsToAdd) {
|
|
100
|
-
trimCode();
|
|
101
|
-
for (; rowsToAdd > 0; rowsToAdd--)
|
|
102
|
-
code += "\n";
|
|
103
|
-
|
|
104
|
-
breakBefore = true;
|
|
105
|
-
if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
|
|
106
|
-
value = value.trimLeft();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (value) {
|
|
110
|
-
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
|
|
111
|
-
parents[depth] = value;
|
|
112
|
-
|
|
113
|
-
trimNext();
|
|
114
|
-
spaceAfter = true;
|
|
115
|
-
if (value.match(/^(else|elseif)$/)) {
|
|
116
|
-
if (code.match(/\}[\s]*$/)) {
|
|
117
|
-
trimCode();
|
|
118
|
-
spaceBefore = true;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
} else if (token.type === "paren.lparen") {
|
|
122
|
-
trimNext();
|
|
123
|
-
if (value.substr(-1) === "{") {
|
|
124
|
-
spaceAfter = true;
|
|
125
|
-
indentNextLine = false;
|
|
126
|
-
|
|
127
|
-
if(!inTag)
|
|
128
|
-
rowsToAdd = 1;
|
|
129
|
-
}
|
|
130
|
-
if (value.substr(0, 1) === "{") {
|
|
131
|
-
spaceBefore = true;
|
|
132
|
-
if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
|
|
133
|
-
trimCode();
|
|
134
|
-
spaceBefore = false;
|
|
135
|
-
} else if (code.trimRight().substr(-1) === ')') {
|
|
136
|
-
trimCode();
|
|
137
|
-
} else {
|
|
138
|
-
trimLine();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
} else if (token.type === "paren.rparen") {
|
|
142
|
-
unindent = 1;
|
|
143
|
-
if (value.substr(0, 1) === "}") {
|
|
144
|
-
if (parents[depth-1] === 'case')
|
|
145
|
-
unindent++;
|
|
146
|
-
|
|
147
|
-
if (code.trimRight().substr(-1) === '{') {
|
|
148
|
-
trimCode();
|
|
149
|
-
} else {
|
|
150
|
-
spaceBefore = true;
|
|
151
|
-
|
|
152
|
-
if (inCSS)
|
|
153
|
-
rowsToAdd+=2;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (value.substr(0, 1) === "]") {
|
|
157
|
-
if (code.substr(-1) !== '}' && code.trimRight().substr(-1) === '}') {
|
|
158
|
-
spaceBefore = false;
|
|
159
|
-
indent++;
|
|
160
|
-
trimCode();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (value.substr(0, 1) === ")") {
|
|
164
|
-
if (code.substr(-1) !== '(' && code.trimRight().substr(-1) === '(') {
|
|
165
|
-
spaceBefore = false;
|
|
166
|
-
indent++;
|
|
167
|
-
trimCode();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
trimLine();
|
|
172
|
-
} else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
|
|
173
|
-
trimCode();
|
|
174
|
-
trimNext();
|
|
175
|
-
spaceBefore = true;
|
|
176
|
-
spaceAfter = true;
|
|
177
|
-
} else if (token.type === "punctuation.operator" && value === ';') {
|
|
178
|
-
trimCode();
|
|
179
|
-
trimNext();
|
|
180
|
-
spaceAfter = true;
|
|
181
|
-
|
|
182
|
-
if (inCSS)
|
|
183
|
-
rowsToAdd++;
|
|
184
|
-
} else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
|
|
185
|
-
trimCode();
|
|
186
|
-
trimNext();
|
|
187
|
-
if (value.match(/^(,)$/) && curlyDepth>0 && roundDepth===0) {
|
|
188
|
-
rowsToAdd++;
|
|
189
|
-
} else {
|
|
190
|
-
spaceAfter = true;
|
|
191
|
-
breakBefore = false;
|
|
192
|
-
}
|
|
193
|
-
} else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
|
|
194
|
-
trimCode();
|
|
195
|
-
spaceBefore = true;
|
|
196
|
-
} else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
|
|
197
|
-
spaceBefore = true;
|
|
198
|
-
} else if (is(token, "attribute-equals")) {
|
|
199
|
-
trimLine();
|
|
200
|
-
trimNext();
|
|
201
|
-
} else if (is(token, "tag-close")) {
|
|
202
|
-
trimLine();
|
|
203
|
-
if(value === "/>")
|
|
204
|
-
spaceBefore = true;
|
|
205
|
-
} else if (token.type === "keyword" && value.match(/^(case|default)$/)) {
|
|
206
|
-
if (caseBody)
|
|
207
|
-
unindent = 1;
|
|
208
|
-
}
|
|
209
|
-
if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"]$/))) {
|
|
210
|
-
|
|
211
|
-
indent = lastIndent;
|
|
212
|
-
|
|
213
|
-
if(depth > lastDepth) {
|
|
214
|
-
indent++;
|
|
215
|
-
|
|
216
|
-
for (i=depth; i > lastDepth; i--)
|
|
217
|
-
levels[i] = indent;
|
|
218
|
-
} else if(depth < lastDepth)
|
|
219
|
-
indent = levels[depth];
|
|
220
|
-
|
|
221
|
-
lastDepth = depth;
|
|
222
|
-
lastIndent = indent;
|
|
223
|
-
|
|
224
|
-
if(unindent)
|
|
225
|
-
indent -= unindent;
|
|
226
|
-
|
|
227
|
-
if (indentNextLine && !roundDepth) {
|
|
228
|
-
indent++;
|
|
229
|
-
indentNextLine = false;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
for (i = 0; i < indent; i++)
|
|
233
|
-
code += tabString;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if (token.type === "keyword" && value.match(/^(case|default)$/)) {
|
|
237
|
-
if (caseBody === false) {
|
|
238
|
-
parents[depth] = value;
|
|
239
|
-
depth++;
|
|
240
|
-
caseBody = true;
|
|
241
|
-
}
|
|
242
|
-
} else if (token.type === "keyword" && value.match(/^(break)$/)) {
|
|
243
|
-
if(parents[depth-1] && parents[depth-1].match(/^(case|default)$/)) {
|
|
244
|
-
depth--;
|
|
245
|
-
caseBody = false;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (token.type === "paren.lparen") {
|
|
249
|
-
roundDepth += (value.match(/\(/g) || []).length;
|
|
250
|
-
curlyDepth += (value.match(/\{/g) || []).length;
|
|
251
|
-
depth += value.length;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
|
|
255
|
-
indentNextLine = true;
|
|
256
|
-
roundDepth = 0;
|
|
257
|
-
} else if (!roundDepth && value.trim() && token.type !== "comment")
|
|
258
|
-
indentNextLine = false;
|
|
259
|
-
|
|
260
|
-
if (token.type === "paren.rparen") {
|
|
261
|
-
roundDepth -= (value.match(/\)/g) || []).length;
|
|
262
|
-
curlyDepth -= (value.match(/\}/g) || []).length;
|
|
263
|
-
|
|
264
|
-
for (i = 0; i < value.length; i++) {
|
|
265
|
-
depth--;
|
|
266
|
-
if(value.substr(i, 1)==='}' && parents[depth]==='case') {
|
|
267
|
-
depth--;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (token.type == "text")
|
|
273
|
-
value = value.replace(/\s+$/, " ");
|
|
274
|
-
if (spaceBefore && !breakBefore) {
|
|
275
|
-
trimLine();
|
|
276
|
-
if (code.substr(-1) !== "\n")
|
|
277
|
-
code += " ";
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
code += value;
|
|
281
|
-
|
|
282
|
-
if (spaceAfter)
|
|
283
|
-
code += " ";
|
|
284
|
-
|
|
285
|
-
breakBefore = false;
|
|
286
|
-
spaceBefore = false;
|
|
287
|
-
spaceAfter = false;
|
|
288
|
-
if ((is(token, "tag-close") && (inBlock || blockTags.indexOf(tagName) !== -1)) || (is(token, "doctype") && value === ">")) {
|
|
289
|
-
if (inBlock && nextToken && nextToken.value === "</")
|
|
290
|
-
rowsToAdd = -1;
|
|
291
|
-
else
|
|
292
|
-
rowsToAdd = 1;
|
|
293
|
-
}
|
|
294
|
-
if (is(token, "tag-open") && value === "</") {
|
|
295
|
-
depth--;
|
|
296
|
-
} else if (is(token, "tag-open") && value === "<" && singletonTags.indexOf(nextToken.value) === -1) {
|
|
297
|
-
depth++;
|
|
298
|
-
} else if (is(token, "tag-name")) {
|
|
299
|
-
tagName = value;
|
|
300
|
-
} else if (is(token, "tag-close") && value === "/>" && singletonTags.indexOf(tagName) === -1){
|
|
301
|
-
depth--;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
row = curRow;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
token = nextToken;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
code = code.trim();
|
|
312
|
-
session.doc.setValue(code);
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
exports.commands = [{
|
|
316
|
-
name: "beautify",
|
|
317
|
-
description: "Format selection (Beautify)",
|
|
318
|
-
exec: function(editor) {
|
|
319
|
-
exports.beautify(editor.session);
|
|
320
|
-
},
|
|
321
|
-
bindKey: "Ctrl-Shift-B"
|
|
322
|
-
}];
|
|
323
|
-
|
|
324
|
-
}); (function() {
|
|
325
|
-
ace.require(["ace/ext/beautify"], function(m) {
|
|
326
|
-
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
327
|
-
module.exports = m;
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
})();
|
|
331
|
-
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var ElasticTabstopsLite = function(editor) {
|
|
5
|
-
this.$editor = editor;
|
|
6
|
-
var self = this;
|
|
7
|
-
var changedRows = [];
|
|
8
|
-
var recordChanges = false;
|
|
9
|
-
this.onAfterExec = function() {
|
|
10
|
-
recordChanges = false;
|
|
11
|
-
self.processRows(changedRows);
|
|
12
|
-
changedRows = [];
|
|
13
|
-
};
|
|
14
|
-
this.onExec = function() {
|
|
15
|
-
recordChanges = true;
|
|
16
|
-
};
|
|
17
|
-
this.onChange = function(delta) {
|
|
18
|
-
if (recordChanges) {
|
|
19
|
-
if (changedRows.indexOf(delta.start.row) == -1)
|
|
20
|
-
changedRows.push(delta.start.row);
|
|
21
|
-
if (delta.end.row != delta.start.row)
|
|
22
|
-
changedRows.push(delta.end.row);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
(function() {
|
|
28
|
-
this.processRows = function(rows) {
|
|
29
|
-
this.$inChange = true;
|
|
30
|
-
var checkedRows = [];
|
|
31
|
-
|
|
32
|
-
for (var r = 0, rowCount = rows.length; r < rowCount; r++) {
|
|
33
|
-
var row = rows[r];
|
|
34
|
-
|
|
35
|
-
if (checkedRows.indexOf(row) > -1)
|
|
36
|
-
continue;
|
|
37
|
-
|
|
38
|
-
var cellWidthObj = this.$findCellWidthsForBlock(row);
|
|
39
|
-
var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths);
|
|
40
|
-
var rowIndex = cellWidthObj.firstRow;
|
|
41
|
-
|
|
42
|
-
for (var w = 0, l = cellWidths.length; w < l; w++) {
|
|
43
|
-
var widths = cellWidths[w];
|
|
44
|
-
checkedRows.push(rowIndex);
|
|
45
|
-
this.$adjustRow(rowIndex, widths);
|
|
46
|
-
rowIndex++;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
this.$inChange = false;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
this.$findCellWidthsForBlock = function(row) {
|
|
53
|
-
var cellWidths = [], widths;
|
|
54
|
-
var rowIter = row;
|
|
55
|
-
while (rowIter >= 0) {
|
|
56
|
-
widths = this.$cellWidthsForRow(rowIter);
|
|
57
|
-
if (widths.length == 0)
|
|
58
|
-
break;
|
|
59
|
-
|
|
60
|
-
cellWidths.unshift(widths);
|
|
61
|
-
rowIter--;
|
|
62
|
-
}
|
|
63
|
-
var firstRow = rowIter + 1;
|
|
64
|
-
rowIter = row;
|
|
65
|
-
var numRows = this.$editor.session.getLength();
|
|
66
|
-
|
|
67
|
-
while (rowIter < numRows - 1) {
|
|
68
|
-
rowIter++;
|
|
69
|
-
|
|
70
|
-
widths = this.$cellWidthsForRow(rowIter);
|
|
71
|
-
if (widths.length == 0)
|
|
72
|
-
break;
|
|
73
|
-
|
|
74
|
-
cellWidths.push(widths);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return { cellWidths: cellWidths, firstRow: firstRow };
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
this.$cellWidthsForRow = function(row) {
|
|
81
|
-
var selectionColumns = this.$selectionColumnsForRow(row);
|
|
82
|
-
|
|
83
|
-
var tabs = [-1].concat(this.$tabsForRow(row));
|
|
84
|
-
var widths = tabs.map(function(el) { return 0; } ).slice(1);
|
|
85
|
-
var line = this.$editor.session.getLine(row);
|
|
86
|
-
|
|
87
|
-
for (var i = 0, len = tabs.length - 1; i < len; i++) {
|
|
88
|
-
var leftEdge = tabs[i]+1;
|
|
89
|
-
var rightEdge = tabs[i+1];
|
|
90
|
-
|
|
91
|
-
var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge);
|
|
92
|
-
var cell = line.substring(leftEdge, rightEdge);
|
|
93
|
-
widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return widths;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
this.$selectionColumnsForRow = function(row) {
|
|
100
|
-
var selections = [], cursor = this.$editor.getCursorPosition();
|
|
101
|
-
if (this.$editor.session.getSelection().isEmpty()) {
|
|
102
|
-
if (row == cursor.row)
|
|
103
|
-
selections.push(cursor.column);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return selections;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
this.$setBlockCellWidthsToMax = function(cellWidths) {
|
|
110
|
-
var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth;
|
|
111
|
-
var columnInfo = this.$izip_longest(cellWidths);
|
|
112
|
-
|
|
113
|
-
for (var c = 0, l = columnInfo.length; c < l; c++) {
|
|
114
|
-
var column = columnInfo[c];
|
|
115
|
-
if (!column.push) {
|
|
116
|
-
console.error(column);
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
column.push(NaN);
|
|
120
|
-
|
|
121
|
-
for (var r = 0, s = column.length; r < s; r++) {
|
|
122
|
-
var width = column[r];
|
|
123
|
-
if (startingNewBlock) {
|
|
124
|
-
blockStartRow = r;
|
|
125
|
-
maxWidth = 0;
|
|
126
|
-
startingNewBlock = false;
|
|
127
|
-
}
|
|
128
|
-
if (isNaN(width)) {
|
|
129
|
-
blockEndRow = r;
|
|
130
|
-
|
|
131
|
-
for (var j = blockStartRow; j < blockEndRow; j++) {
|
|
132
|
-
cellWidths[j][c] = maxWidth;
|
|
133
|
-
}
|
|
134
|
-
startingNewBlock = true;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
maxWidth = Math.max(maxWidth, width);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return cellWidths;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) {
|
|
145
|
-
var rightmost = 0;
|
|
146
|
-
|
|
147
|
-
if (selectionColumns.length) {
|
|
148
|
-
var lengths = [];
|
|
149
|
-
for (var s = 0, length = selectionColumns.length; s < length; s++) {
|
|
150
|
-
if (selectionColumns[s] <= cellRightEdge)
|
|
151
|
-
lengths.push(s);
|
|
152
|
-
else
|
|
153
|
-
lengths.push(0);
|
|
154
|
-
}
|
|
155
|
-
rightmost = Math.max.apply(Math, lengths);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return rightmost;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
this.$tabsForRow = function(row) {
|
|
162
|
-
var rowTabs = [], line = this.$editor.session.getLine(row),
|
|
163
|
-
re = /\t/g, match;
|
|
164
|
-
|
|
165
|
-
while ((match = re.exec(line)) != null) {
|
|
166
|
-
rowTabs.push(match.index);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return rowTabs;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
this.$adjustRow = function(row, widths) {
|
|
173
|
-
var rowTabs = this.$tabsForRow(row);
|
|
174
|
-
|
|
175
|
-
if (rowTabs.length == 0)
|
|
176
|
-
return;
|
|
177
|
-
|
|
178
|
-
var bias = 0, location = -1;
|
|
179
|
-
var expandedSet = this.$izip(widths, rowTabs);
|
|
180
|
-
|
|
181
|
-
for (var i = 0, l = expandedSet.length; i < l; i++) {
|
|
182
|
-
var w = expandedSet[i][0], it = expandedSet[i][1];
|
|
183
|
-
location += 1 + w;
|
|
184
|
-
it += bias;
|
|
185
|
-
var difference = location - it;
|
|
186
|
-
|
|
187
|
-
if (difference == 0)
|
|
188
|
-
continue;
|
|
189
|
-
|
|
190
|
-
var partialLine = this.$editor.session.getLine(row).substr(0, it );
|
|
191
|
-
var strippedPartialLine = partialLine.replace(/\s*$/g, "");
|
|
192
|
-
var ispaces = partialLine.length - strippedPartialLine.length;
|
|
193
|
-
|
|
194
|
-
if (difference > 0) {
|
|
195
|
-
this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t");
|
|
196
|
-
this.$editor.session.getDocument().removeInLine(row, it, it + 1);
|
|
197
|
-
|
|
198
|
-
bias += difference;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (difference < 0 && ispaces >= -difference) {
|
|
202
|
-
this.$editor.session.getDocument().removeInLine(row, it + difference, it);
|
|
203
|
-
bias += difference;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
this.$izip_longest = function(iterables) {
|
|
208
|
-
if (!iterables[0])
|
|
209
|
-
return [];
|
|
210
|
-
var longest = iterables[0].length;
|
|
211
|
-
var iterablesLength = iterables.length;
|
|
212
|
-
|
|
213
|
-
for (var i = 1; i < iterablesLength; i++) {
|
|
214
|
-
var iLength = iterables[i].length;
|
|
215
|
-
if (iLength > longest)
|
|
216
|
-
longest = iLength;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
var expandedSet = [];
|
|
220
|
-
|
|
221
|
-
for (var l = 0; l < longest; l++) {
|
|
222
|
-
var set = [];
|
|
223
|
-
for (var i = 0; i < iterablesLength; i++) {
|
|
224
|
-
if (iterables[i][l] === "")
|
|
225
|
-
set.push(NaN);
|
|
226
|
-
else
|
|
227
|
-
set.push(iterables[i][l]);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
expandedSet.push(set);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return expandedSet;
|
|
235
|
-
};
|
|
236
|
-
this.$izip = function(widths, tabs) {
|
|
237
|
-
var size = widths.length >= tabs.length ? tabs.length : widths.length;
|
|
238
|
-
|
|
239
|
-
var expandedSet = [];
|
|
240
|
-
for (var i = 0; i < size; i++) {
|
|
241
|
-
var set = [ widths[i], tabs[i] ];
|
|
242
|
-
expandedSet.push(set);
|
|
243
|
-
}
|
|
244
|
-
return expandedSet;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
}).call(ElasticTabstopsLite.prototype);
|
|
248
|
-
|
|
249
|
-
exports.ElasticTabstopsLite = ElasticTabstopsLite;
|
|
250
|
-
|
|
251
|
-
var Editor = require("../editor").Editor;
|
|
252
|
-
require("../config").defineOptions(Editor.prototype, "editor", {
|
|
253
|
-
useElasticTabstops: {
|
|
254
|
-
set: function(val) {
|
|
255
|
-
if (val) {
|
|
256
|
-
if (!this.elasticTabstops)
|
|
257
|
-
this.elasticTabstops = new ElasticTabstopsLite(this);
|
|
258
|
-
this.commands.on("afterExec", this.elasticTabstops.onAfterExec);
|
|
259
|
-
this.commands.on("exec", this.elasticTabstops.onExec);
|
|
260
|
-
this.on("change", this.elasticTabstops.onChange);
|
|
261
|
-
} else if (this.elasticTabstops) {
|
|
262
|
-
this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec);
|
|
263
|
-
this.commands.removeListener("exec", this.elasticTabstops.onExec);
|
|
264
|
-
this.removeListener("change", this.elasticTabstops.onChange);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
}); (function() {
|
|
271
|
-
ace.require(["ace/ext/elastic_tabstops_lite"], function(m) {
|
|
272
|
-
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
273
|
-
module.exports = m;
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
})();
|
|
277
|
-
|