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 {
538538 }
539539
540540 /**
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+ *
545548 * @param workspace The main Blockly workspace.
546549 * @param keepPosition Whether to retain the cursor's previous position.
547550 */
@@ -554,6 +557,13 @@ export class Navigation {
554557 if ( ! cursor ) {
555558 return ;
556559 }
560+
561+ if ( this . markedNode ) {
562+ cursor . setCurNode ( this . markedNode ) ;
563+ this . removeMark ( workspace ) ;
564+ return ;
565+ }
566+
557567 if ( cursor . getCurNode ( ) && keepPosition ) {
558568 // Retain the cursor's previous position since it's set.
559569 return ;
You can’t perform that action at this time.
0 commit comments