无法在 Eclipse 中突出显示所有出现的选定单词

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10310597/
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-10 21:00:59  来源:igfitidea点击:

Cannot highlight all occurrences of a selected word in Eclipse

eclipseideeclipse-indigo

提问by Adrian

I tried using the Toggle mark occurrences (Alt + Shift + O)button and also in Preferences -> General -> Editors -> Text Editor -> Annotationsand setting the C/C++ Occurrences and C/C++ Write occurrences. But still when I select a word it won't highlight all occurrences of that specific word.

我尝试使用Toggle mark occurrences (Alt + Shift + O)按钮并Preferences -> General -> Editors -> Text Editor -> Annotations设置 C/C++ Occurrences 和 C/C++ Write 出现次数。但是当我选择一个单词时,它不会突出显示该特定单词的所有出现。

What I am using is Eclipse Indigo Service Release 2 in XP, with a C++ project.

我使用的是 XP 中的 Eclipse Indigo Service Release 2,带有一个 C++ 项目。

回答by Mark

You can try to activate Toggle Mark Occurrences with icon on Toolbar: Eclipse Toolbar

您可以尝试使用工具栏上的图标激活 Toggle Mark Occurrences: 日食工具栏

回答by lwpro2

Preferences --> Java --> Editor --> Mark Occurrences

首选项 --> Java --> 编辑器 --> 标记出现次数

回答by RaiVikrant

In General > Editors > Text Editors > Annotations

General > Editors > Text Editors > Annotations

enter image description here

在此处输入图片说明

回答by Alexis Pautrot

Check out options that are checked in Preferences -> Java -> Editor -> Mark occurrences. Then restart Eclipse.

查看在首选项 -> Java -> 编辑器 -> 标记事件中选中的选项。然后重新启动 Eclipse。

回答by hmijail mourns resignees

The standard "Mark Occurrences" functionality included in Eclipse that everyone recommends only highlights identifiersin editorsof whatever language. For example, it won't highlight intin C editors, and it won't help at all in the Console pane.

每个人都推荐的 Eclipse 中包含的标准“标记出现”功能仅在任何语言的编辑器中突出显示标识符。例如,它不会在 C 编辑器中突出显示,并且在“控制台”窗格中根本没有帮助。int

So if you want to highlight ALL occurrences on ANY word in ANY Eclipse pane (kinda like Notepad++ does), try the Glance plug-in for Eclipse.

因此,如果您想突出显示任何 Eclipse 窗格中任何单词上的所有匹配项(有点像 Notepad++ 那样),请尝试EclipseGlance 插件

As of November 2017 Glance works for Eclipse Neon and Oxygen. There was a period of time in which Neon was unsupported, and a fork appeared, but it seems unnecessary now (and abandoned).

截至 2017 年 11 月,Glance 为 Eclipse Neon 和 Oxygen 工作。有一段时间 Neon 不受支持,出现了一个叉子,但现在似乎没有必要(并被放弃)。

回答by tk_

Find the Preferencesunder Window,

找到PreferencesWindow

main window - tab

主窗口 - 选项卡

In General > Editors > Text Editors > Annotations(1)

General > Editors > Text Editors > Annotations(1)

(5) is to select the color and press apply.

(5) 是选择颜色并按应用。

Preferences window

首选项窗口

回答by mfe

Go

Java> Editor > Mark Occurrences

Java> 编辑器 > 标记出现次数

Uncheck "Keep Marks when the section changes"then click Ok

取消选中“部分更改时保留标记”,然后单击“确定”

Restart Eclipse.

重新启动 Eclipse。

This work for me.

这对我有用。

回答by Affy

For Eclipse Mars:

对于日食火星:

Window --> Preferences --> Check (Mark occurrences of the selected element in the current file.)

窗口 --> 首选项 --> 检查(标记当前文件中所选元素的出现。)

As shown if figure:

如图所示:

enter image description here

在此处输入图片说明

回答by NDEthos

If you go into the window-prefrences, select the language you want/are working with. Select the editor under this specific language and then there is a mark occurrences there that has some options. Where it says keep marks when the selection changes, for me this was checked. When I unchecked it the system started highlighting correctly.

如果您进入窗口首选项,请选择您想要/正在使用的语言。选择此特定语言下的编辑器,然后有一个标记出现,其中有一些选项。在选择更改时保留标记的地方,对我来说已选中。当我取消选中它时,系统开始正确突出显示。

回答by Bryan Kahlig

For folks who are using a dark background with light font colors, you may want to check out the highlight color in Preferences -> General -> Editors -> Text Editor -> Annotations. Mine was defaulted to black, which does not stand out on a black background.

对于使用深色背景和浅色字体的人,您可能需要查看Preferences -> General -> Editors -> Text Editor -> Annotations. 我的默认为黑色,在黑色背景上不会突出。