Bug (?) when comparing clipboard entries

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
Marco Nef
Junior Member
Posts: 14
Joined: Sat May 15, 2004 4:55 pm
Location: Zürich, Switzerland
Contact:

Bug (?) when comparing clipboard entries

Post by Marco Nef »

[Version 3.3, Build 20.01.2005 19:57:57]

When comparing two clipboard entries, in my opinion, I should have to press the corresponding button in the compare dialog after "File 1" for the first entry, copy the second entry to the clipboard afterwards and finally press the button after "File 2". After pressing "Compare" those two clipboard entries (one of which isn't on the clipboard anymore) should be compared.

What happens is that ExamDiffPro compares the second entry with itself, which I think is wrong.
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

This is by design. We didn't want to make EDPro depend on timing of your Clipboard selections. The fetching form the Clipboard is done at the point of pressing Compare button; as a result, only one (the last) Clipboard content is used. Doing it the other way would also create problems when files/buffers are re-compared: by then the first Clipboard selection will be gone.

BTW, this feature was created to compare a file against the Clipboard. Ability to compare 2 (identical) Clipboard fragments is a side effect.
psguru
PrestoSoft
Marco Nef
Junior Member
Posts: 14
Joined: Sat May 15, 2004 4:55 pm
Location: Zürich, Switzerland
Contact:

Post by Marco Nef »

psguru wrote:... Doing it the other way would also create problems when files/buffers are re-compared: by then the first Clipboard selection will be gone.
There seems to be an inconsistency:
  • Compare two clipboards, which actually means the same one. So there is no difference
  • Edit one of the two versions (or both in two different places)
  • Recompare
What now happens is exactly what I expect to happen: The two current contents of the views are compared, not the clipboard anymore! So it would really be more consistent if you copied the clipboard's content when the user presses the corresponding button in the compare dialog.
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

I still think that the Clipboard should be retrieved when the Compare button is used. Let me try another argument.

Once you use "Select Clipboard contents" button, "<Clipboard contents>" item will be added to the file combo box. So the next time, when you compare, you have 2 ways of selecting Clipboard: pressing the small Clipboard button or selecting the combo box item "<Clipboard contents>". While it may be argued that retrieving the Clipboard can be done when the Clipboard button is used, what about selecting "<Clipboard contents>" from the combo box? Would such selection also trigger Clipboard retrieval? This seems like an odd design choice -- imagine that you selected a large block of text, then chose the "<Clipboard contents>" in the combo box: at that point the program would have to save the Clipboard contents into a temporary buffer, thus creating a delay in the GUI. What if you selected the "<Clipboard contents>" item by accident?

As you can see, I'm still unconvinced that the way your proposed is the right way to deal with the Clipboard.
psguru
PrestoSoft
Marco Nef
Junior Member
Posts: 14
Joined: Sat May 15, 2004 4:55 pm
Location: Zürich, Switzerland
Contact:

Post by Marco Nef »

Finally it's allways a design question. For me fact is, that I never needed the clipboard comparison functionality the way you designed it, but I need it the other way all the time.

Example: A bad programmer has copied some pieces of source code to another location instead of creating a new method (which some do very often...). Now there is a problem with that code and I have to check whether the two pieces are really identical. What I have to do is copy both pieces to temporary files and compare them.
The second possibility is to copy the first piece to the clipboard, select it as both files and compare it. Now I can copy the second piece to the second view and recompare which results in what I need.

Maybe you can offer an option (in the option dialog) to decide whether the clipboard shall be copied when the button is pressed (my way) or upon compare (your design).
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

OK, I'm convinced. The latest Beta build has the new implementation of the Clipboard retrieval -- based on your request.
psguru
PrestoSoft
Marco Nef
Junior Member
Posts: 14
Joined: Sat May 15, 2004 4:55 pm
Location: Zürich, Switzerland
Contact:

Post by Marco Nef »

Thank you very much!
Post Reply