Compare and edit is disabled when file has line with 24k len

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
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Compare and edit is disabled when file has line with 24k len

Post by *MVV »

I've wasted some time to determine why TC doesn't allow to edit these two files during compare, and finally discovered that one of them contains 24k line that caused this. It is quite confisuing and sad, I think that there is no reason to block editing in case of such long lines, or at least user should be informed why editing is disabled...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem is that some GDI functions crash with such long lines. I cannot draw shorter bits because it would break right to left/left to right mixed text. That's why such long lines are always shown in red (as a difference), cut to 16k, and editing is disabled.
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
I agree with MVV, an informational message would be nice here.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Where? Show a messagebox for each such line? That would be really annoying. :(
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
Well, either a message:

"File <FILENAME> contains a line that is longer than <LIMIT_VALUE> bytes. Editing is therefore disabled."

or e.g.:

"The following line numbers in file <FILENAME> contain more than <LIMIT_VALUE> bytes:
Line <LINE_NUMBER1>
Line <LINE_NUMBER2>
Line <LINE_NUMBER3>

Editing is therefore disabled."

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

E.g. as TC does for deleting files: show numbers of first N long lines and an ellipsis if more.

Or maybe a better solution would be to allow editing but w/o long lines (show some read-only text in them).
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2ghisler(Author)
Instead of showing a (blocking) messagebox, I think you could easily add the explanation to some area of the compare by contents window, maybe with a yellow(?) background color, just like browsers do today for some informational stuff.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply