.cargo/
crates/
brain/
diff/
benches/
src/
bin/
themes/
viewer/
builtins.rs
13.4 KiB
commit.rs
7.0 KiB
context.rs
10.1 KiB
decode.rs
32.8 KiB
decorate.rs
4.2 KiB
document.rs
25.0 KiB
encode.rs
4.9 KiB
highlight.rs
24.4 KiB
highlighter.rs
12.4 KiB
lib.rs
2.0 KiB
status.rs
2.0 KiB
viewer.rs
191.2 KiB
word.rs
16.8 KiB
tests/
Cargo.toml
867 B
README.md
696 B
files/
highlight/
repo/
signals/
tui/
tui-core/
tui-termion/
tui-widgets/
scripts/
src/
.gitignore
30 B
.gitsigners
198 B
AGENTS.md
1.9 KiB
CONTRIBUTING
1.7 KiB
Cargo.lock
5.4 KiB
Cargo.toml
1.9 KiB
LICENSE
1.1 KiB
README.md
245 B
STYLE
3.7 KiB
clippy.toml
213 B
crates/diff/src/lib.rs
raw
| 1 | //! Unified diff parsing and terminal-buffer viewing. |
| 2 | //! |
| 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 | //! [`rustik_tui::Buffer`]. Backend access is abstracted behind the |
| 6 | //! [`rustik_repo::DiffRepository`] trait so the viewer stays testable. The `rustik-diff` |
| 7 | //! binary owns stdin/stdout, terminals, and events. |
| 8 | //! |
| 9 | //! The optional `builtins` feature (on by default) bundles default highlighting |
| 10 | //! assets ([`Builtins`]) and a background worker ([`spawn_highlighter`]) so |
| 11 | //! hosts get a batteries-included viewer; disable it to bring your own. |
| 12 | #![deny(unsafe_code)] |
| 13 | #![warn(missing_docs)] |
| 14 | #![warn(clippy::unwrap_used)] |
| 15 | |
| 16 | #[cfg(feature = "builtins")] |
| 17 | mod builtins; |
| 18 | mod commit; |
| 19 | mod context; |
| 20 | mod decorate; |
| 21 | mod document; |
| 22 | mod highlight; |
| 23 | #[cfg(feature = "builtins")] |
| 24 | mod highlighter; |
| 25 | mod status; |
| 26 | mod viewer; |
| 27 | mod word; |
| 28 | |
| 29 | pub mod decode; |
| 30 | pub mod encode; |
| 31 | |
| 32 | #[cfg(feature = "builtins")] |
| 33 | pub use builtins::Builtins; |
| 34 | pub use commit::{CommitHeader, Header, ParseCommitError}; |
| 35 | pub use context::ContextChange; |
| 36 | pub use decode::Decode; |
| 37 | pub use decorate::{DiffDecorator, FileDecoration, HunkDecoration, ReviewProgress}; |
| 38 | pub use document::{ |
| 39 | DecodeError, DiffDocument, DiffLine, DiffLineKind, FileDiff, FileHeader, FileId, FileKind, |
| 40 | FileMode, FileStats, Hunk, HunkHeader, HunkId, Oid, OidError, RowId, Stats, |
| 41 | }; |
| 42 | pub use encode::Encode; |
| 43 | pub use highlight::{ |
| 44 | BuiltinHighlighter, DiffHighlighter, DiffSide, HighlightKey, HighlightKeyInput, |
| 45 | HighlightRequest, HighlightResult, HighlightSource, |
| 46 | }; |
| 47 | #[cfg(feature = "builtins")] |
| 48 | pub use highlighter::{HighlightOutput, Highlighter, spawn_highlighter}; |
| 49 | pub use status::{ |
| 50 | REVIEW_PROGRESS_BAR_GLYPH, diffstat, file_count, full_progress_bar, progress_bar, |
| 51 | recoverable_error, |
| 52 | }; |
| 53 | pub use viewer::{ |
| 54 | ContextRequest, ContextUpdate, DiffAction, DiffFocus, DiffOptions, DiffPalette, DiffState, |
| 55 | DiffViewer, FileTree, FileTreeMode, FileTreeTarget, HunkFocus, ViewChange, |
| 56 | }; |