Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362499

Summary: C/C++ Mark Occurrences is difficult to turn off
Product: [Tools] CDT Reporter: Beth Tibbitts <beth>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: RESOLVED WORKSFORME QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Beth Tibbitts CLA 2011-10-31 11:05:11 EDT
Mark Occurrences formerly had a button in the toolbar (looks like a yellow highlighter) to toggle it on/off.
In fact the helps says it still does. 
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_toolbar.htm
But it's been missing for a while.

This can be annoying to figure out how to turn off if you don't know.
Because just double-clicking on a variable in the editor turns it on.
I used to turn it off with 
Alt-shift-O   but on my Mac this *also* adds an 'o' character in the file being edited.
But it does turn it off.

Upon further investigation (like reading the hover help on the button in the Plug-in Dev Perspective, where it still resides) maybe I'm supposed to do Alt-Cmd-O (aka Option-Cmd-O on Mac)
and this does toggle it without inserting a character.

I always like to show this in tutorials and I'm about to do another one.
How *should* the user be turning it off - does something work consistently in all platforms?
Can we put the button back into the C/C++ perspective?
Comment 1 Anton Leherbauer CLA 2011-11-02 06:28:47 EDT
(In reply to comment #0)
> Mark Occurrences formerly had a button in the toolbar (looks like a yellow
> highlighter) to toggle it on/off.
> But it's been missing for a while.

This works for me.
Note that the button appears and enables only when a C/C++ Editor has the focus.
We haven't changed that behavior for a very long time and it is exactly the same as JDT's.

> I used to turn it off with 
> Alt-shift-O   but on my Mac this *also* adds an 'o' character in the file being
> edited.
> But it does turn it off.
> Upon further investigation (like reading the hover help on the button in the
> Plug-in Dev Perspective, where it still resides) maybe I'm supposed to do
> Alt-Cmd-O (aka Option-Cmd-O on Mac)
> and this does toggle it without inserting a character.

Since bug 298696 we have aligned key bindings with those of JDT, ie. on carbon you need to press Option+Command+O to toggle mark occurrences.

> I always like to show this in tutorials and I'm about to do another one.
> How *should* the user be turning it off - does something work consistently in
> all platforms?
> Can we put the button back into the C/C++ perspective?

Are you maybe using some C/C++ Editor derivative?
Comment 2 Beth Tibbitts CLA 2011-11-02 07:52:11 EDT
Aha! you are exactly right. This is the Remote C/C++ Editor because RDT is installed.
I can't believe I never thought of that

Thanks; need to see how to get it fixed in the remote editor
Comment 3 Anton Leherbauer CLA 2011-11-02 08:50:43 EDT
(In reply to comment #2)
> Thanks; need to see how to get it fixed in the remote editor

Just add an actionSetPartAssociation extension for the RDT editor:

      <actionSetPartAssociation
            targetID="org.eclipse.cdt.ui.text.c.actionSet.presentation">
         <part id="insert-rdt-editor-id-here"/>
      </actionSetPartAssociation>