Skip to content

Commit 86df444

Browse files
feat: insert in move mode
This feels a bit rough while move mode disconnects from the connection you just inserted at.
1 parent d1a9208 commit 86df444

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/actions/enter.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ import type {
2222

2323
import * as Constants from '../constants';
2424
import type {Navigation} from '../navigation';
25+
import {Mover} from './mover';
2526

2627
const KeyCodes = BlocklyUtils.KeyCodes;
2728

2829
/**
2930
* Class for registering a shortcut for the enter action.
3031
*/
3132
export class EnterAction {
32-
constructor(private navigation: Navigation) {}
33+
constructor(
34+
private mover: Mover,
35+
private navigation: Navigation,
36+
) {}
3337

3438
/**
3539
* Adds the enter action shortcut to the registry.
@@ -149,6 +153,8 @@ export class EnterAction {
149153
this.navigation.focusWorkspace(workspace);
150154
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
151155
workspace.getCursor()?.setCurNode(ASTNode.createBlockNode(newBlock)!);
156+
157+
this.mover.startMove(workspace);
152158
}
153159

154160
/**

src/navigation_controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class NavigationController {
7070

7171
exitAction: ExitAction = new ExitAction(this.navigation);
7272

73-
enterAction: EnterAction = new EnterAction(this.navigation);
73+
enterAction: EnterAction = new EnterAction(this.mover, this.navigation);
7474

7575
actionMenu: ActionMenu = new ActionMenu(this.navigation);
7676

0 commit comments

Comments
 (0)