You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If using $cut(<%year%>,4), the currently highlighted track shows the 4 first characters of %year%, but any non-highlighted track returns "[001B]1;-".
If using <$cut(%year%,4)>, everything works correctly.
The same happens when using $left.
What's going on? Describe the problem in as much detail as possible.
The extreme example cited above happens when using $cut and $len. Most other functions give me no trouble, such as $if(%isplaying%,%length%,<%length%>) which is always displayed correctly in any situation.
A similar but less annoying behavior happens when using other string functions, such as $num(<%year%>,6), which outputs text without dimming. However, <$num(%year%,6)> does give me dimming. Same when using $directory. So I presume this only applies to string functions, hence the title, but the only one that gave me a completely unusable output until now was $left/$cut..
This worked in either way in foobar2000, so I initially tried the first option by copypasting f2k's formatting until I found a solution.
Information about the software:
Deadbeef version: 1.9.6-1, installed from AUR
OS: Linux, kernel 6.8.8-arch1-1
The text was updated successfully, but these errors were encountered:
taitox
changed the title
Dimming inside string functions doesn't work as intended
Dimming inside string functions doesn't work
May 13, 2024
I have made a fix, which ignores escape sequences when counting characters in the $cut function.
There are some possible side-effects from that, since the input data is ambiguous when the input string is more complex.
For example $cut(<%year%><xxyy>,4) will output <1234>< because it would continue scanning until it encounters a non-escape character.
I don't know how problematic this is, and I can't see how to resolve such cases unambiguously.
Any input is appreciated.
If this fix is well accepted / not causing much issues -- I'll add a similar fix to other substring-related functions.
Steps to reproduce the problem
If using $cut(<%year%>,4), the currently highlighted track shows the 4 first characters of %year%, but any non-highlighted track returns "[001B]1;-".
If using <$cut(%year%,4)>, everything works correctly.
The same happens when using $left.
What's going on? Describe the problem in as much detail as possible.
Beforehand, I am aware that we shouldn't expect everything to work yet when using title formatting.
The extreme example cited above happens when using $cut and $len. Most other functions give me no trouble, such as $if(%isplaying%,%length%,<%length%>) which is always displayed correctly in any situation.
A similar but less annoying behavior happens when using other string functions, such as $num(<%year%>,6), which outputs text without dimming. However, <$num(%year%,6)> does give me dimming. Same when using $directory. So I presume this only applies to string functions, hence the title, but the only one that gave me a completely unusable output until now was $left/$cut..
This worked in either way in foobar2000, so I initially tried the first option by copypasting f2k's formatting until I found a solution.
Information about the software:
Deadbeef version: 1.9.6-1, installed from AUR
OS: Linux, kernel 6.8.8-arch1-1
The text was updated successfully, but these errors were encountered: