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

Bug 342898

Summary: Outline View does not fill backward history
Product: [Tools] CDT Reporter: Axel Mueller <aegges>
Component: cdt-editorAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: enhancement    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
When an element is selected in Outline View fill Backward History
aleherb+eclipse: iplog-
Fill backward history when Quick outline is used
aleherb+eclipse: iplog-
Committed fix aleherb+eclipse: iplog-

Description Axel Mueller CLA 2011-04-14 17:08:24 EDT
Build Identifier: Eclipse 3.7.0, CDT 8.0

When any element is selected in the Outline View and Link with editor is enabled the cursor in the editor will jump to the selected element. Unfortunately, this event is not send to the Backward History (Alt+Left arrow).

Reproducible: Always

Steps to Reproduce:
1. Open Outline View
2. Enable Link with Editor
3. Select element X in the Outline View
4. Select another element in the Outline View
5. click Backward History in main toolbar or press Alt+Left arrow
=> you would expect to get back to element X
Comment 1 Axel Mueller CLA 2011-04-14 17:10:07 EDT
Created attachment 193300 [details]
When an element is selected in Outline View fill Backward History
Comment 2 Axel Mueller CLA 2011-04-14 17:33:23 EDT
Created attachment 193305 [details]
Fill backward history when Quick outline is used
Comment 3 Anton Leherbauer CLA 2011-04-15 03:45:07 EDT
Created attachment 193328 [details]
Committed fix

Good point and thanks for the patches.
However, I have taken a different approach.  The central method for triggering selection changes is CEditor.setSelection(ISourceRange, boolean), therefore I fixed that method to mark the new selection in the navigation history.  This is also in alignment with the Java editor.
The patch fixes the same issue for the Makefile and Assembly editors as well.
Comment 4 Anton Leherbauer CLA 2011-04-15 03:46:42 EDT
Fixed in HEAD.
Comment 6 Axel Mueller CLA 2011-04-15 05:10:42 EDT
(In reply to comment #3)
> Good point and thanks for the patches.
> However, I have taken a different approach.  The central method for triggering
> selection changes is CEditor.setSelection(ISourceRange, boolean)
You're right. I started first fixing only the Outline View and then Quickline Outline. Later (after submitting the patches) I realized that it could be fixed at one place in CEditor. 
Thanks for your quick reply and fix.