mirror of
https://github.com/neovim/neovim.git
synced 2026-08-20 14:21:06 +00:00
Merge pull request #40772 from Rawan10101/wasm-browser
feat(wasm-emcc): add browser support for Neovim
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user