Merge pull request #40772 from Rawan10101/wasm-browser

feat(wasm-emcc): add browser support for Neovim
This commit is contained in:
bfredl
2026-08-04 12:11:17 +02:00
committed by GitHub
14 changed files with 1757 additions and 189 deletions

View File

@@ -445,7 +445,7 @@ list(APPEND UNCRUSTIFY_NVIM_SOURCES ${NVIM_SOURCES} ${NVIM_HEADERS})
list(APPEND UNCRUSTIFY_NVIM_SOURCES
${PROJECT_SOURCE_DIR}/src/tee/tee.c
${PROJECT_SOURCE_DIR}/src/xxd/xxd.c
${PROJECT_SOURCE_DIR}/src/wasm_stubs.c
${PROJECT_SOURCE_DIR}/src/wasm/wasm_stubs.c
${PROJECT_SOURCE_DIR}/src/static_ts_registry.c
)

View File

@@ -80,8 +80,13 @@ int wstream_write(Stream *stream, WBuffer *buffer)
uv_fs_t req;
// Synchronous write
err = uv_fs_write(stream->uv.idle.loop, &req, stream->fd, &uvbuf, 1, stream->fpos, NULL);
#ifdef __EMSCRIPTEN__
// Pass -1 so the write uses the current file position.
err = uv_fs_write(stream->uv.idle.loop, &req, stream->fd, &uvbuf, 1, -1, NULL);
#else
err = uv_fs_write(stream->uv.idle.loop, &req, stream->fd, &uvbuf, 1, stream->fpos, NULL);
#endif
uv_fs_req_cleanup(&req);
wstream_release_wbuffer(buffer);