Eclipse,GitHub-文本格式/制表符缩进问题 [英] Eclipse, GitHub - Text Format / Tab Indent Problem

查看:58
本文介绍了Eclipse,GitHub-文本格式/制表符缩进问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基于Eclipse的编辑器(Flash Builder)来编写我的代码.我想将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.

例如,在Flash Builder中,我已编写了以下代码:

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);

但是当将其发送到GitHub(或纯文本文件)时,将显示以下内容:

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);

如果我从GitHub提取存储库并在代码编辑器中打开文件,则格式仍然正确,因此它似乎并没有改变格式,而是显示不正确.

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.

这可以解决吗?

推荐答案

听起来像您使用制表符作为分隔符,并且不同的编辑器具有不同的制表符空间.这就是为什么我总是使用(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:

Window->Preferences->General->Editors->Text Editors->Insert spaces for tabs

这篇关于Eclipse,GitHub-文本格式/制表符缩进问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆