Skip to content

Commit

Permalink
Fix rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
supersurviveur committed May 27, 2024
1 parent 492660d commit cf46f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/decorations/decorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export class Decorations {

let parsed = getWASM().parse_document(this.activeEditor.document.getText() as string, this.edition_state.edited_range?.start.line || -1, this.edition_state.edited_range?.end.line || -1, this.renderingMode, this.renderOutsideMath, this.renderSpaces, this.blacklistedSymbols, this.customSymbols);

// If edit_end is zero, entire doc was reparsed, remove all symbols
if (parsed.edit_end_line === 0 && parsed.edit_end_column === 0) {
this.edition_state.reload_type = -1;
}
// If edited lines aren't defined, we clear all ranges
// If they are defined, remove symbols whiwh were rendered again, and trnaslate ones after the edition
if (this.edition_state.reload_type < 0) {
Expand Down Expand Up @@ -150,7 +154,7 @@ export class Decorations {
// Remove ones that are in the reparsed range or outside the document
let document = this.activeEditor?.document;
this.allDecorations[t].ranges = this.allDecorations[t].ranges.filter(range => {
return !strictIntersection(reparsed_range, range.range) && document.lineAt(document.lineCount -1).range.end.isAfterOrEqual(range.range.end);
return !strictIntersection(reparsed_range, range.range) && document.lineAt(document.lineCount - 1).range.end.isAfterOrEqual(range.range.end);
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions typst-math-rust/coverage.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/sh

# Generate profile files
RUSTFLAGS="-C instrument-coverage" cargo test --tests
RUSTFLAGS="-C instrument-coverage -Z coverage-options=branch" cargo +nightly test --tests
cargo profdata -- merge -sparse default_*.profraw -o typst-math.profdata

# Get binary names
FILES=$( \
for file in \
$( \
RUSTFLAGS="-C instrument-coverage" \
cargo test --tests --no-run --message-format=json \
RUSTFLAGS="-C instrument-coverage -Z coverage-options=branch" \
cargo +nightly test --tests --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
); \
Expand Down

0 comments on commit cf46f34

Please sign in to comment.