mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-12-25 21:09:45 +00:00
feat: Add word wrap to preview window
This commit is contained in:
parent
1417ed73b2
commit
e9db67b2fa
|
@ -68,8 +68,15 @@ impl FloatContent for FloatingText {
|
||||||
.text
|
.text
|
||||||
.iter()
|
.iter()
|
||||||
.skip(self.scroll)
|
.skip(self.scroll)
|
||||||
|
.flat_map(|line| {
|
||||||
|
line.chars()
|
||||||
|
.collect::<Vec<char>>()
|
||||||
|
.chunks(inner_area.width as usize)
|
||||||
|
.map(|chunk| chunk.iter().collect())
|
||||||
|
.collect::<Vec<String>>()
|
||||||
|
})
|
||||||
.take(inner_area.height as usize)
|
.take(inner_area.height as usize)
|
||||||
.map(|line| Line::from(line.as_str()))
|
.map(Line::from)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Create list widget
|
// Create list widget
|
||||||
|
|
Loading…
Reference in New Issue
Block a user