如何在 eclipse 项目资源管理器中更改已更改文件的背景颜色?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14545978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:53:02  来源:igfitidea点击:

How to change the background color for changed files in eclipse project explorer?

eclipsecolorsegitcolor-scheme

提问by kostja

Changed files under version control are displayed with a dark brown background in the project explorer, making the file names unreadable. I would like to change it.

在版本控制下更改的文件在项目资源管理器中显示为深棕色背景,使文件名不可读。我想改变它。

the brown

棕色的

I have switched between several color themes, but they don't affect the colors in the project explorer. I have not found any useful options neither in the General->Appearance->Colors&Fontsmenu nor in the Team->Gitmenu.

我已经在几个颜色主题之间切换,但它们不会影响项目资源管理器中的颜色。我在General->Appearance->Colors&Fonts菜单和Team->Git菜单中都没有找到任何有用的选项。

The right-click on the colored filename does not offer an option to change color, as it does when used inside the editor.

右键单击彩色文件名不提供更改颜色的选项,就像在编辑器中使用时一样。

I am using eclipse 3.7 SR2 with EGit.

我正在使用 Eclipse 3.7 SR2 和 EGit。

EDIT: I can confirm that it is the git decorator providing the colors - once I switch it off (General->Appearance->Label decorators), the brown color is gone.

编辑:我可以确认它是提供颜色的 git 装饰器 - 一旦我关闭它(General->Appearance->Label 装饰器),棕色就消失了。

回答by E-Riz

The settings you want are under Preferences> General> Appearance> Colors and Fonts, look for the section "Git" in the list and under there, "Uncommitted Change (Background)" and "Uncommitted Change (Foreground)." enter image description here

您想要的设置位于Preferences> General> Appearance> Colors and Fonts 下,在列表中查找“ Git”部分,然后在那里找到“Uncommitted Change (Background)”和“Uncommitted Change (Foreground)”。 在此处输入图片说明

I edited those settings to be a light blue background with white foreground and this is what a changed file looks like in my Project/Package Explorers:

我将这些设置编辑为带有白色前景的浅蓝色背景,这就是我的项目/包资源管理器中更改后的文件的样子:

enter image description here

在此处输入图片说明

回答by adubey

Another similar feature not in project explorer but right inside file is QuickDiff. This is the feature that tells us all the time which line you have changed, added and deleted by always comparing to what's commmited. To enable this do this Window -> Preferences -> Quick Diff -> Enable Quick Diff Window -> Preferences -> Quick Diff -> Use this reference source -> Git Have Revision

另一个不在项目资源管理器中但在文件中的类似功能是 QuickDiff。此功能通过始终与提交的内容进行比较,始终告诉我们您更改、添加和删除了哪一行。要启用此功能,请执行此操作 Window -> Preferences -> Quick Diff -> Enable Quick Diff Window -> Preferences -> Quick Diff -> 使用此参考源 -> Git Have Revision

Change the color you want to indicate what's changed, added and deleted. I use yellow, green and red respectively. Then, at any time, you are in file it'll always be visible which line you have edited and can hover over the line numbers (which will be colored pink, blue or any color you have selected) to see exactly what you've changed vs Git. Here how it looks like in eclipse

更改您想要指示更改、添加和删除内容的颜色。我分别使用黄色、绿色和红色。然后,在任何时候,您都在文件中,它始终可以看到您编辑的哪一行,并且可以将鼠标悬停在行号上(将显示为粉红色、蓝色或您选择的任何颜色)以准确查看您编辑的内容与 Git 相比发生了变化。这是它在 eclipse 中的样子