-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert indentation from 2 to 4 spaces #1
Comments
For what I understand, your method should solve the problem. Can you give a specific example? If your original code is indented with 2 spaces, that should mean your inline alignments are also based on spaces. When you convert indentation using Sublime Text's status bar menu, it would modify only leading spaces, not initial spaces that you put for alignment. Then modify indentation level and convert to space from tab using the same Sublime menu should give you expected result. If you post an example here which doesn't work, I can look into it. |
Something like that would break when converting from 4 to 2 spaces: def main():
foo = settings.get("foo",
None) You would end up with: def main():
foo = settings.get("foo",
None) |
OK, that example would only break in a stylistic way, not functional. There are other cases that would break functionally. I can find one if you want but I think you get the idea. |
Hmm, I see. That's irregular spacing and would require significant work to detect and preserve them (and I feel that still it wouldn't be 100% perfect). Actually I consider it in the scope of this plugin, because it would happen for tab-to-space, as well. But I personally don't use that sort of styling and unfortunately I'm not willing to work on it at the moment. But let's keep the issue open for further discussion; maybe someone in the future wants to grab it and give it a try. |
Sometimes I have code using 2 spaces for indentation that I want to convert to 4 spaces.
What I do is convert to tabs first, convert to tab-width 4 and convert back to spaces.
The problem with that is it changes alignment and can break the code with indentation-sensitive languages (python).
Would such functionality be in the scope of this package? Judging from the name maybe not as it deals with converting from "tabs" :)
The text was updated successfully, but these errors were encountered: