Repository navigation
A -theme-str with two quoted strings reads them as one string #2342
Unanswered
rokokol
asked this question in
(Possible) Issues
Replies: 1 comment 2 replies
|
Hmm that indeed does not behave as expected on the commandline. I need to think about a solution that causes the least breakage for users. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When a
-theme-strholds two quoted strings, rofi reads them as one string. The string runs from the first quote to the last quote on the line, and the second property is lost.Steps to reproduce
What I see
element-textgets one long font string, andtextboxgets no font:The same two rules in a file, one on each line, give two fonts:
With two
url("…")values in one-theme-str, rofi tries to load an image with that whole span as its path and fails.What I expected
element-textgets"Sans 10"andtextboxgets"Mono 12", as when the same text is in a theme file with one property on each line.Why it happens
STRINGinlexer/theme-lexer.lis\"{UANYN}*\", andUANYNexcludes only the newline, not the quote. flex takes the longest match, so a string ends at the last quote on its line. A theme file usually has one string on each line, so this does not show there. A-theme-stris one line.This looks deliberate:
test_properties_string_escapeintest/theme-parser-test.cexpects"aap" noot" mies "to be one string, with the inner quotes kept. So I am not sure whether this is a bug or the intended trade-off, and I did not want to send a patch that breaks that test.Some options I can see:
rofi-theme(5)that a string ends at the last quote on its line, so-theme-strneeds\nbetween stringsSTRING_LISTalready does, and require\"for a quote inside a string. This changestest_properties_string_escapeand themes that rely on bare inner quotesWhich one would you prefer? I can send a pull request for either.
Version: rofi 2.0.0 (also the current
next, where the rule is the same).All reactions