Skip to main content

sample_text/
sample_text.rs

1use txtview::{TxtView, TxtViewConfig};
2
3fn main() -> std::io::Result<()> {
4    let text = (1..=100)
5        .map(|i| format!("Line {:>3}: The quick brown fox jumps over the lazy dog", i))
6        .collect::<Vec<String>>()
7        .join("\n");
8
9    let config = TxtViewConfig {
10        show_line_numbers: true,
11        ..TxtViewConfig::default()
12    };
13
14    let mut viewer = TxtView::new(&text).with_config(config);
15    viewer.run()
16}