问题
i'm using an Eclipse based editor (Flash Builder) to write my code. i want to use GitHub as a remote repository but there are formatting conflicts caused by the tab indents.
for example, in Flash Builder, i have written this:
case Boolean: bytes.writeBoolean(value); break;
case int: bytes.writeInt(value); break;
case uint: bytes.writeUnsignedInt(value); break;
case Number: bytes.writeDouble(value); break;
case ByteArray: bytes.writeBytes(value); break;
default: bytes.writeUTFBytes(value);
but when that is sent to GitHub (or a plain text file), it is displayed something like this:
case Boolean: bytes.writeBoolean(value); break;
case int: bytes.writeInt(value); break;
case uint: bytes.writeUnsignedInt(value); break;
case Number: bytes.writeDouble(value); break;
case ByteArray: bytes.writeBytes(value); break;
default: bytes.writeUTFBytes(value);
if i pull the repository from GitHub and open the files in the code editor, the format is still correct so it doesn't seem to change the format, rather it's displaying it incorrectly.
is this something that's possible to fix?
回答1:
Sounds like you are using tabs as delimiter and different editors have different tab spaces. That is why I always use (4) spaces instead of tabs. You can configure Eclipse to always use spaces by checking:
Window->Preferences->General->Editors->Text Editors->Insert spaces for tabs
来源:https://stackoverflow.com/questions/6726358/eclipse-github-text-format-tab-indent-problem