diff --git a/src/actions/enter.ts b/src/actions/enter.ts index a61afb77..488f5d79 100644 --- a/src/actions/enter.ts +++ b/src/actions/enter.ts @@ -22,6 +22,7 @@ import type { import * as Constants from '../constants'; import type {Navigation} from '../navigation'; +import {Mover} from './mover'; const KeyCodes = BlocklyUtils.KeyCodes; @@ -29,7 +30,10 @@ const KeyCodes = BlocklyUtils.KeyCodes; * Class for registering a shortcut for the enter action. */ export class EnterAction { - constructor(private navigation: Navigation) {} + constructor( + private mover: Mover, + private navigation: Navigation, + ) {} /** * Adds the enter action shortcut to the registry. @@ -149,6 +153,8 @@ export class EnterAction { this.navigation.focusWorkspace(workspace); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion workspace.getCursor()?.setCurNode(ASTNode.createBlockNode(newBlock)!); + + this.mover.startMove(workspace); } /** diff --git a/src/navigation_controller.ts b/src/navigation_controller.ts index f64b247b..3594ee21 100644 --- a/src/navigation_controller.ts +++ b/src/navigation_controller.ts @@ -70,7 +70,7 @@ export class NavigationController { exitAction: ExitAction = new ExitAction(this.navigation); - enterAction: EnterAction = new EnterAction(this.navigation); + enterAction: EnterAction = new EnterAction(this.mover, this.navigation); actionMenu: ActionMenu = new ActionMenu(this.navigation);