Fix: Properly setting selection range when KCL editor is not mounted. (#4960)

* fix: fixed selection range issue when doing a constraint when the KCL editor is closed

* fix: linter and tsc errors

* fix: trying to reuse logic instead?

* fix: removed console log
This commit is contained in:
Kevin Nadro
2025-01-23 09:45:45 -05:00
committed by GitHub
parent 8d9dbf36c3
commit 20016b101e
2 changed files with 26 additions and 13 deletions

View File

@ -388,7 +388,16 @@ export const ModelingMachineProvider = ({
}
if (setSelections.selectionType === 'completeSelection') {
editorManager.selectRange(setSelections.selection)
const codeMirrorSelection = editorManager.createEditorSelection(
setSelections.selection
)
kclEditorActor.send({
type: 'setLastSelectionEvent',
data: {
codeMirrorSelection,
scrollIntoView: false,
},
})
if (!sketchDetails)
return {
selectionRanges: setSelections.selection,