binocular-cli 0.2.3

Not exactly a telescope, but it's useful sometimes. TUI to search/navigate through files and workspaces.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::ansi::parse_ansi_text;
use crate::preview::PreviewContent;
use crate::search::sources::git::read_branch_preview;
use ratatui::text::Text;

pub(crate) fn build_git_branch_preview(repo_root: &str, branch: &str) -> PreviewContent {
    match read_branch_preview(std::path::Path::new(repo_root), branch) {
        Ok(text) => PreviewContent::PlainText(parse_ansi_text(text)),
        Err(err) => {
            PreviewContent::PlainText(Text::from(format!("Failed to load branch preview: {err}")))
        }
    }
}