After a sketch keep the extrude button active (#2961)

* After a sketch keep the extrude button active

* add test

* Compare to 0,0 not any x,x or y,y

---------

Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
This commit is contained in:
49fl
2024-07-10 10:08:15 -04:00
committed by GitHub
parent 73e26cbb4d
commit 3160c58d8a
3 changed files with 57 additions and 0 deletions

View File

@ -360,6 +360,14 @@ export function isSelectionLastLine(
return selectionRanges.codeBasedSelections[i].range[1] === code.length
}
export function isRangeInbetweenCharacters(selectionRanges: Selections) {
return (
selectionRanges.codeBasedSelections.length === 1 &&
selectionRanges.codeBasedSelections[0].range[0] === 0 &&
selectionRanges.codeBasedSelections[0].range[1] === 0
)
}
export type CommonASTNode = {
selection: Selection
ast: Program