rerender method

GitDiffModel rerender()

Re-renders the existing parsed files with the current configuration.

Use this after changing display options (viewMode, showLineNumbers, wrapLines, styles) via copyWith to rebuild the rendered lines and viewport without re-parsing the diff.

Implementation

GitDiffModel rerender() {
  if (_files.isEmpty) return this;
  final rendered = _renderLines(_files);
  final newViewport = _viewport.copyWith(
    width: width,
    height: height,
    lines: rendered,
  );
  return copyWith(renderedLines: rendered, viewport: newViewport);
}