Skip to content

Commit e18682c

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-33625
2 parents 7cbf20e + 53bcb9a commit e18682c

52 files changed

Lines changed: 152769 additions & 80382 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/mobile/modules/t3-highlights/Vendor/highlights/highlights.c‎

Lines changed: 151088 additions & 77815 deletions
Large diffs are not rendered by default.

‎apps/mobile/modules/t3-highlights/Vendor/highlights/highlights.h‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by apps/mobile/scripts/generate-highlights.mts from @pierre/highlights 0.2.0 (highlights.wasm sha256 cf5fc4d83e7c1ddab19d163de096f787f87efe61504909aa469434f61ef51e2e). Do not edit. */
1+
/* Generated by apps/mobile/scripts/generate-highlights.mts from @pierre/highlights 0.5.0 (highlights.wasm sha256 2fca61b661e57cb341d9ca1703780dab628f29594fee66c2919d0a0032b11290). Do not edit. */
22
/* Automatically generated by wasm2c */
33
#ifndef HIGHLIGHTS_H_GENERATED_
44
#define HIGHLIGHTS_H_GENERATED_
@@ -40,7 +40,7 @@ typedef struct w2c_highlights {
4040
u32 w2c_g8;
4141
u32 w2c_g9;
4242
u32 w2c_g10;
43-
u64 w2c_g11;
43+
u32 w2c_g11;
4444
u32 w2c_g12;
4545
u32 w2c_g13;
4646
u32 w2c_g14;
@@ -93,7 +93,7 @@ typedef struct w2c_highlights {
9393
u32 w2c_g61;
9494
u32 w2c_g62;
9595
u32 w2c_g63;
96-
u32 w2c_g64;
96+
u64 w2c_g64;
9797
u32 w2c_g65;
9898
u32 w2c_g66;
9999
u32 w2c_g67;
@@ -153,6 +153,11 @@ typedef struct w2c_highlights {
153153
u32 w2c_g121;
154154
u32 w2c_g122;
155155
u32 w2c_g123;
156+
u32 w2c_g124;
157+
u32 w2c_g125;
158+
u32 w2c_g126;
159+
u32 w2c_g127;
160+
u32 w2c_g128;
156161
wasm_rt_memory_t w2c_memory;
157162
wasm_rt_funcref_table_t w2c_T0;
158163
} w2c_highlights;

‎apps/mobile/modules/t3-highlights/cpp/t3_highlights.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
// The control block and buffer layout mirror the JavaScript glue in
1010
// @pierre/highlights (`HighlightsHighlighter` in dist/highlighter.js).
11-
#define INPUT_OFFSET WASM_DEFAULT_PAGE_SIZE
11+
// INPUT_OFFSET is its `inputPtr`: the lexers' static data ends there.
12+
#define INPUT_OFFSET 81920u
1213
#define INPUT_PADDING 96u
1314
#define MODE_UTF16_LINE_RECORDS 3u
1415
// Like the JavaScript glue, a small input after a large one gets a fresh
@@ -107,7 +108,9 @@ int64_t t3_highlights_tokenize(const uint8_t* source, size_t length, uint8_t lan
107108
ensure_instance();
108109

109110
wasm_rt_memory_t* memory = w2c_highlights_memory(&instance);
110-
uint64_t needed_pages = 1 + (length + INPUT_PADDING + WASM_DEFAULT_PAGE_SIZE - 1) / WASM_DEFAULT_PAGE_SIZE;
111+
uint64_t needed_pages =
112+
((uint64_t)INPUT_OFFSET + length + INPUT_PADDING + WASM_DEFAULT_PAGE_SIZE - 1) /
113+
WASM_DEFAULT_PAGE_SIZE;
111114
if (needed_pages > memory->pages &&
112115
wasm_rt_grow_memory(memory, needed_pages - memory->pages) == (uint64_t)-1) {
113116
return -1;

‎apps/mobile/src/features/review/reviewModel.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,9 @@ export function buildReviewParsedDiff(
609609
try {
610610
const cacheKey = buildPatchCacheKey(text, cacheScope);
611611
const patchId = getReviewPatchId(cacheKey);
612-
const parsedPatches = runDiffParserSilently(() => parsePatchFiles(text, cacheKey));
612+
const parsedPatches = runDiffParserSilently(() =>
613+
parsePatchFiles(text, { cacheKeyPrefix: cacheKey }),
614+
);
613615
const rawFiles = new Map<string, string | null>();
614616
if (!truncated) {
615617
for (const rawFile of text.split(/(?=^diff --git )/m)) {

0 commit comments

Comments
 (0)