diff: Rename renderer to viewer

f142ff5ea04992c6ffbe900c5c49833512a4a4c5
Alexis Sellier committed ago 1 parent 98f722c7
crates/diff/Cargo.toml +1 -1
1 1
[package]
2 2
name = "rustik-diff"
3 -
description = "Pure diff renderer and Git diff pager for Rustik."
3 +
description = "Pure diff viewer and Git diff pager for Rustik."
4 4
documentation = "https://docs.rs/rustik-diff"
5 5
homepage = "https://crates.io/crates/rustik-diff"
6 6
version.workspace = true
7 7
edition.workspace = true
8 8
license.workspace = true
crates/diff/README.md +1 -1
1 1
# rustik-diff
2 2
3 -
Pure unified-diff parsing and terminal-buffer rendering for Rustik.
3 +
Pure unified-diff parsing and terminal-buffer viewing for Rustik.
4 4
5 5
## Git
6 6
7 7
Build or install the `rustik-diff` binary, then configure Git to use it for
8 8
diff-like commands:
crates/diff/src/lib.rs +5 -5
1 -
//! Unified diff parsing and terminal-buffer rendering.
1 +
//! Unified diff parsing and terminal-buffer viewing.
2 2
//!
3 -
//! The viewer and renderer are intentionally I/O-free: they parse or accept
4 -
//! patch data, own read-only viewer state, and write frames into a
3 +
//! The viewer is intentionally I/O-free: it parses or accepts patch data,
4 +
//! owns read-only viewer state, and writes frames into a
5 5
//! [`rustik_tui::Buffer`]. Backend access is abstracted behind the
6 6
//! [`rustik_repo::Repo`] trait so the viewer stays testable. The `rustik-diff`
7 7
//! binary owns stdin/stdout, terminals, events, and background workers.
8 8
#![deny(unsafe_code)]
9 9
#![warn(missing_docs)]
11 11
12 12
mod commit;
13 13
mod context;
14 14
mod document;
15 15
mod highlight;
16 -
mod renderer;
16 +
mod viewer;
17 17
mod word;
18 18
19 19
pub mod decode;
20 20
pub mod encode;
21 21
28 28
pub use encode::Encode;
29 29
pub use highlight::{
30 30
    BuiltinHighlighter, DiffSide, HighlightKey, HighlightKeyInput, HighlightRequest,
31 31
    HighlightResult, HighlightSource,
32 32
};
33 -
pub use renderer::{
33 +
pub use viewer::{
34 34
    ContextError, DiffAction, DiffFocus, DiffOptions, DiffPalette, DiffPane, DiffState, DiffViewer,
35 35
    FileSelection, FileTreeMode, FileTreeTarget, ViewChange,
36 36
};
crates/diff/src/renderer.rs → crates/diff/src/viewer.rs renamed +2 -2
1 -
//! Read-only diff viewer state and buffer renderer.
1 +
//! Read-only diff viewer state and buffer rendering.
2 2
3 3
mod tree;
4 4
5 5
use std::collections::btree_map::Entry;
6 6
use std::collections::{BTreeMap, BTreeSet};
25 25
    FileKind, HighlightKey, HighlightRequest, HighlightSource, Hunk, HunkId, RowId,
26 26
};
27 27
28 28
pub use tree::{FileSelection, FileTreeMode, FileTreeTarget};
29 29
30 -
/// Minimum width before the renderer attempts table-style diff rows.
30 +
/// Minimum width before the viewer attempts table-style diff rows.
31 31
const MIN_RENDER_COLS: usize = 12;
32 32
/// Width of old and new line number cells.
33 33
const LINE_NUMBER_WIDTH: usize = 5;
34 34
/// Foreground color used by old and new line number cells.
35 35
const LINE_NUMBER_FG: Color = colors::fixed::DIM;
a.rs +0 -0
a.rs +0 -0
b.rs +0 -0
a.rs +0 -0
a.rs +0 -0
a.rs +0 -0
b.rs +0 -0
src/a.rs +0 -0
src/b.rs +0 -0
README.md +0 -0
a.rs +0 -0
a.rs +0 -0
a.rs +0 -0
a.rs +0 -0
b.rs +0 -0
crates/diff/src/renderer/tree.rs → crates/diff/src/viewer/tree.rs renamed +0 -0
src/lib.rs +1 -1
9 9
#![warn(clippy::unwrap_used)]
10 10
11 11
/// Re-export of the facade crate.
12 12
pub use rustik_tui as tui;
13 13
14 -
/// Re-export of the unified diff parser and renderer crate.
14 +
/// Re-export of the unified diff parser and viewer crate.
15 15
#[cfg(feature = "diff")]
16 16
pub use rustik_diff as diff;
17 17
18 18
/// Re-export of the TextMate grammar parser and highlighter crate.
19 19
#[cfg(feature = "highlight")]