-[8.50RC1]F5/F6, Ctrl+V: Line breaks and tabs still inserted

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

-[8.50RC1]F5/F6, Ctrl+V: Line breaks and tabs still inserted

Post by *MVV »

According to changelog, new addition of 8.50RC1 is masking line breaks, tabs etc when text is inserted into edit fields on F5/F6/Shift+F6. However I can't make it working.

I copy two text lines to clipboard and then paste into edit field, only first line is inserted. Also when I paste text with tab character, it is also inserted...

TC 8.50RC1x32.
User avatar
ND
Member
Member
Posts: 150
Joined: 2006-04-10, 16:24 UTC
Location: Sibiu, RO

Post by *ND »

I think the "masking" occurs not when you paste from Clipboard (not at Ctrl+V), but when you actually start the copy/move operation (at OK/Enter).
aNDreas Bolotă
The truth always carries the ambiguity of the words used to express it. (Frank Herbert, God Emperor of Dune)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, it's coreect - they are only removed after you actually clicked OK. A windows linebreak (cr/lf) cannot be pasted this way, but half a break can, as described in the original bug report:
http://ghisler.ch/board/viewtopic.php?t=39179
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Original report doesn't specify used line break style.

Anyway, I created text file with contents SAP CRYSTAL SERVER 2013\x0ACLIENT COMPONENTS and when I copy text from Lister and paste it into F7 dialog, I see entire line but I can't create directory, TC reports an error.

According to changelog,
HISTORY.TXT wrote:12.01.14 Added: F5,F6,Shift+F6: Remove characters #00-#31 like line breaks (LF) in name and replace tabs by spaces when new name pasted from clipboard (32/64)
So, TC should remove both #13 and #10 because they both are within #00-#31, but it doesn't. Also it should replace tabs with spaces but it doesn't. That's why I state it as a bug: documented behaviour is different.


ND,
It would be total mess if TC copied files with names different from displayed in copy dialog.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

As the line from the history states, this was only added to F5, F6 and Shift+F6, not F7.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9966
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:As the line from the history states, this was only added to F5, F6 and Shift+F6, not F7.
The original bug report was about F7 (too), wasn't it?

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

Post by *MVV »

ghisler(Author) wrote:As the line from the history states, this was only added to F5, F6 and Shift+F6, not F7.
Well, with all these limitations I can see that something has changed in compare to older versions. However history states that all characters #0-#31 are masked while #13 and #9 are not masked in F5 dialog, #13 is simply treated as end of line, #9 is pasted as is.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

#13 cannot even be pasted, so TC cannot handle it. #9 is documented.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I repeat, tab character is not replaced with space, it is inserted as is, while history file states that it is masked with space.

I thought TC preprocesses string before pasting so it allows masking non-printable characters when strings are copied from binary files e.g.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Maybe this is just a misunderstanding? The characters are replaced only when you click OK in the copy/move/rename dialog, not when you press Ctrl+V. Paste itself is handled by Windows, TC doesn't interfere.

Btw, you cannot create a file with a space character. Therefore if the file is created, Tab is replaced by space.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Ah, you replace characters only on clicking OK... Yes, it works, even if it looks strange that name changes after user have confirmed operation.
I think you should clarify it in history. You see, it is very unclear under which circumstances this feature may be applied.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, how should I change it? I thought that it was quite clear...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think you can add a few words more:
12.01.14 Added: F5,F6,Shift+F6: Remove characters #00-#31 like Unix line breaks (LF) in name and replace tabs by spaces when new name pasted from clipboard and user clicks OK (32/64)
But I think you also can catch paste message after it has been processed by Windows dialog procedure (when it returns control from subclassed procedure to your one) and then scan line for bad characters in order to replace them with spaces so user would see final name before he clicks OK. In such case you won't need to process pasting manually.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

MVV wrote:I think you also can catch paste message after it has been processed by Windows dialog procedure
I also think that this would be a good solution - the user would see the proper name immediately.

And this method (with subclassing and handling WM_COPY message) could probably be used for all edit fields and comboboxes in TC - I don't see any reason for allowing pasting special characters.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, it could be done with subclassing, but I don't want to risk that now just before the release. I don't want to add new features either, so I will not change the F7 function now.
Author of Total Commander
https://www.ghisler.com
Post Reply