easy-code-formatter-styles icon indicating copy to clipboard operation
easy-code-formatter-styles copied to clipboard

Automatic Tab

Open ilGobbo00 opened this issue 5 years ago • 3 comments

Hi, first of all thaks for what you have done, I really like it. My request is: is it possible to add a kind of automated indentation when I format some text with your tool? It would be great.

Have a nice day, regards :)

ilGobbo00 avatar Jan 24 '21 14:01 ilGobbo00

Hey @ilGobbo00 - can you give me a bit more details on this? What do you mean automated indentation? Are you formatting something like a json snippet?

armhil avatar Apr 24 '21 19:04 armhil

Sure! I mean, when I format some text, for example, if I write

void main(){ int a=0 if(a==0){ print("HelloWorld") } }

and I use your toll, I'd like to expect

void main(){
         int a=0
         if(a==0){
              print("HelloWorld")
         }
}

I don't remember what language I was using when I found this "issue", but maybe some common syntaxes could be recognised as tab needed

ilGobbo00 avatar Apr 24 '21 20:04 ilGobbo00

Oh I see now. Can you help me understand how often you encounter this issue? The reason why I'm asking is, this requires introducing something like a smart-tabbing (detect if the code is tabbed already / or perhaps re-tab it ignoring the existing tabs). I'd also need to consider that not everyone uses the same amount of tabbing, so adding an option of how many spaces do you want your tabs to be would be also needed.

There are quite a few people using the tool now, I'd rather see if we get any upvotes to this.

armhil avatar Apr 24 '21 22:04 armhil