Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/actions/enter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ import type {

import * as Constants from '../constants';
import type {Navigation} from '../navigation';
import {Mover} from './mover';

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.
Expand Down Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/navigation_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down