add syntax highlighter to untracked files contents

[?]
Apr 24, 2025, 8:07 PM
B4RMW5AEGAJX5CFC4RFPI6Y3NBSDM7GZKNBPPTTICRZSDZSYNXHQC

Dependencies

  • [2] 6YZAVBWU Initial commit
  • [3] IQDCHWCP load a pijul repo
  • [4] SWWE2R6M display basic repo stuff
  • [5] UB2ITZJS refresh changed files on FS changes
  • [6] KT5UYXGK fix selection after adding file, add changed file diffs
  • [7] YBJRDOTC make all repo actions async
  • [8] 2VUX5BTD load identity
  • [9] A5YBC77V record!
  • [10] 4WO3ZJM2 show untracked files' contents
  • [11] PTFDJ567 add untracked files encoding
  • [12] AMPZ2BXK show changed files diffs (only Edit atm)
  • [13] AXSXZQDG fix updating changed file contents, styling
  • [14] V55EAIWQ add src file LRU cache
  • [15] ZONPDYO7 wrap untracked files' contents on word or glyph
  • [16] S2NVIFXR allow to enter record msg
  • [17] Z2CJPWZE focus record message text_editor on spawn
  • [18] W4LFX7IH group diffs by file name
  • [19] WT3GA27P add cursor with selection
  • [20] BJXUYQ2Y show untracked file contents in read-only text editor

Change contents

  • replacement in crates/inflorescence/src/main.rs at line 3
    [12.1220][14.22:58]()
    use clru::{CLruCache, WeightScale};
    [12.1220]
    [4.4814]
    use core::str;
    use std::collections::BTreeMap;
    use std::num::NonZero;
    use std::path::PathBuf;
    use std::sync::Arc;
    use std::{cmp, ffi};
  • edit in crates/inflorescence/src/main.rs at line 14
    [12.1315][10.1478:1507](),[8.496][10.1478:1507]()
    use tokio_stream::StreamExt;
  • replacement in crates/inflorescence/src/main.rs at line 15
    [3.1025][10.1508:1523]()
    use core::str;
    [3.1025]
    [12.1316]
    use clru::{CLruCache, WeightScale};
  • replacement in crates/inflorescence/src/main.rs at line 18
    [13.34][13.34:109]()
    font, Border, Color, Element, Font, Length, Subscription, Task, Theme,
    [13.34]
    [13.109]
    font, highlighter, Border, Color, Element, Font, Length, Subscription,
    Task, Theme,
  • edit in crates/inflorescence/src/main.rs at line 25
    [5.351][6.4600:4614](),[6.4614][12.1395:1427](),[12.1427][14.59:82](),[14.82][5.351:375](),[12.1427][5.351:375](),[6.4614][5.351:375](),[7.4708][5.351:375](),[5.351][5.351:375](),[5.375][9.4511:4531]()
    use std::cmp;
    use std::collections::BTreeMap;
    use std::num::NonZero;
    use std::path::PathBuf;
    use std::sync::Arc;
  • edit in crates/inflorescence/src/main.rs at line 29
    [7.4810]
    [2.2834]
    use tokio_stream::StreamExt;
  • edit in crates/inflorescence/src/main.rs at line 1111
    [10.8696]
    [14.6469]
  • replacement in crates/inflorescence/src/main.rs at line 1114
    [14.6608][11.1878:1994](),[11.1878][11.1878:1994](),[11.1994][15.22:86](),[15.86][14.6609:6720](),[11.2020][14.6609:6720]()
    FileEditorContent::Decoded(content) => el(text_editor(
    content,
    ).wrapping(text::Wrapping::WordOrGlyph)
    .on_action(|action| Message::UntrackedFileContentsAction{path: path.clone(),action})),
    [14.6608]
    [11.2021]
    FileEditorContent::Decoded(content) => {
    let path_buf = PathBuf::from(path);
    let file_ext = path_buf.extension().and_then(ffi::OsStr::to_str);
    let editor = text_editor(content)
    .wrapping(text::Wrapping::WordOrGlyph)
    .on_action(|action|
    Message::UntrackedFileContentsAction{path: path.clone(), action}
    );
    if let Some(file_ext) = file_ext {
    el(editor
    .highlight(file_ext, highlighter::Theme::SolarizedDark))
    } else {
    el(editor)
    }
    },