File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -538,10 +538,13 @@ export class Navigation {
538
538
}
539
539
540
540
/**
541
- * Moves the cursor to the top connection point on on the first top block.
542
- * If the workspace is empty, moves the cursor to the default location on
543
- * the workspace.
544
- *
541
+ * Sets the cursor location when focusing the workspace.
542
+ * Tries the following, in order, stopping after the first success:
543
+ * - Resume editing by putting the cursor at the marker location, if any.
544
+ * - Resume editing by returning the cursor to its previous location, if any.
545
+ * - Move the cursor to the top connection point on on the first top block.
546
+ * - Move the cursor to the default location on the workspace.
547
+ *
545
548
* @param workspace The main Blockly workspace.
546
549
* @param keepPosition Whether to retain the cursor's previous position.
547
550
*/
@@ -554,6 +557,13 @@ export class Navigation {
554
557
if ( ! cursor ) {
555
558
return ;
556
559
}
560
+
561
+ if ( this . markedNode ) {
562
+ cursor . setCurNode ( this . markedNode ) ;
563
+ this . removeMark ( workspace ) ;
564
+ return ;
565
+ }
566
+
557
567
if ( cursor . getCurNode ( ) && keepPosition ) {
558
568
// Retain the cursor's previous position since it's set.
559
569
return ;
You can’t perform that action at this time.
0 commit comments