TC7rc4 - Compare By Content, Edit mode, wrong line number 0

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

TC7rc4 - Compare By Content, Edit mode, wrong line number 0

Post by *white »

Example 1
  • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
  • Press F6 to go into Edit mode.
  • Press Ctrl-Home and then press Home to go to the beginning of the first line.
  • Hold down Shift en press the arrow down key to select the first line.
  • Press the Delete key to delete the line.
  • The line following the deleted line has line number 0 indicating a change in that line. However that line is not changed. See screen shot.
Example 2
  • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
  • Press F6 to go into Edit mode.
  • Press Ctrl-Home and then press Home to go to the beginning of the first line.
  • Hold down Shift en press the arrow down key to select the first line.
  • Press the Ctrl-C to copy the selection to clipboard.
  • Press Home to make the selection go away.
  • Press the Ctrl-V to insert a duplicate line below the first line.
  • The line following the inserted line has line number 0 indicating a change in that line. However that line is not changed. See screen shot.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

The line following the deleted line has line number 0 indicating a change in that line. However that line is not changed. See screen shot.
Confirmed both examples.

Example 3: press Delete key on an empty line
=> you'll get the same.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

These are no bugs. The line is modified (internally) because you delete from the previous line to the beginning of the current line. This deletes the line and re-inserts it one line higher. The same happens when you paste the text with the line break at the end: It's merged with the existing line.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:These are no bugs. The line is modified (internally) because you delete from the previous line to the beginning of the current line. This deletes the line and re-inserts it one line higher. The same happens when you paste the text with the line break at the end: It's merged with the existing line.
  1. Most users have no clue of how TC works internally, nor should they! For the user the line is not changed, so it should not be marked as such.
  2. You are inconsistent. Following your reasoning pressing Enter at the beginning of a line should also change that line and mark it changed. Like when you paste a line break at the beginning of a line.
  3. Example 3
    • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
    • Press F6 to go into Edit mode.
    • Press Ctrl-Home, Arrow down and End to go to the end of the second line.
    • Hold down Shift en press the arrow up key followed by the End key to select the second line.
    • Press the Delete key to delete the second line.
    • The second line is deleted and no other line is marked as changed. See screen shot.
    Example 4
    • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
    • Press F6 to go into Edit mode.
    • Press Ctrl-Home, Arrow down and End to go to the end of the second line.
    • Hold down Shift en press the arrow up key followed by the End key to select the second line.
    • Press the Ctrl-C to copy the selection to clipboard.
    • Press End to make the selection go away.
    • Press the Ctrl-V to insert a duplicate of the second line below the first line.
    • A line is inserted and no other line is marked as changed. See screen shot.
    Example 5
    • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
    • Press F6 to go into Edit mode.
    • Press Ctrl-Home, Arrow down and Home to go to the beginning of the second line.
    • Hold down Shift en press the arrow left key to select a line break.
    • Press the Ctrl-C to copy the line break to clipboard.
    • Press End to make the selection go away.
    • Press the Ctrl-V to paste a line break at the end of the first line. An empty line is created and no other line is marked as changed. See screen shot.
    • Press Ctrl-Z to undo the inserted line.
    • Press Home to go to the beginning of the first line.
    • Press the Ctrl-V to paste a line break at the beginning of the first line. An empty line is created and the next line is marked as changed. See screen shot.
    How can you explain to the user that when a line break is inserted at the beginning of a line, that line is changed, but when a line break is inserted at the end of a line, that line is not changed? Besides that, it would be far better if you would have implemented it the other way around. But best of all: Don't mark a line as changed when a line break is inserted at the beginning and don't mark a line as changed when a line break is inserted at the end of a line. Like when hitting the Enter key.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm sorry but I cannot change that. If I do, then UNDO will stop working too! I really don't see why you make so much noise about this little inconsistency. The lines are displayed correctly, no data is lost, and the UNDO works correctly too!
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:I really don't see why you make so much noise about this little inconsistency.
Well, if you say you don't find this very important and it is too hard to change, that is fine by me. However if you tell me these are no bugs because it works a certain way internally, then I am going to try to prove my point. Big issue or not. That is just my nature.
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Is the following related?

Compare two files, go into Edit mode and mark one line like in this screen shot.
Click on the Copy button to copy the selection to the other side.
One line is copied and one line is erased! See this screen shot.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, partially - in the left screen, the line is selected including the line break, the cursor stands on the next line. When you click the cursor button, TC copies all selected lines, but only the text which is really selected. You can start a selection in the middle of the first selected line, and end it somewhere in the middle of the last selected line. If you add it at the beginning of that line, then no characters of the line are copied (but the line itself is still copied).
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Well, partially - in the left screen, the line is selected including the line break, the cursor stands on the next line. When you click the cursor button, TC copies all selected lines, but only the text which is really selected. You can start a selection in the middle of the first selected line, and end it somewhere in the middle of the last selected line. If you add it at the beginning of that line, then no characters of the line are copied (but the line itself is still copied).
I see. Thanks for explaining.

Create a selection of a line break only and click on the Copy button to copy it to the other side. Result: two lines are cleared at the other side. See this screen shot. Apparently the selection is also part of the previous line. This is inconsistent with the behavior when deleting a selection.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is also following the same scheme as described in my last post: TC copies over all lines in which there is a selection. When you select a line break, then TWO lines are selected: The end of the first line and the beginning of the next.
Author of Total Commander
https://www.ghisler.com
Post Reply