mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-12-25 12:59: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
|
||||
.iter()
|
||||
.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)
|
||||
.map(|line| Line::from(line.as_str()))
|
||||
.map(Line::from)
|
||||
.collect();
|
||||
|
||||
// Create list widget
|
||||
|
|
Loading…
Reference in New Issue
Block a user