Skip to content

Commit d763fde

Browse files
committed
win fix
1 parent 6b907d1 commit d763fde

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
24+
os: ["windows-latest"]
2525
rust: ["stable", "1.83"]
2626
flags: ["", "--all-features"]
2727
exclude:

crates/compilers/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,11 +911,10 @@ fn replace_source_content<'a>(
911911
let mut offset = 0;
912912
let mut content = source.as_bytes().to_vec();
913913
for (range, new_value) in updates {
914-
let start = (range.start as isize + offset) as usize;
915-
let end = (range.end as isize + offset) as usize;
914+
let update_range = utils::range_by_offset(&range, offset);
916915

917-
content.splice(start..end, new_value.bytes());
918-
offset += new_value.len() as isize - (end - start) as isize;
916+
content.splice(update_range.start..update_range.end, new_value.bytes());
917+
offset += new_value.len() as isize - (update_range.end - update_range.start) as isize;
919918
}
920919

921920
String::from_utf8(content).unwrap()

0 commit comments

Comments
 (0)