1.2.0
Unified cross-mode undo/redo. Tree mode and source mode now share a single 100-deep text-based history. Cmd/Ctrl+Z and Cmd/Ctrl+Shift+Z work in both modes; switching between tree and source no longer wipes the undo stack.
Changed
- Unified history: every change — tree-mode mutation or source-mode text edit — pushes the pre-state TEXT onto a single shared stack. Undo/redo restore that text and refresh the active mode.
- Mode-switch no longer clears the undo history.
- Source mode no longer keeps a separate CodeMirror-local undo stack; the unified history captures every doc change. Trade-off:
Cmd+Zin source mode now undoes peronChangeevent (roughly per keystroke) rather than via CodeMirror's character-grouping heuristic. In practice this is similar granularity.
Internal
Historyis now generic (History<T>).JsonFileViewusesHistory<string>instead of the previous tree-onlyHistory<HistoryState>. The oldHistoryStateinterface is gone; the new API takes and returns the rawT.- Plugin command IDs renamed:
undo-tree-edit→undo-edit,redo-tree-edit→redo-edit. Hotkey bindings are unchanged. - 4 new integration tests in
JsonFileView.undo.test.tscovering source-mode undo, source→tree cross-mode undo, tree→source cross-mode undo, and the canUndo / canRedo mode-independence guarantee. - Test count: 369 → 373 (existing tree-history tests reused as-is via generic typing).