Unwanted extra tab after if statement in JavaScript files with auto indent #249
-
Hi. I am using Pulsar 1.113.0 on Ubuntu 20.04. I have auto indent enabled. The expected auto indent behavior is as follows:
But in JS files, the editor adds an extra tab before the curly brace:
It seems to only affect some blocks I tried ( It could be an issue with the
How do I fix this? Thanks. UPDATE: the new settings in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
You are a victim of an opinionated choice I made. I was trying to catch cases where people would write if (isDisabled)
return false; but it doesn't envision your style of indentation. I'll fix this by moving it into a configuration option in Can you give me examples of the issues you encountered with |
Beta Was this translation helpful? Give feedback.
It's not that easy because the older indentation behavior relies on a system that we're trying to move away from. In TextMate-style grammars, all indentation is controlled by unwieldy regular expressions, and it was a design goal of this new system to move to something more intuitive for grammar authors. The old system still exists, but the infrastructure isn't there (yet) to do the old indentation system on the new grammars.
I have an eventual goal to make indentation truly pluggable, but in the meantime, here are your options: