(&self, frame: &mut Frame, area: Rect, theme: &Theme)
| 203 | } |
| 204 | |
| 205 | pub fn render(&self, frame: &mut Frame, area: Rect, theme: &Theme) { |
| 206 | if self.lines.is_empty() { |
| 207 | let empty = Paragraph::new("No changes") |
| 208 | .block(Block::default().title(" Diff ").borders(Borders::ALL)) |
| 209 | .style(Style::default().fg(theme.text_muted)); |
| 210 | frame.render_widget(empty, area); |
| 211 | return; |
| 212 | } |
| 213 | |
| 214 | let width = area.width as usize; |
| 215 | |
| 216 | if self.mode == DiffMode::Split && width > 120 { |
| 217 | self.render_split(frame, area, theme); |
| 218 | } else { |
| 219 | self.render_unified(frame, area, theme, width); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | fn render_unified(&self, frame: &mut Frame, area: Rect, theme: &Theme, width: usize) { |
| 224 | let mut lines = Vec::new(); |
nothing calls this directly
no test coverage detected