Bug 579892 - Mark occurrences doesn't work with CEditor embedded in a multi page editor
Summary: Mark occurrences doesn't work with CEditor embedded in a multi page editor
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 10.6.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 10.8.0   Edit
Assignee: Dominic Scharfe CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-10 11:54 EDT by Dominic Scharfe CLA
Modified: 2022-05-30 18:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Scharfe CLA 2022-05-10 11:54:06 EDT
When selecting text in a CEditor, if enabled, the occurrences of the selected text will be marked in the editor. This doesn't work if the CEditor is embedded in a MultiPageEditorPart.

I will contribute a patch to fix this issue. 
As suggested by Jonah in bug 579758, comment 4 I will provide a simple example editor for manual testing.
Comment 1 Jonah Graham CLA 2022-05-10 11:57:49 EDT
Excellent, thanks Dominic, I look forward to reviewing/testing the patch.
Comment 2 Eclipse Genie CLA 2022-05-10 12:10:38 EDT
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/193272
Comment 3 Dominic Scharfe CLA 2022-05-10 12:16:05 EDT
What I wasn't able to fix is the toggle mark occurrences button in the toolbar. When opening a CEditor the button is visible, but not for the multi page editor.

This is because the eclipse ui framework uses the EditorSite to get the id against which the action sets are matched. The workaround is to activate the "Editor Presentation" action set in the perspective.
Comment 4 Jonah Graham CLA 2022-05-10 14:56:42 EDT
(In reply to Dominic Scharfe from comment #3)
> What I wasn't able to fix is the toggle mark occurrences button in the
> toolbar. When opening a CEditor the button is visible, but not for the multi
> page editor.

I can see that too when I try your patch.

> This is because the eclipse ui framework uses the EditorSite to get the id
> against which the action sets are matched. The workaround is to activate the
> "Editor Presentation" action set in the perspective.

Even if I manually enable the Editor Presentation action set the toggle button disappears from toolbar when I open the multipage editor.
Comment 5 Dominic Scharfe CLA 2022-05-11 02:21:07 EDT
(In reply to Jonah Graham from comment #4)
> > This is because the eclipse ui framework uses the EditorSite to get the id
> > against which the action sets are matched. The workaround is to activate the
> > "Editor Presentation" action set in the perspective.
> 
> Even if I manually enable the Editor Presentation action set the toggle
> button disappears from toolbar when I open the multipage editor.
Sorry, I wrote "Editor Presentation" but meant "C/C++ Editor Presentation".
By checking "Customize Perspective -> Action Set Availability -> C/C++ Editor Presentation", the button should always be visible in the perspective.
Comment 6 Jonah Graham CLA 2022-05-30 18:23:07 EDT
Hi Dominic, I have moved this to the next release. If you are able to revisit in the next few days we can still consider it for 10.7 and I can change the target milestone back.