snippets
4 years ago
ace.js
4 years ago
ext-beautify.js
4 years ago
ext-code_lens.js
4 years ago
ext-elastic_tabstops_lite.js
4 years ago
ext-emmet.js
4 years ago
ext-error_marker.js
4 years ago
ext-hardwrap.js
4 years ago
ext-keybinding_menu.js
4 years ago
ext-language_tools.js
4 years ago
ext-linking.js
4 years ago
ext-modelist.js
4 years ago
ext-options.js
4 years ago
ext-prompt.js
4 years ago
ext-rtl.js
4 years ago
ext-searchbox.js
4 years ago
ext-settings_menu.js
4 years ago
ext-spellcheck.js
4 years ago
ext-split.js
4 years ago
ext-static_highlight.js
4 years ago
ext-statusbar.js
4 years ago
ext-textarea.js
4 years ago
ext-themelist.js
4 years ago
ext-whitespace.js
4 years ago
keybinding-emacs.js
4 years ago
keybinding-sublime.js
4 years ago
keybinding-vim.js
4 years ago
keybinding-vscode.js
4 years ago
mode-abap.js
4 years ago
mode-abc.js
4 years ago
mode-actionscript.js
4 years ago
mode-ada.js
4 years ago
mode-alda.js
4 years ago
mode-apache_conf.js
4 years ago
mode-apex.js
4 years ago
mode-applescript.js
4 years ago
mode-aql.js
4 years ago
mode-asciidoc.js
4 years ago
mode-asl.js
4 years ago
mode-assembly_x86.js
4 years ago
mode-autohotkey.js
4 years ago
mode-batchfile.js
4 years ago
mode-c9search.js
4 years ago
mode-c_cpp.js
4 years ago
mode-cirru.js
4 years ago
mode-clojure.js
4 years ago
mode-cobol.js
4 years ago
mode-coffee.js
4 years ago
mode-coldfusion.js
4 years ago
mode-crystal.js
4 years ago
mode-csharp.js
4 years ago
mode-csound_document.js
4 years ago
mode-csound_orchestra.js
4 years ago
mode-csound_score.js
4 years ago
mode-csp.js
4 years ago
mode-css.js
4 years ago
mode-curly.js
4 years ago
mode-d.js
4 years ago
mode-dart.js
4 years ago
mode-diff.js
4 years ago
mode-django.js
4 years ago
mode-dockerfile.js
4 years ago
mode-dot.js
4 years ago
mode-drools.js
4 years ago
mode-edifact.js
4 years ago
mode-eiffel.js
4 years ago
mode-ejs.js
4 years ago
mode-elixir.js
4 years ago
mode-elm.js
4 years ago
mode-erlang.js
4 years ago
mode-forth.js
4 years ago
mode-fortran.js
4 years ago
mode-fsharp.js
4 years ago
mode-fsl.js
4 years ago
mode-ftl.js
4 years ago
mode-gcode.js
4 years ago
mode-gherkin.js
4 years ago
mode-gitignore.js
4 years ago
mode-glsl.js
4 years ago
mode-gobstones.js
4 years ago
mode-golang.js
4 years ago
mode-graphqlschema.js
4 years ago
mode-groovy.js
4 years ago
mode-haml.js
4 years ago
mode-handlebars.js
4 years ago
mode-haskell.js
4 years ago
mode-haskell_cabal.js
4 years ago
mode-haxe.js
4 years ago
mode-hjson.js
4 years ago
mode-html.js
4 years ago
mode-html_elixir.js
4 years ago
mode-html_ruby.js
4 years ago
mode-ini.js
4 years ago
mode-io.js
4 years ago
mode-ion.js
4 years ago
mode-jack.js
4 years ago
mode-jade.js
4 years ago
mode-java.js
4 years ago
mode-javascript.js
4 years ago
mode-json.js
4 years ago
mode-json5.js
4 years ago
mode-jsoniq.js
4 years ago
mode-jsp.js
4 years ago
mode-jssm.js
4 years ago
mode-jsx.js
4 years ago
mode-julia.js
4 years ago
mode-kotlin.js
4 years ago
mode-latex.js
4 years ago
mode-latte.js
4 years ago
mode-less.js
4 years ago
mode-liquid.js
4 years ago
mode-lisp.js
4 years ago
mode-livescript.js
4 years ago
mode-logiql.js
4 years ago
mode-logtalk.js
4 years ago
mode-lsl.js
4 years ago
mode-lua.js
4 years ago
mode-luapage.js
4 years ago
mode-lucene.js
4 years ago
mode-makefile.js
4 years ago
mode-markdown.js
4 years ago
mode-mask.js
4 years ago
mode-matlab.js
4 years ago
mode-maze.js
4 years ago
mode-mediawiki.js
4 years ago
mode-mel.js
4 years ago
mode-mips.js
4 years ago
mode-mixal.js
4 years ago
mode-mushcode.js
4 years ago
mode-mysql.js
4 years ago
mode-nginx.js
4 years ago
mode-nim.js
4 years ago
mode-nix.js
4 years ago
mode-nsis.js
4 years ago
mode-nunjucks.js
4 years ago
mode-objectivec.js
4 years ago
mode-ocaml.js
4 years ago
mode-partiql.js
4 years ago
mode-pascal.js
4 years ago
mode-perl.js
4 years ago
mode-pgsql.js
4 years ago
mode-php.js
4 years ago
mode-php_laravel_blade.js
4 years ago
mode-pig.js
4 years ago
mode-plain_text.js
4 years ago
mode-powershell.js
4 years ago
mode-praat.js
4 years ago
mode-prisma.js
4 years ago
mode-prolog.js
4 years ago
mode-properties.js
4 years ago
mode-protobuf.js
4 years ago
mode-puppet.js
4 years ago
mode-python.js
4 years ago
mode-qml.js
4 years ago
mode-r.js
4 years ago
mode-raku.js
4 years ago
mode-razor.js
4 years ago
mode-rdoc.js
4 years ago
mode-red.js
4 years ago
mode-redshift.js
4 years ago
mode-rhtml.js
4 years ago
mode-robot.js
4 years ago
mode-rst.js
4 years ago
mode-ruby.js
4 years ago
mode-rust.js
4 years ago
mode-sac.js
4 years ago
mode-sass.js
4 years ago
mode-scad.js
4 years ago
mode-scala.js
4 years ago
mode-scheme.js
4 years ago
mode-scrypt.js
4 years ago
mode-scss.js
4 years ago
mode-sh.js
4 years ago
mode-sjs.js
4 years ago
mode-slim.js
4 years ago
mode-smarty.js
4 years ago
mode-smithy.js
4 years ago
mode-snippets.js
4 years ago
mode-soy_template.js
4 years ago
mode-space.js
4 years ago
mode-sparql.js
4 years ago
mode-sql.js
4 years ago
mode-sqlserver.js
4 years ago
mode-stylus.js
4 years ago
mode-svg.js
4 years ago
mode-swift.js
4 years ago
mode-tcl.js
4 years ago
mode-terraform.js
4 years ago
mode-tex.js
4 years ago
mode-text.js
4 years ago
mode-textile.js
4 years ago
mode-toml.js
4 years ago
mode-tsx.js
4 years ago
mode-turtle.js
4 years ago
mode-twig.js
4 years ago
mode-typescript.js
4 years ago
mode-vala.js
4 years ago
mode-vbscript.js
4 years ago
mode-velocity.js
4 years ago
mode-verilog.js
4 years ago
mode-vhdl.js
4 years ago
mode-visualforce.js
4 years ago
mode-wollok.js
4 years ago
mode-xml.js
4 years ago
mode-xquery.js
4 years ago
mode-yaml.js
4 years ago
mode-zeek.js
4 years ago
theme-ambiance.js
4 years ago
theme-chaos.js
4 years ago
theme-chrome.js
4 years ago
theme-cloud9_day.js
4 years ago
theme-cloud9_night.js
4 years ago
theme-cloud9_night_low_color.js
4 years ago
theme-clouds.js
4 years ago
theme-clouds_midnight.js
4 years ago
theme-cobalt.js
4 years ago
theme-crimson_editor.js
4 years ago
theme-dawn.js
4 years ago
theme-dracula.js
4 years ago
theme-dreamweaver.js
4 years ago
theme-eclipse.js
4 years ago
theme-github.js
4 years ago
theme-gob.js
4 years ago
theme-gruvbox.js
4 years ago
theme-gruvbox_dark_hard.js
4 years ago
theme-gruvbox_light_hard.js
4 years ago
theme-idle_fingers.js
4 years ago
theme-iplastic.js
4 years ago
theme-katzenmilch.js
4 years ago
theme-kr_theme.js
4 years ago
theme-kuroir.js
4 years ago
theme-merbivore.js
4 years ago
theme-merbivore_soft.js
4 years ago
theme-mono_industrial.js
4 years ago
theme-monokai.js
4 years ago
theme-nord_dark.js
4 years ago
theme-one_dark.js
4 years ago
theme-pastel_on_dark.js
4 years ago
theme-solarized_dark.js
4 years ago
theme-solarized_light.js
4 years ago
theme-sqlserver.js
4 years ago
theme-terminal.js
4 years ago
theme-textmate.js
4 years ago
theme-tomorrow.js
4 years ago
theme-tomorrow_night.js
4 years ago
theme-tomorrow_night_blue.js
4 years ago
theme-tomorrow_night_bright.js
4 years ago
theme-tomorrow_night_eighties.js
4 years ago
theme-twilight.js
4 years ago
theme-vibrant_ink.js
4 years ago
theme-xcode.js
4 years ago
worker-base.js
4 years ago
worker-coffee.js
4 years ago
worker-css.js
4 years ago
worker-html.js
4 years ago
worker-javascript.js
4 years ago
worker-json.js
4 years ago
worker-lua.js
4 years ago
worker-php.js
4 years ago
worker-xml.js
4 years ago
worker-xquery.js
4 years ago
worker-yaml.js
4 years ago
ext-elastic_tabstops_lite.js
8 lines
| 1 | ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}); (function() { |
| 2 | ace.require(["ace/ext/elastic_tabstops_lite"], function(m) { |
| 3 | if (typeof module == "object" && typeof exports == "object" && module) { |
| 4 | module.exports = m; |
| 5 | } |
| 6 | }); |
| 7 | })(); |
| 8 |