mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-28 13:31:14 +00:00
chore: fix build
This commit is contained in:
parent
4845c03eec
commit
8c1f58079f
@ -1,8 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## To be released
|
||||
|
||||
### Features
|
||||
* Add option to `widgets::List` to repeat the hightlight symbol for each line of multi-line items.
|
||||
|
||||
* Add option to `widgets::List` to repeat the hightlight symbol for each line of multi-line items (#533).
|
||||
|
||||
## v0.16.0 - 2021-08-01
|
||||
|
||||
|
@ -245,7 +245,13 @@ impl<'a> StatefulWidget for List<'a> {
|
||||
&blank_symbol
|
||||
};
|
||||
let (elem_x, max_element_width) = if has_selection {
|
||||
let (elem_x, _) = buf.set_stringn(x, y + j as u16, symbol, list_area.width as usize, item_style);
|
||||
let (elem_x, _) = buf.set_stringn(
|
||||
x,
|
||||
y + j as u16,
|
||||
symbol,
|
||||
list_area.width as usize,
|
||||
item_style,
|
||||
);
|
||||
(elem_x, (list_area.width - (elem_x - x)) as u16)
|
||||
} else {
|
||||
(x, list_area.width)
|
||||
|
@ -4,6 +4,7 @@ use tui::{
|
||||
layout::Rect,
|
||||
style::{Color, Style},
|
||||
symbols,
|
||||
text::Spans,
|
||||
widgets::{Block, Borders, List, ListItem, ListState},
|
||||
Terminal,
|
||||
};
|
||||
@ -153,7 +154,8 @@ fn widgets_list_should_display_multiline_items() {
|
||||
">> Item 2 ",
|
||||
" Item 2b",
|
||||
" Item 3 ",
|
||||
" Item 3c"]);
|
||||
" Item 3c",
|
||||
]);
|
||||
for x in 0..10 {
|
||||
expected.get_mut(x, 2).set_bg(Color::Yellow);
|
||||
expected.get_mut(x, 3).set_bg(Color::Yellow);
|
||||
@ -188,7 +190,8 @@ fn widgets_list_should_repeat_highlight_symbol() {
|
||||
">> Item 2 ",
|
||||
">> Item 2b",
|
||||
" Item 3 ",
|
||||
" Item 3c"]);
|
||||
" Item 3c",
|
||||
]);
|
||||
for x in 0..10 {
|
||||
expected.get_mut(x, 2).set_bg(Color::Yellow);
|
||||
expected.get_mut(x, 3).set_bg(Color::Yellow);
|
||||
|
Loading…
x
Reference in New Issue
Block a user