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

Bug 481819

Summary: [rulers][word wrap] Annotation in overview ruler not on the wrapped line
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: TextAssignee: Andrey Loskutov <loskutov>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: Lars.Vogel, markus.kell.r
Version: 4.6   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=481818
Whiteboard: stalebug
Bug Depends on: 35779    
Bug Blocks:    

Description Dani Megert CLA 2015-11-10 05:11:19 EST
I20151110-0800.

The annotation in the overview ruler is not on the wrapped line.


If we have this:

1 ABC DEF GHI JKL MNO PQR STU VWX YZ
2 ABC DEF GHI JKL MNO PQR STU VWX YZ
3 ABC DEF GHI JKL MNO PQR STU VWX YZ

and add a bookmark (Edit > Add Bookmark...) on VWX on line 2 and then shrink the editor when in word wrap, it will not show the bookmark on the wrapped line where VWX is.
Comment 1 Andrey Loskutov CLA 2015-11-10 05:23:50 EST
Same as bug 481818 comment 1: the bookmarks have no offset information, they always point to the single line, see AddMarkerAction.

So are you requesting an enhancement here?
Comment 2 Dani Megert CLA 2015-11-10 08:59:08 EST
(In reply to Andrey Loskutov from comment #1)
> Same as bug 481818 comment 1: the bookmarks have no offset information, they
> always point to the single line, see AddMarkerAction.
> 
> So are you requesting an enhancement here?

This is the ruler action which adds a line marker. You have to use the steps I provided i.e. use
Edit > Add Bookmark...
Comment 3 Andrey Loskutov CLA 2015-12-01 16:53:58 EST
Dani, while I have a patch and see the problem in bug 481818 for the left (annotation) ruler, I do not really see it for the right one (overview). 

The mapping there calculates the positions over the entire file so as bigger the file is so smaller is the difference in the position of the marker, and the position recalculation for a possible wrapped annotation doesn't make much sense (in most cases it will just calculate same pixels) and only wastes performance (it must be done for all annotations in the file). For small files the overview ruler is meaningless anyway. So I do not see a good use case for the requested change + possible performance issue if we implement it.

Could you provide a use case where we should paint overview annotations on a different coordinates for the content on the wrapped line?
Comment 4 Dani Megert CLA 2015-12-08 13:20:22 EST
(In reply to Andrey Loskutov from comment #3)
> Could you provide a use case where we should paint overview annotations on a
> different coordinates for the content on the wrapped line?

On the initial steps from comment 0 also add a bookmark on ABC on line 3. When you horizontally shrink the editor you can see that the bookmark stays at line 3 while the one of the wrapped VWX is not aligned to VWX.
Comment 5 Andrey Loskutov CLA 2015-12-08 13:22:35 EST
(In reply to Dani Megert from comment #4)
> (In reply to Andrey Loskutov from comment #3)
> > Could you provide a use case where we should paint overview annotations on a
> > different coordinates for the content on the wrapped line?
> 
> On the initial steps from comment 0 also add a bookmark on ABC on line 3.
> When you horizontally shrink the editor you can see that the bookmark stays
> at line 3 while the one of the wrapped VWX is not aligned to VWX.

But once we have more than 10 lines we probably will not notice anything yet still we would need to recompute every position.
Comment 6 Eclipse Genie CLA 2019-09-07 17:24:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.