Eclipse,GitHub - 文本格式/制表符缩进问题
我正在使用基于 Eclipse 的编辑器 (Flash Builder) 来编写我的代码。我想使用 GitHub 作为远程存储库,但存在由制表符缩进引起的格式冲突。
例如,在 Flash Builder 中,我编写了以下内容:
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);
但是当将其发送到 GitHub(或纯文本文件)时,它会显示如下内容:
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);
如果我从 GitHub 提取存储库并在代码编辑器中打开文件,格式仍然正确,因此它似乎没有更改格式,而是显示不正确。
这是可以修复的吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您正在使用制表符作为分隔符,并且不同的编辑器具有不同的制表符空间。这就是为什么我总是使用 (4) 个空格而不是制表符。您可以通过检查以下内容将 Eclipse 配置为始终使用空格:
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: