You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have format on save enabled, and it's configured to only format modifications (I'm working on a codebase with some non-standard indentation). When I edit the middle of a list of indented arguments, the indentation is removed when I save. A good example of this is require statements:
You can see the modified line indicator at the left hand side. When I save the indentation is removed, and hitting tab indents the forms correctly.
I'm guessing that the format on save is only formatting what it's given, while the format on tab is able to consider the enclosing form and that's why it indents correctly. Is there anything that can be done about it?
The text was updated successfully, but these errors were encountered:
I had no idea that this setting existed! Thanks for the heads-up.
You are guessing correctly about format on tab (a.k.a. Format current form). And I am guessing that you are guessing correctly about format-on-save-but-only-modifications. But I also assume we should get some info about the location of those changes, and from that we should be able to use the underlying implementation of Format current form to that location. I am also guessing that the setting also should handle that the file can be modified in several places.... So linking these because a bit related:
I have format on save enabled, and it's configured to only format modifications (I'm working on a codebase with some non-standard indentation). When I edit the middle of a list of indented arguments, the indentation is removed when I save. A good example of this is require statements:
You can see the modified line indicator at the left hand side. When I save the indentation is removed, and hitting tab indents the forms correctly.
I'm guessing that the format on save is only formatting what it's given, while the format on tab is able to consider the enclosing form and that's why it indents correctly. Is there anything that can be done about it?
The text was updated successfully, but these errors were encountered: