summaryrefslogtreecommitdiff
path: root/crates/typst-ide/src/tests.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-06-10 20:13:33 +0200
committerGitHub <noreply@github.com>2025-06-10 18:13:33 +0000
commit98034903e4184708dbaf3cf6b23a4f4de5e910ec (patch)
tree449ded5f9157587720ee6cdf656b18a121db4a74 /crates/typst-ide/src/tests.rs
parenta6ab6ac99a3db30d833f60e59959785f60fdc853 (diff)
Adjust source file API surface (#6423)
Diffstat (limited to 'crates/typst-ide/src/tests.rs')
-rw-r--r--crates/typst-ide/src/tests.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/typst-ide/src/tests.rs b/crates/typst-ide/src/tests.rs
index c6d733ca..1176e460 100644
--- a/crates/typst-ide/src/tests.rs
+++ b/crates/typst-ide/src/tests.rs
@@ -228,7 +228,7 @@ impl FilePos for (&str, isize) {
#[track_caller]
fn cursor(source: &Source, cursor: isize) -> usize {
if cursor < 0 {
- source.len_bytes().checked_add_signed(cursor + 1).unwrap()
+ source.text().len().checked_add_signed(cursor + 1).unwrap()
} else {
cursor as usize
}