MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / render

Method render

crates/opencode-tui/src/components/diff.rs:205–221  ·  view source on GitHub ↗
(&self, frame: &mut Frame, area: Rect, theme: &Theme)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
is_emptyMethod · 0.80
render_splitMethod · 0.80
render_unifiedMethod · 0.80
titleMethod · 0.45

Tested by

no test coverage detected