#6629 Make undo redo work without code pane being open (#7511)

* move useHotkey for undo/redo into App

* _editorView should be private

* get editorView should be a real get method for consistency

* resolve tsc errors

* fmt

* setView, setState are not exposed

* make undo work without editorview when kcl pane is closed

* lint

* circular deps

* resolve circular deps

* fix undo being 1 step late

* unrelated console.warn removed

* fix undo when code pane is closed during editing

* cleanup

* allow undo to get beyond when code editor has been mounted

* fix up clearHistory

* add test for testing  Undo with closed code pane
This commit is contained in:
Andrew Varga
2025-06-19 13:26:51 +02:00
committed by GitHub
parent 92f930dfc0
commit d02a9f59ae
19 changed files with 234 additions and 78 deletions

View File

@ -509,7 +509,7 @@ export async function promptToEditFlow({
const ranges: SelectionRange[] = diff.insertRanges.map((range) =>
EditorSelection.range(range[0], range[1])
)
editorManager?.editorView?.dispatch({
editorManager?.getEditorView()?.dispatch({
selection: EditorSelection.create(
ranges,
selections.graphSelections.length - 1