Compare : make a copy/paste adds empty lines

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
menet
Member
Member
Posts: 199
Joined: 2005-04-21, 12:27 UTC
Location: Paris, France

Compare : make a copy/paste adds empty lines

Post by *menet »

Hi,

I show you how to have empty lines added :
- I compare 2 text files
First file wrote:1
2
3
Second file wrote:1
3
- The first file contains the same firsts and lasts lines than second file
- The first file have lines in the middle not present in the second file; It gives empty lines with no number on the second file panel of the compare tool.
- If I copy (Select and Ctrl-C) the lines from the second panel with the empty (not numbered) lines, then the empty lines are copied like if they were real empty lines.

I have then in the buffer :
Buffer wrote:1

3
Can it be corrected ?

Best regards :wink:
#22273 Personal licence
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2menet
But if you save the file, the result will be correct!
So this is a displaying problem only, if a problem at all...
I switched to Linux, bye and thanks for all the fish!
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

User avatar
menet
Member
Member
Posts: 199
Joined: 2005-04-21, 12:27 UTC
Location: Paris, France

Post by *menet »

You are right,Valentino , it looks like the same problem (not found searching "compare" key work). :oops:

2SanskritFritz,
If after doing a copy (Ctrl-C), you do a paste (Ctrl-V) in Edit mode in the other file or in an empty file with an editor, you will have 3 lines added, a new empty line between the line named 1 and the line named 3. :roll:

It is not a big bug but it is a problem :?

Best regards :wink:
#22273 Personal licence
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2menet
I see, I didnt read carefully enough...
I switched to Linux, bye and thanks for all the fish!
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Yes, this is not just display problem. I think it should be fixed. And if this bug is fixed, then probably the display problem that I reported here also will be fixed automatically.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, I don't understand the problem. The lines which keep the left and right panel in sync do not have line numbers in front, and will not be saved when you save the files...
Author of Total Commander
https://www.ghisler.com
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2ghisler(Author)
Not saved, true, but copied to the clipboard.
I switched to Linux, bye and thanks for all the fish!
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

2ghisler(Author)
2SanskritFritz
Hm, why not saved? In my case, they are saved.
When I select all lines in right panel, copy them to clipboard, select all lines in left panel, paste, I get this in the left panel:

Code: Select all

0:1
0:
0:3
So when I click save I get the following file on disk:

Code: Select all

1

3
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Valentino
But if you use the internal save function (comes up when you close the CbC window) then the lines without numbers are not saved.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

petermad wrote:2Valentino
But if you use the internal save function (comes up when you close the CbC window) then the lines without numbers are not saved.
They ARE saved. In both cases: when I press Save button and when I close CbC window and the press Save. Maybe it happens only on my PC, I don't know.

And what do you mean by "internal save function"? What is external save function then?

And what do you mean by "without line numbers"? After paste I have line numbers - they are just zero. And they are zero both for existing lines and for non-existing.
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

And what do you mean by "internal save function"? What is external save function then?
I meant pressing the Save button or just closing CbC after having edited a file and choose save left/right - as opposed to copying the whole window to clipboard and pasting it into a new file.
And what do you mean by "without line numbers"?
Exactly what it says - but of course if you have replaced the ENTIRE text with som new pasted text - there will be no non-existing lines without numbers left.

But isn't this rather a limitation of Window's Clipboard than of TC ?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

I think it would be more correct not to copy to clipboard non-exisiting lines.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will think about it. There are arguments for both behaviours...
Author of Total Commander
https://www.ghisler.com
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Besides universal solution (adding corresponding INI setting - e.g. CompareDefaultCopyMode), how about adding two menu items to context menu: "Copy to clipboard" and "Copy to clipboard with missing lines"? I think it would be very convenient and make both parties happy :).

Moreover, context menu could even be "smart": if CompareDefaultCopyMode=<Copy to clipboard with missing lines>, then context menu items would be "Copy to clipboard" and "Copy to clipboard without missing lines".
Post Reply