MATLAB Compare Tool in 2021b

Some changes have been made to the comparison tool in MATLAB 2021b that are steps backwards, in my opinion. Or, there are preferences that I just cannot find that would revert to previous functionality.
  1. The comparison tool in 2021a and before omitted lines that are the same between the two files with a line that simply states [# unmodified lines hidden]. This was extremely helpful and now I have to scroll through an entire long file to see all the changes, some of which may be at the very end. I realize that we can navigate through the changes with the Previous and Next arrow buttons, but I find scrolling through the file to be more helpful, especially when many changes are present.
  2. The line numbers were hyperlinked, allowing the user to quickly open the file in question with the line that is clicked highlighted in the opened file.
  3. A summary of matched and unmatched lines was included at the bottom of the window.
  4. A "New" button in the toolstrip allowed for quickly opening up the dialog to compare more files.
  5. Save As and Print options also seem to be missing.
Is there any way to toggle these features back on in 2021b? If not, please add them back in to a later release.

2 Comments

I would also add that new comparison windows always open to the same default size, instead of adhering to the resized size of an open or previous comparison window. Editor windows exhibit the expected behavior (of adhering to the size of open/resized windows), so I would also expect this behavior in the comparison windows.
Another difference I found is the inability to copy text.
In the older version of the comparison tool one can highlight text from either document and paste that text elsewhere. I find that very helpful for manually merging some of the differences, as I often do not want to merge them all.
Unfortunately, highlighted text in the new comparison tool cannot be copied...

Sign in to comment.

 Accepted Answer

Hello,
Thank you sending this feedback. I have brought your feedback to the notice of the concerned people and the issues might be addressed in a future release.
In the meantime, in R2021b, you can change a setting which would let you use the text comparison as it was in R2021a. The setting can be configured with the following steps:
settingsRoot = settings();
textSetting = settingsRoot.comparisons.text.UseNoJava;
In order to change the behaviour of the text diff to R2021a for only the current MATLAB session, set the Temporary setting value of textSetting to false
textSetting.TemporaryValue = false;

6 Comments

Sivani,
Thank you for passing my feedback along.
The answer you provided is not working for me. Perhaps there is something different in my setup that is preventing that fix from working?
On running the first two commands, the settingsRoot object appears empty when viewed in the variables window. If I display that variable in the command window, I see the following:
settingsRoot =
SettingsGroup with properties:
Simulink: [1×1 SettingsGroup]
slhistory: [1×1 SettingsGroup]
mldrivetripwireaccess: [1×1 SettingsGroup]
matlab: [1×1 SettingsGroup]
There is no comparisons object at that level. I searched a little in matlab, but could not find a comparisons there.
Is there something else I need to change in my configuration or does the textSetting definition require additional layers between settingsRoot and comparisons?
Hello,
The comparisons settings group is a hidden group in the settingsRoot object. This means that it doesn’t display in the MATLAB Command Window along with the other settings groups like Simulink, slhistory and matlab you can see above, but it should still be accessible when you run the command
textSetting = settingsRoot.comparisons.text.UseNoJava;
Adding to my above comment, If you want to change the behaviour for all your MATLAB sessions, please run the below command.
textSetting.PersonalValue = false;
If running the above commands doesn’t work for you, do get back to us.
Thank you for the additional information. Changing the PersonalValue field worked!
In directly comparing the comparison tools I noticed that the new one is much smoother (e.g., when resizing the window).
For reference, I think that there are definite improvements in the newer comparison tool. It would be great if the things that have been changed (i.e., what I indicated above) could be included as options to allow any user to customize the comparison-tool setup—I believe that some features/facets of the older tool are superior.
Changing the PersonalValue field worked for me too!
It would be nice to have a toggle button so that one can switch between the old/new file comparison
Works. :-)
But does this need to be written in my startup.m (assuming I want it in every session)? Or will MATLAB store this setting in some permanent place?
Joel, MATLAB has retained the modified setting for me. I imagine it should persist for you, as well.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2021b

Asked:

on 30 Dec 2021

Commented:

on 12 Jun 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!