Skip to content

Commit

Permalink
add background squares to tui wgpu backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Kl4rry committed Dec 3, 2024
1 parent ff5a27d commit 644b480
Show file tree
Hide file tree
Showing 8 changed files with 477 additions and 62 deletions.
102 changes: 77 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions crates/ferrite-core/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,11 @@ impl Buffer {
let mut width = 0;
let mut byte_idx = 0;
for grapeheme in next_line.grapehemes() {
width += grapeheme.width(width);
byte_idx += grapeheme.len_bytes();
if width >= before_cursor {
break;
}
width += grapeheme.width(width);
byte_idx += grapeheme.len_bytes();
}
next_line_start + byte_idx
};
Expand Down Expand Up @@ -749,11 +749,11 @@ impl Buffer {
let mut width = 0;
let mut byte_idx = 0;
for grapeheme in next_line.grapehemes() {
width += grapeheme.width(width);
byte_idx += grapeheme.len_bytes();
if width >= before_cursor {
break;
}
width += grapeheme.width(width);
byte_idx += grapeheme.len_bytes();
}
next_line_start + byte_idx
};
Expand Down Expand Up @@ -2047,11 +2047,11 @@ impl Buffer {
let mut width = 0;
let mut byte_idx = 0;
for grapeheme in next_line.grapehemes() {
width += grapeheme.width(width);
byte_idx += grapeheme.len_bytes();
if width >= col {
break;
}
width += grapeheme.width(width);
byte_idx += grapeheme.len_bytes();
}
self.views[view_id].cursors[cursor_index].position = next_line_start + byte_idx;
}
Expand Down
6 changes: 4 additions & 2 deletions crates/ferrite-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ edition = "2021"

[dependencies]
anyhow = { workspace = true }
bytemuck = "1.20.0"
cgmath = "0.18.0"
cosmic-text = { version = "0.12.1", features = ["shape-run-cache"] }
crevice = { version = "0.17.0", features = ["cgmath"] }
ferrite-cli = { workspace = true }
ferrite-core = { workspace = true }
ferrite-tui = { workspace = true }
ferrite-utility = { workspace = true }
glyphon = "0.7.0"
pollster = "0.3.0"
cosmic-text = { version = "0.12.1", features = ["shape-run-cache"] }
tracing = { workspace = true }
tui = { workspace = true, default-features = false }
unicode-width = { workspace = true }
wgpu = "23.0.0"
wgpu = { version = "23.0.0", features = ["glsl"] }
winit = "0.29.15"
Loading

0 comments on commit 644b480

Please sign in to comment.