A simple CPU rendered GUI IDE experience.
unbyte inlays
bendn 4 weeks ago
parent e43847b · commit b78e20d
-rw-r--r--src/rnd.rs4
-rw-r--r--src/text.rs10
2 files changed, 4 insertions, 10 deletions
diff --git a/src/rnd.rs b/src/rnd.rs
index 3f185d8..1717021 100644
--- a/src/rnd.rs
+++ b/src/rnd.rs
@@ -768,7 +768,7 @@ pub fn simplify_path(x: &str) -> String {
static DEP: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"\.cargo\/git\/checkouts\/(?<name>[^/]+)\-[a-f0-9]+\/[a-f0-9]+").unwrap());
static DEP2: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"\.cargo\/registry\/src/index.crates.io-[0-9a-f]+/(?<name>[^/]+)\-(?<version>[0-9]+\.[0-9]+\.[0-9]+)").unwrap());
static RUST_SRC: LazyLock<Regex> = LazyLock::new(|| Regex::new(r".rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library").unwrap());
- let x = x.replace(env!("HOME"), " ");
+ let x = x.replace(env!("HOME"), "");
[
(&*RUST_SRC, " "),
(&*DEP, " /$name"),
@@ -776,4 +776,4 @@ pub fn simplify_path(x: &str) -> String {
].into_iter().fold(x, |acc, (r, repl)| {
r.replace(&acc, repl).into_owned()
})
-} \ No newline at end of file
+}
diff --git a/src/text.rs b/src/text.rs
index 1355d7c..76fd7f5 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -367,14 +367,8 @@ impl TextArea {
if i.padding_right == Some(true) {
label.push((' ', None));
}
- (
- Mark {
- relpos: i.position.character as _,
- ty: INLAY,
- l: label.into(),
- },
- i.position.line,
- )
+ let p = self.l_pos_to_char(i.position).unwrap();
+ (Mark { relpos: p.0, ty: INLAY, l: label.into() }, p.1)
})
.chunk_by(|x| x.1)
.into_iter()