Inconsistencies when saving descript.ion comments with Unix 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

User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Inconsistencies when saving descript.ion comments with Unix lines

Post by *DrShark »

history1000.txt wrote:21.03.21 Fixed: Ctrl+Z edit comment: If user pastes comment with multiple Unix line breaks to existing comment, extra characters could be stored behind the comment (32/64)
I can confirm this fix, thanks! It seems this fixed also following issue mentioned in start post:
DrShark wrote: 2021-03-15, 15:03 UTCTest case 1.
[...]
8. Maybe some side bug or so, would be nice if somewone will confirm it. If to repeat steps 5-7 for the same comment many times, sometimes for some line TC saves the single linebreaks
Still there is a remaining issue:
DrShark wrote: 2021-03-15, 15:03 UTCTest case 1.
[...]
5. Open this comments dialog again, select all and past the text again instead of current comment (or past it as a new comment for some another file).
6.Don't save comment now, but with Enter key, manually create the linebreaks in places where Unix linebreaks should exist (Edit Comments dialog show them as an invisible character, though you can disover them by need of additional move of caret "|" with cursor keys).
7. Now save the comment.
The comment will have 2 Windows linebreaks now in places where original Unix linebreaks existed.
and I have following suggestion on how to handle it: maybe if when saving the comment when TC detects Unix linebreak with Windows one right next to it (before/after), it could just ignore one linebreak? So the comment, which will be saved with marker which will indicate that linebreaks are Windows type, will actually have 1 "\n" instead on 2 ("\n\n"): this way when comment is opened again, Ctrl+Z dialog will show single linebreaks instead of double.

And for consistency, please consider converting Mac linebreaks to Windows type too.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Inconsistencies when saving descript.ion comments with Unix lines

Post by *ghisler(Author) »

The comment will have 2 Windows linebreaks now in places where original Unix linebreaks existed.
That's because the Unix line breaks are still there near the ones you added, and will be converted to Windows line breaks too. You can press del or backspace to remove them.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Inconsistencies when saving descript.ion comments with Unix lines

Post by *DrShark »

ghisler(Author) wrote: 2021-03-28, 10:48 UTCThat's because the Unix line breaks are still there near the ones you added, and will be converted to Windows line breaks too. You can press del or backspace to remove them when adding Windows linbreaks.
Yes, it's of course possible to remove them, or it's possible to just let TC to convert Unix line breaks to Windows by saving a comment without any kind of manual editing - if to know how comment saving works. But if user who is not yet familiar with this specific about Unix line breaks just pastes the text from editor where linkebreaks look OK in TC's Edit Comment where they after pasting become a single line thing, I bet many user will instinctively try to re-add "missing" linebreaks manually right in the Edit Comments, not expecting that this way they are actually adding additional linebreaks.

That's why I suggest when the comment is being saved to delete those Windows line breaks which are next to Unix one.
And for those who reads Help file you can add a note that when comment is saved, TC converts Unix line break to Windows type automatically, so user will understand that in such a case there is no need to waste time adding them in Edit Comment field manually.

(as mentioned in above posts, I suggested to convert also Mac line breaks to Windows type, and in Help also to describe at least briefly also other kinds of characters conversion which may happen when the comment is saved.)
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Inconsistencies when saving descript.ion comments with Unix lines

Post by *ghisler(Author) »

Well, the first time a user adds his own line breaks, he will see the results and learn...
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Inconsistencies when saving descript.ion comments with Unix lines

Post by *DrShark »

ghisler(Author) wrote: 2021-03-29, 14:14 UTCWell, the first time a user adds his own line breaks, he will see the results and learn...
I think it's still worth to add note(s) on saving comment behavior to the Dialog box - Edit comment
help page, so at least users who read help won't wast own time learning this by try-and-see way...
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply