ACE editor to display spaces

I use the ACE editor in HTML, where I developed a custom syntax highlighting mode on my site, believing that everything seems fine with syntax recognition and highlighting, I can’t find a way to show spaces, like in sublime text.

When searching, I want us to be able to use

getNextLineIndent(state, line, tab) { }

as a counter to check for events on each new line.

Besides this solution, is there a default option or just?

+3
source share
3 answers

Finally, it turned out!

White spaces can be displayed (as in sublime text) using the following steps:

  • Open ace.js
  • Word Search Invisibles
  • on line 14499, replace with the following code

     this.showInvisibles = true;
     this.setShowInvisibles = function(showInvisibles) 
     {
          if (this.showInvisibles == showInvisibles)
          return true;
          this.showInvisibles = showInvisibles;
          this.$computeTabString();
          return true;
    };
    
  • , .
  • .
-4

editor.setOption( "showInvisibles", true)

+11

editor.setShowInvisibles(true);

+5
source

All Articles