Make previous/next difference in Compare contents start from the current cursor position
Moderators: petermad, Stefan2, Hacker
Make previous/next difference in Compare contents start from the current cursor position
Two files, lets say the right one has all ten lines with single digits from 0 to 9, left has only even numbers.
Of course, comparison shows empty lines on the left where numbers are missing.
Turn on Edit mode, press Ctrl+Home to go to the top, then use Alt+Down Alt+Right combinations to advance to next difference and copy left to right.
Second Alt+Down would skips one differece while it should not (goes from line with "2" to line with "5" instead of "3").
"Next difference" button does the same.
Of course, comparison shows empty lines on the left where numbers are missing.
Turn on Edit mode, press Ctrl+Home to go to the top, then use Alt+Down Alt+Right combinations to advance to next difference and copy left to right.
Second Alt+Down would skips one differece while it should not (goes from line with "2" to line with "5" instead of "3").
"Next difference" button does the same.
- ghisler(Author)
- Site Admin

- Posts: 53149
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Next in Compare tool may skip real "next"
The compare tool counts multiple linked lines of differences as one difference. So if lines 2,3 and 5 are different, lines 2+3 are counted as one difference, and line 5 as the next.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Next in Compare tool may skip real "next"
Line numbering stays unchanged between comparisons, so lets refer to the numbers as "left/right"
Initially, there are 5 differences - all odd numbers at lines -/2, -/4, -/6, -/8, -/10.
Equal are lines 1/1, 2/3, 3/5, 4/7, 5/9.
The topmost difference is at -/2 (digit 1), and after elimination the cursor is at equal line 2/3 (digit 2), which is above the next highlighted difference at -/4.
The natural way to advance down would be landing on the highlighted difference below the current line, which is -/4 and not -/6.
Initially, there are 5 differences - all odd numbers at lines -/2, -/4, -/6, -/8, -/10.
Equal are lines 1/1, 2/3, 3/5, 4/7, 5/9.
The topmost difference is at -/2 (digit 1), and after elimination the cursor is at equal line 2/3 (digit 2), which is above the next highlighted difference at -/4.
The natural way to advance down would be landing on the highlighted difference below the current line, which is -/4 and not -/6.
- ghisler(Author)
- Site Admin

- Posts: 53149
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Next in Compare tool may skip real "next"
I have tried to reproduce this, but I can't. My two files are (left all numbers, right only even numbers as stated):
Left file:
and right file:
Resulting comparison:
https://www.ghisler.ch/images/compare_odd_even.png
Pressing "n" jumps through all the numbers. What am I doing wrong?
Left file:
Code: Select all
0
1
2
3
4
5
6
7
8
9
10Code: Select all
0
2
4
6
8
10https://www.ghisler.ch/images/compare_odd_even.png
Pressing "n" jumps through all the numbers. What am I doing wrong?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Next in Compare tool may skip real "next"
Simple. Your configuration:
Stated was different:ghisler(Author) wrote: 2026-06-10, 07:28 UTC My two files are (left all numbers, right only even numbers as stated):
Right, not left. With your mirrored files, keys in Edit mode should have been Alt+Down Alt+Left.Two files, lets say the right one has all ten lines with single digits from 0 to 9, left has only even numbers.
Have you switched to Edit mode and changed files as described? The bug is seen in changed files.
Mockup of what happens here after the first replacement before Next difference:
Code: Select all
1:0 | 1:0 <-- equal
2:2 | 3:2 <-- equal, cursor is here
| 4:3 <-- highlighted difference, real next
3:4 | 5:4 <-- equal
| 6:5 <-- here jumps on Next difference
- ghisler(Author)
- Site Admin

- Posts: 53149
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Next in Compare tool may skip real "next"
Even if I swap the two files, I can go through all the results with Alt+N, and none is skipped.Right, not left.
Something with your files mist be different.
Could you post your two files in [ code ] [ /code ] blocks, please?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Next in Compare tool may skip real "next"
File "0", left
File "1", right
Settings: not Binary, ANSI-ANSI, Case sensitive marked, tried with two next checkboxes both marked or unmarked.
Cursor initially is in the left pane.
Actions: press Alt+M, Ctrl+Home, hold Alt and press Down, Right, Down.
Now active difference in the line with "5" instead of expected "3".
Previous versions of TC did the same, now it is TC 11.58 RC2 64-bit in the updated Windows 11 25H2.
Code: Select all
0
2
4
6
8Code: Select all
0
1
2
3
4
5
6
7
8
9Cursor initially is in the left pane.
Actions: press Alt+M, Ctrl+Home, hold Alt and press Down, Right, Down.
Now active difference in the line with "5" instead of expected "3".
Previous versions of TC did the same, now it is TC 11.58 RC2 64-bit in the updated Windows 11 25H2.
- ghisler(Author)
- Site Admin

- Posts: 53149
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Next in Compare tool may skip real "next"
I will try it, thanks!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Next in Compare tool may skip real "next"
I can confirm that after I press Alt+down the cursor is between line 1 and 2 on the left side (on line 2 on the right side) and when I press Alt+Right line 2 in the right side is removed, and the next press on Alt+Down highlights line 5 in the right side and not line 3 as should be expected.
Maybe I is connected to the fact that if I press Alt-down and then manually move the cursor up to a previous line, then the next Alt-down press will go to the next difference from the previous last difference, not from the current cursor position - to illustrate that with the test files: press Alt+down (the cursor goes to the line between 2 and 4 in the left side). Now click on the first line (or press Ctrl+home) and press Alt+down again - the cursor goes between line 3 and 4 - not between 2 and 4.. Now click on the first line again and press Alt+down - now the cursor goes between line 4 and 5.
In my opinion pressing Alt+down should go to the next difference from the CURRENT cursor position, not to the next difference from the cursor position of the last difference. If that was changed, maybe browny's problem would be fixed too?
Maybe I is connected to the fact that if I press Alt-down and then manually move the cursor up to a previous line, then the next Alt-down press will go to the next difference from the previous last difference, not from the current cursor position - to illustrate that with the test files: press Alt+down (the cursor goes to the line between 2 and 4 in the left side). Now click on the first line (or press Ctrl+home) and press Alt+down again - the cursor goes between line 3 and 4 - not between 2 and 4.. Now click on the first line again and press Alt+down - now the cursor goes between line 4 and 5.
In my opinion pressing Alt+down should go to the next difference from the CURRENT cursor position, not to the next difference from the cursor position of the last difference. If that was changed, maybe browny's problem would be fixed too?
License #524 1994
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Next in Compare tool may skip real "next"
Confirmed, TC 11.57 32Bit // Windows 11 25H2browny wrote: 2026-06-10, 11:02 UTC Now active difference in the line with "5" instead of expected "3"
Previous versions of TC did the same, now it is TC 11.58 RC2 64-bit in the updated Windows 11 25H2.
Looking through a glass onion
- ghisler(Author)
- Site Admin

- Posts: 53149
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Next in Compare tool may skip real "next"
Sorry, this is not how "Next/Previous difference" works. The next difference found only partially depends on the cursor position:
1. If the last found difference is outside of the current view, "Next/Previous difference" starts searching from the first line
2. Otherwise, it starts searching from the last found difference position
Changing this to start from the current cursor position would be a major change, which I'm currently not willing to make.
1. If the last found difference is outside of the current view, "Next/Previous difference" starts searching from the first line
2. Otherwise, it starts searching from the last found difference position
Changing this to start from the current cursor position would be a major change, which I'm currently not willing to make.
Moderator message from: ghisler(Author) » 2026-06-11, 07:51 UTC
Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Next in Compare tool may skip real "next"
The last found difference had been deleted, difference position is invalidated, so the logical choice would be - continue from the current line.ghisler(Author) wrote: 2026-06-11, 07:51 UTC 1. If the last found difference is outside of the current view, "Next/Previous difference" starts searching from the first line
2. Otherwise, it starts searching from the last found difference position
Re: Next in Compare tool may skip real "next"
2ghisler(author)Thank you for those clear words, which would also like to see in other threads. Please keep it up.ghisler(Author) wrote: 2026-06-11, 07:51 UTC Sorry, this is not how "Next/Previous difference" works. The next difference found only partially depends on the cursor position:
1. If the last found difference is outside of the current view, "Next/Previous difference" starts searching from the first line
2. Otherwise, it starts searching from the last found difference position
Changing this to start from the current cursor position would be a major change, which I'm currently not willing to make.
ghisler(Author) wrote:2026-06-11, 07:51 UTCMoved to will not be changed
Re: Next in Compare tool may skip real "next"
Not the first time when deleted lines in Compare tool were causing troubles.
The existing behaviour is counterintuitive, it differs from what could be seen in other next/previous cases, and certainly is not the best way to handle the situation.
Deletion of several consecutive differences now requires much more attention and twice more key presses.
This could be moved into Suggestions, instead of being dumped.
The existing behaviour is counterintuitive, it differs from what could be seen in other next/previous cases, and certainly is not the best way to handle the situation.
Deletion of several consecutive differences now requires much more attention and twice more key presses.
This could be moved into Suggestions, instead of being dumped.
Re: Next in Compare tool may skip real "next"
Moderator message from: petermad » 2026-06-12, 10:41 UTC
Moved to "TC suggestions (English)" from "TC Behaviour which will not be changed"
2browny
I have changed the topic title to "Make previous/next difference in Compare contents start from the current cursor position" - If you can not agree with that, then please change it yourself.
License #524 1994
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar

