This patch implements FromIterator<SpannedString<T>> for
SpannedString<T> to make it easier to create strings programatically.
We could also use fold directly without extracting the first element,
but that would require an additional allocation.
The method names stack_horizontal and stack_vertical don’t make it clear
whether the methods modify self or return the modified version.
Therefore, it is easy to use them wrong if you don’t look at the
documentation. This patch adds the must_use attribute to both methods
to make it easier to spot such mistakes.
This patch implements FromIterator<&Style> and FromIterator<T:
Into<Style>> for Style to make it easier to programatically create
styles. Style already has a merge method, but it takes a slice instead
of an iterator.
Before commit f9c9e56518, this match
interpreted the key code 10 as the Enter key. Since it now uses the
Key::Enter variant instead, the comment explaining the magic number is
no longer needed.
* Fix text alignment when wrapped
This changes the `LinesIterator` to return a `width` that corresponds
with the actual total length of the chunks, rather than returning the
total available width, when a line is wrapped. This effectively reverts
20cb033b8d (I am not sure why that commit
changed it).
* Add `is_wrapped` flag to `Row`
* Fix TextArea width with wrapped rows
Co-authored-by: Alexandre Bury <alexandre.bury@gmail.com>
As starting to use the cursive library I've found it challenging to
figure out how to actually use the themes. Only after checking the
source code, and another library actually using this feature, I've
managed to apply it to my project.
This change makes it easier for new commers to use toml themes by
extending the documentationn