merge #1057: perf(sidebar): 页签内容的会话 scope 改为按内容稳定,消除无关重渲染导致的整文件重读
This commit is contained in:
commit
01a6fa573b
16 files changed
+300
-39
No files matched your search
@@ -202,8 +202,8 @@ export function TextEditor(props: FileViewerProps) {
|
||||
/** Bumped by every save: the uncommitted diff moved while the file's git
|
||||
* status entry (which only tracks its XY code) did not. */
|
||||
const [gitRevision, setGitRevision] = useState(0)
|
||||
/** The view-side identity of the gutter's git source (stable across the
|
||||
* scope object's per-render identity churn). */
|
||||
/** The view-side identity of the gutter's git source: rebuilt only when a
|
||||
* field it reads actually moves. */
|
||||
const gitHost = useMemo<GitGutterHost>(
|
||||
() => ({ scope: { sessionId: scope.sessionId, cwd: scope.cwd, repoRoot: scope.repoRoot }, path }),
|
||||
[scope.sessionId, scope.cwd, scope.repoRoot, path],
|
||||
|
||||
Reference in new issue
Block a user