Closed murrayju closed 9 years ago
@murrayju Yeah I think this would be a nice addition. I will look into adding it in the next day or two.
+1, I just found out the bug...
@murrayju @PhiLhoSoft Hey folks, I have added support for converting mixed tabs and spaces. The behavior is:
When converting from spaces to tabs, which is the use case with more complications:
To illustrate this... If you have configured Brackets to use 2 spaces per tab, and a line starts with 3 spaces, then 2 spaces will be converted to a single tab and the remaining space will be added at the end of the tab sequence. This is to make sure I don't break jsdocs type of arrangement.
These changes are in the master, so if you could be give it a try and give me any feedback before I publish these changes, that would be very much appreciated.
Alright guys, I am closing this issue. If there is anything to be addressed, please open another issue with details. Thanks!!
Will try it as soon as possible. Felt the need this week, as a colleague using Eclipse (will try to convert them to Brackets! With your extensions!) had a bad setting and was adding tabs after the current indentation... :smile: Solved by de-indenting then re-indenting, but it is nicer if it is done transparently, as you did. Thanks!
@PhiLhoSoft Great. Glad you found a way to get going :)
If a line contains a mixture of tabs and spaces, it will not always correctly sanitize the line. When the file is set to use spaces, only leading tabs will be converted to spaces. If a line begins with spaces, which are then immediately followed by some tab characters, the tabs will not be converted.
I run into this frequently when editing a file using the spaces setting, and using the tab key to add indentation. The editor inserts a tab character instead of spaces (
this is probably a brackets issue reallythis is a bug in Vimdervar). I would like to see this plugin properly sanitize the line in this case.