Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
lib: word wrapping on text views
✓ CI success RadsammyT committed 1 month ago
commit fe10ba2c92c4dbd12c4b3dedbf7a3437b9aec84a
parent d4484a8c000a89a3b838d4cf3afcefa329ac1740
1 passed (1 total) View logs
1 file changed +6 -2
modified src/ui/widget.rs
@@ -8,7 +8,9 @@ use serde::{Deserialize, Serialize};
use ratatui::layout::{Alignment, Direction, Layout, Position, Rect};
use ratatui::style::{Style, Stylize};
use ratatui::text::{Line, Span, Text};
-
use ratatui::widgets::{Block, BorderType, Row, Scrollbar, ScrollbarOrientation, ScrollbarState};
+
use ratatui::widgets::{
+
    Block, BorderType, Row, Scrollbar, ScrollbarOrientation, ScrollbarState, Wrap,
+
};
use ratatui::Frame;
use ratatui::{layout::Constraint, widgets::Paragraph};

@@ -1029,7 +1031,9 @@ impl Widget for TextView<'_> {

        frame.render_stateful_widget(scroller, scroller_area, &mut scroller_state);
        frame.render_widget(
-
            Paragraph::new(self.text.clone()).scroll((self.cursor.x, self.cursor.y)),
+
            Paragraph::new(self.text.clone())
+
                .scroll((self.cursor.x, self.cursor.y))
+
                .wrap(Wrap { trim: false }),
            text_area,
        );
        if let Some(footer) = self.footer {