Skip to content

Commit de05ae6

Browse files
authored
fix: Don't use human-readable names for move shortcuts. (#587)
1 parent a758e32 commit de05ae6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/actions/move.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class MoveActions {
3636
const shortcuts: ShortcutRegistry.KeyboardShortcut[] = [
3737
// Begin and end move.
3838
{
39-
name: Msg['START_MOVE'],
39+
name: 'start_move',
4040
preconditionFn: (workspace) => {
4141
const startBlock = this.getCurrentBlock(workspace);
4242
return !!startBlock && this.mover.canMove(workspace, startBlock);
@@ -56,14 +56,14 @@ export class MoveActions {
5656
keyCodes: [KeyCodes.M],
5757
},
5858
{
59-
name: Msg['FINISH_MOVE'],
59+
name: 'finish_move',
6060
preconditionFn: (workspace) => this.mover.isMoving(workspace),
6161
callback: (workspace) => this.mover.finishMove(workspace),
6262
keyCodes: [KeyCodes.ENTER, KeyCodes.SPACE],
6363
allowCollision: true,
6464
},
6565
{
66-
name: Msg['ABORT_MOVE'],
66+
name: 'abort_move',
6767
preconditionFn: (workspace) => this.mover.isMoving(workspace),
6868
callback: (workspace) => this.mover.abortMove(workspace),
6969
keyCodes: [KeyCodes.ESC],
@@ -72,31 +72,31 @@ export class MoveActions {
7272

7373
// Constrained moves.
7474
{
75-
name: Msg['MOVE_LEFT_CONSTRAINED'],
75+
name: 'move_left_constrained',
7676
preconditionFn: (workspace) => this.mover.isMoving(workspace),
7777
callback: (workspace) =>
7878
this.mover.moveConstrained(workspace, Direction.Left),
7979
keyCodes: [KeyCodes.LEFT],
8080
allowCollision: true,
8181
},
8282
{
83-
name: Msg['MOVE_RIGHT_CONSTRAINED'],
83+
name: 'move_right_constrained',
8484
preconditionFn: (workspace) => this.mover.isMoving(workspace),
8585
callback: (workspace) =>
8686
this.mover.moveConstrained(workspace, Direction.Right),
8787
keyCodes: [KeyCodes.RIGHT],
8888
allowCollision: true,
8989
},
9090
{
91-
name: Msg['MOVE_UP_CONSTRAINED'],
91+
name: 'move_up_constrained',
9292
preconditionFn: (workspace) => this.mover.isMoving(workspace),
9393
callback: (workspace) =>
9494
this.mover.moveConstrained(workspace, Direction.Up),
9595
keyCodes: [KeyCodes.UP],
9696
allowCollision: true,
9797
},
9898
{
99-
name: Msg['MOVE_DOWN_CONSTRAINED'],
99+
name: 'move_down_constrained',
100100
preconditionFn: (workspace) => this.mover.isMoving(workspace),
101101
callback: (workspace) =>
102102
this.mover.moveConstrained(workspace, Direction.Down),
@@ -106,7 +106,7 @@ export class MoveActions {
106106

107107
// Unconstrained moves.
108108
{
109-
name: Msg['MOVE_LEFT_UNCONSTRAINED'],
109+
name: 'move_left_unconstrained',
110110
preconditionFn: (workspace) => this.mover.isMoving(workspace),
111111
callback: (workspace) =>
112112
this.mover.moveUnconstrained(workspace, Direction.Left),
@@ -116,7 +116,7 @@ export class MoveActions {
116116
],
117117
},
118118
{
119-
name: Msg['MOVE_RIGHT_UNCONSTRAINED'],
119+
name: 'move_right_unconstrained',
120120
preconditionFn: (workspace) => this.mover.isMoving(workspace),
121121
callback: (workspace) =>
122122
this.mover.moveUnconstrained(workspace, Direction.Right),
@@ -126,7 +126,7 @@ export class MoveActions {
126126
],
127127
},
128128
{
129-
name: Msg['MOVE_UP_UNCONSTRAINED'],
129+
name: 'move_up_unconstrained',
130130
preconditionFn: (workspace) => this.mover.isMoving(workspace),
131131
callback: (workspace) =>
132132
this.mover.moveUnconstrained(workspace, Direction.Up),
@@ -136,7 +136,7 @@ export class MoveActions {
136136
],
137137
},
138138
{
139-
name: Msg['MOVE_DOWN_UNCONSTRAINED'],
139+
name: 'move_down_unconstrained',
140140
preconditionFn: (workspace) => this.mover.isMoving(workspace),
141141
callback: (workspace) =>
142142
this.mover.moveUnconstrained(workspace, Direction.Down),
@@ -158,7 +158,7 @@ export class MoveActions {
158158
{
159159
displayText: Msg['MOVE_BLOCK'].replace(
160160
'%1',
161-
getShortActionShortcut(Msg['START_MOVE']),
161+
getShortActionShortcut('start_move'),
162162
),
163163
preconditionFn: (scope, menuOpenEvent) => {
164164
const workspace = scope.block?.workspace as WorkspaceSvg | null;

0 commit comments

Comments
 (0)