feat(undo): use Y.UndoManager for collaborative Ctrl+Z, fix ASAR activation on VS Code 1.130 - #17
Open
ChenyuHeee wants to merge 1 commit into
Open
feat(undo): use Y.UndoManager for collaborative Ctrl+Z, fix ASAR activation on VS Code 1.130#17ChenyuHeee wants to merge 1 commit into
ChenyuHeee wants to merge 1 commit into
Conversation
ChenyuHeee
force-pushed
the
fix/issue-7-undo-redo
branch
from
August 6, 2026 08:28
594b9bf to
bf46cdc
Compare
…ermanx#7, kermanx#16) - Use Y.UndoManager with trackedOrigins for per-user collaborative undo - Intercept Ctrl+Z/Ctrl+Shift+Z via keybindings with native fallback - Fix extension activation on VS Code >= 1.130 where node-pty is bundled inside node_modules.asar — add three-tier path fallback - Add tests: Y.UndoManager behavior (4 tests) + resolveAsset paths (4 tests)
ChenyuHeee
force-pushed
the
fix/issue-7-undo-redo
branch
from
August 6, 2026 08:31
bf46cdc to
c05b457
Compare
Owner
|
感谢 PR~
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
1. Ctrl+Z 协同撤销 (#7)
之前 VS Code 原生 range-based undo 在并发编辑时可能删错 CRDT items,且远程变更会污染本地的撤销栈。
改用 Y.UndoManager 做 per-user undo:
common.ts— 每个 Y.Doc 创建 UndoManager(trackedOrigins只追踪本地变更)p2p-live-share:inSession时),无 UndoManager 时自动 fallback 到原生 undo2. VS Code 1.130 激活崩溃 (#16)
VS Code 1.130 (Electron 42) 将
node-pty打包在node_modules.asar中,fs.existsSync无法检测。改为三层 fallback:node_modules/路径(旧版 VS Code / 开发环境)node_modules.asar.unpacked/路径(原生二进制模块)node_modules.asar/路径(Electron require 透明处理)测试
src/fs/undo-manager.test.ts(4 个 Y.UndoManager 并发编辑测试)src/terminal/pty/shims/utils.test.ts(4 个路径解析测试)Closes #7, Closes #16