ratatui_toolkit/widgets/code_diff/foundation/enums/diff_style.rs
1//! Diff display style enumeration.
2//!
3//! Represents the layout style for displaying diffs.
4
5/// Represents the display style for a diff view.
6///
7/// Determines how the diff is laid out in the terminal.
8///
9/// # Example
10///
11/// ```rust
12/// use ratatui_toolkit::code_diff::DiffStyle;
13///
14/// let style = DiffStyle::SideBySide;
15/// assert!(matches!(style, DiffStyle::SideBySide));
16/// ```
17#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
18pub enum DiffStyle {
19 /// Side-by-side display with old version on the left and new version on the right.
20 /// This is the default style, similar to VS Code's diff viewer.
21 #[default]
22 SideBySide,
23
24 /// Unified diff display where changes are shown inline.
25 /// Removed lines appear above added lines.
26 Unified,
27
28 /// Inline diff where changes are highlighted within lines.
29 /// Useful for seeing character-level changes.
30 Inline,
31}