* Note that this will not free the source string.
*/
i3String *i3string_copy(i3String *str) {
- if (str->is_markup)
- return i3string_from_markup(i3string_as_utf8(str));
- else
- return i3string_from_utf8(i3string_as_utf8(str));
+ i3String *copy = i3string_from_utf8(i3string_as_utf8(str));
+ copy->is_markup = str->is_markup;
+ return copy;
}
/*
return str->is_markup;
}
+/*
+ * Set whether the i3String should use Pango markup.
+ */
+void i3string_set_markup(i3String *str, bool is_markup) {
+ str->is_markup = is_markup;
+}
+
/*
* Returns the number of glyphs in an i3String.
*