Tooltip trimming

English support forum

Moderators: white, sheep, Hacker, Stefan2

Post Reply
pplupo
Junior Member
Junior Member
Posts: 91
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Tooltip trimming

Post by *pplupo »

This is something I noted after I installed a specific plugin that allows adding information to tooltips. This is what I have setup:

[=gitcmd.Branch] [=gitcmd.FirstRemoteUrl]\n[=gitcmd.FallIsLast] [=gitcmd.FallAge]\n[=gitcmd.FallMessage]\n[=gitcmd.FallAuthor] [=gitcmd.FallDate.D.M.Y h:m:s]\n[=gitcmd.GeneralStatus]

And this is how it works:
[img]https://i.ibb.co/1v6BHyT/image.png[/img]

However (here comes the bug):
[img]https://i.ibb.co/gJ8DXP3/image.png[/img]
This happens because of the 3 \n I'm using.

Tooltips should be the smallest possible and blank lines should be stripped out.
It is my understanding that lines that only have blank characters should not be displayed at all.

Here is the list of blank characters that I know of:
[td]Unicode[/td][td]HTML[/td][td]Description[/td][td]Example[/td] [td]U+0020[/td][td]&#32[/td][td]Space[/td][td][ ][/td] [td]U+00A0[/td][td]&#160[/td][td]No-Break Space[/td][td][ ][/td] [td]U+2000[/td][td]&#8192[/td][td]En Quad[/td][td][ ][/td] [td]U+2001[/td][td]&#8193[/td][td]Em Quad[/td][td][ ][/td] [td]U+2002[/td][td]&#8194[/td][td]En Space[/td][td][ ][/td] [td]U+2003[/td][td]&#8195[/td][td]Em Space[/td][td][ ][/td] [td]U+2004[/td][td]&#8196[/td][td]Three-Per-Em Space[/td][td][ ][/td] [td]U+2005[/td][td]&#8197[/td][td]Four-Per-Em Space[/td][td][ ][/td] [td]U+2006[/td][td]&#8198[/td][td]Six-Per-Em Space[/td][td][ ][/td] [td]U+2007[/td][td]&#8199[/td][td]Figure Space[/td][td][ ][/td] [td]U+2008[/td][td]&#8200[/td][td]Punctuation Space[/td][td][ ][/td] [td]U+2009[/td][td]&#8201[/td][td]Thin Space[/td][td][ ][/td] [td]U+200A[/td][td]&#8202[/td][td]Hair Space[/td][td][ ][/td] [td]U+2028[/td][td]&#8232[/td][td]Line Separator[/td][td][
][/td] [td]U+205F[/td][td]&#8287[/td][td]Medium Mathematical Space[/td][td][ ][/td] [td]U+3000[/td][td]&#12288[/td][td]Ideographic Space[/td][td][ ][/td]


In essence, what I'm saying is that TC should be removing any blank lines. This is a pretty standard concept that applies to different contexts. From Notepad++:
[img]https://i.ibb.co/4Jmmztf/image.png[/img]

If we want to give users the possibility of adding blank lines, maybe we should force the usage of \s (= whitespace in regex). For instance, if I wanted a tooltip like:

"<blank line>
text1
<blank line>
text2
<blank line>"
We could do something like:
\s\ntext1\n\s\ntext2\n\s

As it is now, all my tooltips on files not in a Git repository are bugged. I don't think anyone would look at that and not say "there is a bug in the tooltips."

This existed before 10.0.
umbra
Power Member
Power Member
Posts: 848
Joined: 2012-01-14, 20:41 UTC

Re: Tooltip trimming

Post by *umbra »

I agree that trimming whitespace characters from tooltips seems like a good improvement. Either as a new option or always enabled.

Though, I would not call the current behavior an error. If I explicitly request a new line (\n), I usually expect to see a new line. The hack with adding \s would be very unintuitive. An option for a simple trimming would be easier to understand.

For some reason, I keep thinking there is plugin field a syntax, that allows to specify a prefix/suffix text (like a new line), that is shown only when the field is not empty. But I can't find it mentioned anywhere. But maybe I'm just confusing TC it with some other program.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
fenix_productions
Power Member
Power Member
Posts: 1977
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Re: Tooltip trimming

Post by *fenix_productions »

umbra wrote: 2021-06-12, 19:20 UTC For some reason, I keep thinking there is plugin field a syntax, that allows to specify a prefix/suffix text (like a new line), that is shown only when the field is not empty. But I can't find it mentioned anywhere. But maybe I'm just confusing TC it with some other program.
It exists but does not support new lines, i.e.:

Code: Select all

[="Title:"html.Title]\n[="Keywords:"html.Keywords]
Mentioned here:
https://www.ghisler.ch/board/viewtopic.php?f=3&t=11428
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 41391
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Tooltip trimming

Post by *ghisler(Author) »

It should work when the lines are completely empty, but they are NOT due to the spaces!

Please try putting them inside the fields:
[=gitcmd.Branch" "][=gitcmd.FirstRemoteUrl]\n[=gitcmd.FallIsLast" "][=gitcmd.FallAge]\n[=gitcmd.FallMessage]\n[=gitcmd.FallAuthor]
Author of Total Commander
http://www.ghisler.com
pplupo
Junior Member
Junior Member
Posts: 91
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Tooltip trimming

Post by *pplupo »

I've fixed mine with [=gitcmd.Branch" "][=gitcmd.FirstRemoteUrl]\n[=gitcmd.FallIsLast" "][=gitcmd.FallAge]\n[=gitcmd.FallMessage]\n[=gitcmd.FallAuthor" "][=gitcmd.FallDate.D.M.Y h:m:s]\n[=gitcmd.GeneralStatus]

Thank you, Chris.
User avatar
DrShark
Power Member
Power Member
Posts: 1770
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Re: Tooltip trimming

Post by *DrShark »

pplupo wrote: 2021-06-14, 18:59 UTCI've fixed mine with [...]
So there was no TC bug here? Then a better place for this topic is "English" forum...
Android 4.3.1 no root, kernel 08.09.2016; Win7 Home Premium SP1 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
pplupo
Junior Member
Junior Member
Posts: 91
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Tooltip trimming

Post by *pplupo »

I don't feel there is a bug, but I can't move it either. :-/
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 41391
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Tooltip trimming

Post by *ghisler(Author) »

Moderator message

Moved to the English forum
Author of Total Commander
http://www.ghisler.com
Post Reply