Bug 211720 - Compare editor doesn't show infos correctly for some diffs
Summary: Compare editor doesn't show infos correctly for some diffs
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-12-03 03:40 EST by Manja Nelius CLA
Modified: 2007-12-12 08:26 EST (History)
1 user (show)

See Also:


Attachments
screen shot: diff infos ok vs not ok (247.18 KB, image/jpeg)
2007-12-03 03:40 EST, Manja Nelius CLA
no flags Details
Patch (795 bytes, patch)
2007-12-03 06:18 EST, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manja Nelius CLA 2007-12-03 03:40:35 EST
Created attachment 84294 [details]
screen shot: diff infos ok vs not ok

attachment upper part:
the shown infos are ok for the selected diff and the cursor position

attachment lower part:
the infos for the selected diff at the END of the file and the cursor position at the END of the line are NOT shown correctly

fix - see line 1242 in TextMergeViewer, method overlaps:

   1237   boolean overlaps(MergeSourceViewer w, int start, int end) {
   1238        Position h= getPosition(w);
   1239        if (h != null) {
   1240           int ds= h.getOffset();
   1241           int de= ds + h.getLength();
   1242           if ((start < de) && (end >= ds))
     --> must be: if ((start <= de) && (end >= ds))
   1243              return true;	
   1244        }
   1245        return false;
   1246   }
Comment 1 Tomasz Zarna CLA 2007-12-03 06:18:40 EST
Created attachment 84302 [details]
Patch

Manja's patch in its proper place.
Comment 2 Tomasz Zarna CLA 2007-12-03 07:30:51 EST
Since the issue doesn't affect stability of M-builds, the patch has been released to HEAD stream only.
Comment 3 Tomasz Zarna CLA 2007-12-12 08:26:07 EST
Verified in I20071210-0930, but logged bug 212738.