1pub use crate::inputfile::InputFile;
2pub use crate::line_range::{HighlightedLineRanges, LineRange, LineRanges};
3pub use crate::style::{StyleComponent, StyleComponents};
4pub use crate::syntax_mapping::{MappingTarget, SyntaxMapping};
5pub use crate::wrap::OutputWrap;
7#[derive(Debug, Clone, Copy, PartialEq)]
14impl Default for PagingMode {
15 fn default() -> Self {
20#[derive(Debug, Clone, Default)]
21pub struct Config<'a> {
22 /// List of files to print
23 pub files: Vec<InputFile<'a>>,
25 /// The explicitly configured language, if any
26 pub language: Option<&'a str>,
28 /// Whether or not to show/replace non-printable characters like space, tab and newline.
29 pub show_nonprintable: bool,
31 /// The character width of the terminal
32 pub term_width: usize,
34 /// The width of tab characters.
35 /// Currently, a value of 0 will cause tabs to be passed through without expanding them.
38 /// Whether or not to simply loop through all input (`cat` mode)
39 pub loop_through: bool,
41 /// Whether or not the output should be colorized
42 pub colored_output: bool,
44 /// Whether or not the output terminal supports true color
47 /// Style elements (grid, line numbers, ...)
48 pub style_components: StyleComponents,
50 /// Text wrapping mode
51 pub output_wrap: OutputWrap,
54 pub paging_mode: PagingMode,
56 /// Specifies the lines that should be printed
57 pub line_ranges: LineRanges,
59 /// The syntax highlighting theme
62 /// File extension/name mappings
63 pub syntax_mapping: SyntaxMapping<'a>,
65 /// Command to start the pager
66 pub pager: Option<&'a str>,
68 /// Whether or not to use ANSI italics
69 pub use_italic_text: bool,
71 /// Ranges of lines which should be highlighted with a special background color
72 pub highlighted_lines: HighlightedLineRanges,
74 /// Names of files to display when printing
75 pub filenames: Option<Vec<&'a str>>,
79fn default_config_should_include_all_lines() {
80 use crate::line_range::RangeCheckResult;
83 Config::default().line_ranges.check(17),
84 RangeCheckResult::InRange
89fn default_config_should_highlight_no_lines() {
90 use crate::line_range::RangeCheckResult;
93 Config::default().highlighted_lines.0.check(17),
94 RangeCheckResult::InRange
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list