Bug 41564 - [Edit] Compare editor diffs not refreshed on edit or save
Summary: [Edit] Compare editor diffs not refreshed on edit or save
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 45104 49827 52237 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-14 11:56 EDT by Michael Valenta CLA
Modified: 2006-10-31 11:00 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2003-08-14 11:56:30 EDT
If I have a compare editor open and I type in the left pane outside of a diff
area and then save, the newly entered text is not highlighted as a diff. The new
text should be highlighted as a diff when I save (i.e. saving should refresh the
differences).

I am using build I20030813 on gtk but the problem also occurs on Windows
Comment 1 Andre Weinand CLA 2003-08-14 12:33:03 EDT
Works as designed.
Compare editors don't reconcile (because diffing can be quite expensive).
Comment 2 Michael Valenta CLA 2003-08-14 13:32:47 EDT
Is there a way to trigger a refresh of the compare editor so the proper diffs
are computed. Also, it would be helpfull if there was some indication that the
diffs being displayed were invalid.
Comment 3 Dan Berindei CLA 2004-02-21 19:26:41 EST
At the very least there should be a button to allow re-diffing whithout
closing/reopening the compare editor (which I believe retrieves the repository
version again). What I would really love is something a la error markers in the
Java editor, which grey out when the respective lines change and dissappear
completely on save.

I don't believe the diffing is very expensive when compared to other things that
happen on file save, such as building the workspace or refreshing the
synchronize view.
Comment 4 Jason Yip CLA 2004-02-22 03:11:04 EST
*** Bug 49827 has been marked as a duplicate of this bug. ***
Comment 5 Andre Weinand CLA 2004-02-22 05:39:48 EST
*** Bug 45104 has been marked as a duplicate of this bug. ***
Comment 6 Andre Weinand CLA 2004-02-22 05:40:54 EST
*** Bug 52237 has been marked as a duplicate of this bug. ***
Comment 7 Dan Berindei CLA 2004-04-24 09:56:57 EDT
I have noticed that in 3.0M8 the diff is recalculated on file save. It works
very nice, but I have one problem with it: the first difference is always
selected as a result of the re-diff.

This is quite annoying when the compared files have many differences and only a
small part of them are to be merged. Plus, it feels very "un-editor like".
Comment 8 Andre Weinand CLA 2005-06-23 18:28:02 EDT
removed bogus tag.
Comment 9 Nikolay Metchev CLA 2005-07-20 08:54:39 EDT
perhaps it should be clarified that the the diff only works if the change is
made through the compare editor. If you change the file through some other means
the change is not detected. Can I request that the fix for this bug is to detect
changes even outside the diff editor.
Comment 10 Michael Valenta CLA 2006-09-12 12:10:48 EDT
The request in comment 9 is being addressed by bug 114 and the changes for this are in he latest 3.3 integration build. This bug is requesting that changes made to the editable content, whether made in the compare editor or in a separate editor (which is now possible due to the fix for bug 114), should be reflected in the change markup. As pointed out, this calculation is expensive so we will need to investigate ways of doing this is a non-blocking fashion. It is also useful to note that the structure view doesn't update either as described in bug 51234.
Comment 11 Michael Valenta CLA 2006-10-16 10:49:11 EDT
The fix for bug 39425 allows the compare editor input to be refreshed on save (although subclasses of ComapreEditorInput need to detect the change and refresh the editor input). The items left to be addressed by this bug are:

1) Ensure that viewer position is not reset

2) Update diffs in response to editing without a save.
Comment 12 Michael Valenta CLA 2006-10-16 11:30:49 EDT
Another issue:

3) Structure Diff listens to content change but doesn;t listen for file buffer saves. This is not a problem when the compare editor input performs a refresh on save but will be a regression if the editor input doesn't refresh.
Comment 13 Michael Valenta CLA 2006-10-20 11:05:59 EDT
Last fix released to HEAD. We got everything except the update in response to changes that have not been saved. To get auto-reconciling working for unsaved changes would be difficult given the shape of the compare framework, so I am deferring that.
Comment 14 Bogdan Gheorghe CLA 2006-10-31 11:00:41 EST
Verified in  I20061031-0656