mirror of
https://github.com/polybar/polybar.git
synced 2026-03-07 08:48:56 +00:00
fix(formatting): Make formats parse specs as-is
This removes the spacing tinkering when parsing format specs.
The following example uses the old behavoir:
format-test = <label-foo> <label-bar>
format-breaks = <label-foo><label-bar>/<bar-test>
`format-test` would replace all occurences of ' ' with the
a space string with defined `spacing` as its width. `format-breaks` would
not validate as the tags where split with ' ' as delimiter.
All that nonsense has been removed and each tag is extracted as is.
The `spacing` parameter can still be used to apply N extra whitespaces
between the tags, but it is now 0 by default.
This commit is contained in:
@ -301,7 +301,11 @@ void builder::offset(int pixels) {
|
||||
* Insert spaces
|
||||
*/
|
||||
void builder::space(size_t width) {
|
||||
m_output.append(width, ' ');
|
||||
if (width) {
|
||||
m_output.append(width, ' ');
|
||||
} else {
|
||||
space();
|
||||
}
|
||||
}
|
||||
void builder::space() {
|
||||
m_output.append(m_bar.spacing, ' ');
|
||||
|
||||
Reference in New Issue
Block a user