Tapatalk

Synchronizing position in files being compared (solved)

Synchronizing position in files being compared (solved)

6

PostAug 22, 2025#1

When I have two files that are identical except that one of the files has an additional line in it, I expect when I hit the "next change" down arrow that I will see the two files synchronized in position, showing me the new line in the new file and the same area in the old file.

However, what actually happens is that the new file shows the correct area with the additional line, but the old file scrolls all the way to the end. See attached screenshot.

I have tried every possible combination of options that I could think of, and cannot get this to work properly. How can I make this work?
Ultracompare.PNG (134.4KiB)

6,824625
Grand MasterGrand Master
6,824625

PostAug 23, 2025#2

This scrolling is not reproducible by me with my configuration settings using 64-bit UltraCompare Professional v2024.1.0.5. The vertical scrolling on clicking on the green up/down arrows to go to next/previous difference is as expected by you on my tests.

There is no information provided by you about the used version of UltraCompare and the currently used settings. Which UltraCompare version is used by you? Which user interface mode is used by you – ribbon mode or toolbar/menu mode? Is Synchronized Vertical Scroll in menu Window or Sync vertical on ribbon tab Layout in second group Scrolling enabled or disabled? That scrolling option should be enabled for your type of C++ code comparison.

Is it possible for you to create two text files with text which can be public shared showing the same vertical scrolling behavior and compress these two text files together with a copy of %APPDATA%\IDMComp\UltraCompare\uc.ini with all file and directory names removed from this copy with a text editor into a 7-Zip, RAR or ZIP archive file and attach that archive file to your next post? That would make it perhaps possible for us to reproduce the issue with your settings to find out what must be changed to get the wanted vertical scrolling behavior on using the next/previous difference commands.

6

PostAug 23, 2025#3

Thank you for your reply. The version is UltraCompare 2024.1.0.5 64-bit.
I don't know whether I am using toolbar or ribbon mode. I have attached a screen shot of the window so you can determine this.
I have also added a zip file containing two files that show this behavior. They contain no proprietary information. Just use a default UC to compare them and you will see the behavior.
I don't see a file called uc.ini in that directory.

Synchronized vertical scroll is enabled.
Window.PNG (246.24KiB)
20250724.zip (20.79 KiB)   0

6,824625
Grand MasterGrand Master
6,824625

PostAug 23, 2025#4

Thanks for the version information, the ZIP file and the screenshot showing me that you are using UltraCompare 2024.1.0.5 in toolbar/menu user interface mode with a light UltraCompare theme. You can click with secondary (right) pointing device (mouse) button on either the menu bar or one of the three toolbars and click in displayed context menu on the menu item Ribbon Mode to switch to this user interface mode. Do such a right click on a ribbon tab opens the context menu with the menu item Toolbar/Menu Mode to switch the user interface mode back.

I renamed the directory %APPDATA%\IDMComp\UltraCompare while UltraCompare was not running to UltraCompareBackup and then started UltraCompare. UC created new the application data directory with all settings set to default. I switched to the toolbar/menu mode and clicked in menu View in submenu Themes on Classic to switch to a light theme.

Then I started a text comparison, opened the two *.c files and used Next Difference the first time. The vertical scrolling was as expected, see attached Compare_Diff_1.png. Then I clicked a second time on the green down arrow symbol and get displayed the difference again as expected, see attached Compare_Diff_2.png.

I looked now on your screenshot on the symbols in the toolbar and saw a difference: The merge commands are all disabled in your text comparison. I saw further the different display of the additional block of lines and the different display of the lines in the area between the two text panes. I had now an idea what makes the difference.

Click with the *.c text comparison already run in menu Session on the menu item Session properties. Uncheck in the group Compare options the first option Relational lines mode and click on button OK and Run. BTW: The default text comparison mode is Logical line matching with a scan of 20 lines. But it is already enough to uncheck Relational lines mode. Now the *.c files comparison and the navigation is done as you can seen on my two screenshots.

I also found out why you have no file uc.ini in the UltraCompare application data directory %APPDATA%\IDMComp\UltraCompare. Click in menu Options on the first menu item Configurations… and click next in the settings tree on left side on Application Layout opening automatically the subitem Advanced. There is checked in your configuration on right side the setting Use registry for settings (not INI file). This setting is not checked by default resulting in storing most settings in uc.ini in the application data directory making it easier to back them up, for example, by making a backup of the entire UltraCompare application data directory. The advantage on using the registry for the UltraCompare settings is the faster read on startup and the faster store on exit. But the difference in read/write of the settings between registry or INI file will not be noticed anymore by a user on a modern PC. Unchecking the configuration setting Use registry for settings (not INI file) causes creating uc.ini on closing the Configuration dialog window next with a click on X symbol with the current settings as read from the registry. The settings are also removed from the registry with the exception of the few settings needed by other UltraCompare features like the shell extension DLLs or the UltraCompare installer and uninstaller.

The help of UltraCompare has a page with the title Relational Lines Mode explaining this comparison option in case of you are interested in more information about the option currently used by you which should be unchecked by you.

It is in my opinion a bug of UltraCompare 2024.1.0.5 with enabled Relational Lines Mode that the left text pane is scrolled to bottom of the file on executing the command Next Difference. I will report this issue by email to UltraEdit support with your two *.c files, a step by step instruction to reproduce the issue and some screenshots. You should do the same. The more users report an issue the higher becomes the priority for fixing the issue.
Compare_Diff_1.png (28.84KiB)
Text comparison display after first Next Difference execution
Compare_Diff_2.png (27.98KiB)
Text comparison display after second Next Difference execution

PostAug 24, 2025#5

Here is the issue report email sent by me today to UltraEdit support with subject:
UC - Next/Previous Difference vertical scrolling not working as expected with Relational Lines Mode

The vertical scrolling done on executing the command Next Difference or Previous Difference (green down/up arrow symbols between the file names) is not working as expected after running a text comparison for two *.c files with right file having two added code blocks using 64-bit UltraCompare 2024.1.0.5 on Windows 11 24H2 on having enabled the relational lines mode compare option in the session compare settings. The first click on the green down arrow results in scrolling the first file to the bottom and the second file with the two inserted code blocks to the first inserted code block. Then the command Next Difference is disabled as it can be seen on the green down arrow symbol which changed to a gray down error symbol although there is one more difference below the inserted block displayed in the right text window pane.
 
Here are the steps to reproduce this issue.
  1. Extract the attached RAR file Relational_Lines_Mode_Sample.rar with two *.c files provided by an UltraCompare user in forum to a temporary directory of your choice.
  2. Make sure the directory %APPDATA%\IDMComp\UltraCompare does not exist by deleting it if already existing.
  3. Start UltraCompare. There are default settings used because of not existing application data directory.
  4. Click on the Text button to start a new text comparison session.
  5. Click on ribbon tab Home on the command Set compare options to open the Current Session Properties - Text Mode dialog window.
  6. Select for File 1 the file File_Left.c and for File 2 the file File_Right.c.
  7. Check in group Compare options the option Relational lines mode which is by default unchecked. This is the most important step as the scrolling issue exists only with this option checked. Please refer to the attached file Relational_Lines_Mode_Settings.webp.
  8. Click on the button OK and Run. The result should be the display as captured to the attached file Relational_Lines_Mode_Display_1.webp.
  9. Click on the green down arrow symbol in the middle of the two files to execute the command Next Difference.
The file in the left window pane is scrolled to the bottom of the file. The file in the right window pane is scrolled to lines 145 to 185 with the first inserted block being in the lines 165 to 180 in file File_Right.c. The symbol of the command Next Difference is disabled now as it can be seen on the attached image Relational_Lines_Mode_Display_2.webp although there is a second difference too.
 
The vertical scrolling was done completely wrong with enabled relational lines mode.
 
The expected display after Next Difference execution can be seen on the attached file Relational_Lines_Mode_Display_3.webp created after manually scrolling vertically on left and right file until getting this display. The symbol of the command Next Difference should still be enabled as on this screenshot.
 
A second click on symbol of the command Next Difference should result in a display as captured to attached file Relational_Lines_Mode_Display_4.webp. The symbol of the command Next Difference is grayed out now as disabled because there is no more difference below. The symbol of the command Previous Difference is enabled now as there is one more difference above.
Relational_Lines_Mode_Settings.webp (6.23KiB)
Text compare settings with enabled relational lines mode
Relational_Lines_Mode_Display_1.webp (23.44KiB)
Display after comparison with enabled relational lines mode
Relational_Lines_Mode_Display_2.webp (26.05KiB)
First unexpected difference display with enabled relational lines mode
Relational_Lines_Mode_Display_3.webp (29.51KiB)
First expected difference display with enabled relational lines mode
+2
Relational_Lines_Mode_Display_4.webp (26.85KiB)
Second expected difference display with enabled relational lines mode
Relational_Lines_Mode_Sample.rar (8.5 KiB)   0
RAR archive file with two sample *.c files to compare

6

PostAug 25, 2025#6

Thanks. Following your instructions, unchecking "relational lines mode" in session options did resolve the problem, but only for that session. Closing and reopening UC reverts to the old behavior. Is there another place where the configuration needs to be changed to make this change permanent? I made this change in "Options > Configuration > Sessions" but it didn't take. Also that dialog says "to change default settings use the Configuration settings dialog" when I'm already in that dialog.

I found the solution to my question, namely that I have to edit UC.ini to change "RelationLines=1" to "RelationLines=0". I'm leaving in my question in case anyone else has this same problem.

Also you said this:
"I looked now on your screenshot on the symbols in the toolbar and saw a difference: The merge commands are all disabled in your text comparison."

How do I enable these commands?

6,824625
Grand MasterGrand Master
6,824625

PostAug 25, 2025#7

You have already found the solution to disable the Relational Lines Mode by default with changing in uc.ini the setting RelationLines=1 to value 0. The same value change for this setting can be done also in Windows registry on using the registry for storing the settings instead of the INI file.

I have restored several of my archived versions of UltraCompare to find out what happened with the Relational Lines Mode setting. There was in menu View between Center On Difference and Display Column Number the menu item Relational Lines Mode and on last ribbon tab View in first group Review also the item Relational lines mode as second item up to UltraCompare Professional 2020.20.0.45. The setting RelationLines in uc.ini was saved on exit of UltraCompare with the value 0 or 1 depending on having currently enabled Relational Lines Mode in menu View or on ribbon tab View on exit of UltraCompare. The Relational lines mode option existed also in the Current Session Properties dialog window of UC Prof. 2020.20.0.45.

The item Relational Lines Mode does not exist anymore in the menu View or on ribbon tab View since UltraCompare Prof. 2023.00.0.30. It exists only as a comparison option in the Current Session Properties dialog window since this UltraCompare version. So, if a user has stored in the INI file or in the registry the setting RelationLines with the value 1, the Relational lines mode option is by default always enabled on starting a comparison session. The only chance to change the default setting after an upgrade of UC to a version after 2020.20.0.45 is a manual change of the value of the setting RelationLines in uc.ini or the registry to value 0 or to value 1. I reported this issue also to UltraEdit support.

All the merge commands are always disabled after a text comparison on being at top of the files with no difference here. After execution of Next/Previous Difference with the display of the difference in both panes the merge commands suitable to the difference are automatically enabled. That works fine by not using the Relational lines mode comparison option as the vertical scrolling works in this mode. The merge commands would also work with enabled Relational lines mode compare option if the vertical scrolling would work in this mode as I could see after manually scrolling in this mode to the two differences in your sample files. But the merge commands are always disabled on wrong scrolling of first file to bottom of the file as in this case the user cannot see where the block on right side would be inserted into the file on left side on doing the merge with the merge commands.

Conclusion: You have configured now UltraCompare 2024.1.0.5 with manual RelationLines=0 in uc.ini to work as it is best for comparing source code files of any programming/scripting language. The merge commands can be used by you after every use of the Next/Previous Difference commands.

Post17:46 - Feb 07#8

The issue with wrong vertical scrolling on using Next/Previous Difference with enabled Relational Lines Mode is fixed with UltraCompare for Windows v2025.0.0.10.

UC 2025.0.0.10 reintroduces also the configuration setting Relational Lines Mode in Configuration at Compare - Text - Compare to define the default for this text comparison option. This configuration setting changes RelationLines in uc.ini to value 1 or removes this setting from uc.ini on having the default value 0 on Relational Lines Mode option is not checked in Configuration.