@@ -505,115 +505,6 @@ export class NavigationController {
505505 } ,
506506 keyCodes : [ KeyCodes . A ] ,
507507 } ,
508-
509- /** Go to the next sibling of the cursor's current location. */
510- nextSibling : {
511- name : Constants . SHORTCUT_NAMES . GO_TO_NEXT_SIBLING ,
512- preconditionFn : ( workspace ) => this . canCurrentlyNavigate ( workspace ) ,
513- // Jump to the next node at the same level, when in the workspace.
514- callback : ( workspace , e , shortcut ) => {
515- const cursor = workspace . getCursor ( ) as LineCursor ;
516-
517- if ( this . navigation . getState ( workspace ) === Constants . STATE . WORKSPACE ) {
518- if ( this . fieldShortcutHandler ( workspace , shortcut ) ) {
519- this . announcer . setText ( 'next sibling (handled by field)' ) ;
520- return true ;
521- }
522- if ( cursor . nextSibling ( ) ) {
523- this . announcer . setText ( 'next sibling (success)' ) ;
524- return true ;
525- }
526- }
527- this . announcer . setText ( 'next sibling (no-op)' ) ;
528- return false ;
529- } ,
530- keyCodes : [ KeyCodes . N ] ,
531- } ,
532-
533- /** Go to the previous sibling of the cursor's current location. */
534- previousSibling : {
535- name : Constants . SHORTCUT_NAMES . GO_TO_PREVIOUS_SIBLING ,
536- preconditionFn : ( workspace ) => this . canCurrentlyNavigate ( workspace ) ,
537- // Jump to the previous node at the same level, when in the workspace.
538- callback : ( workspace , e , shortcut ) => {
539- const cursor = workspace . getCursor ( ) as LineCursor ;
540-
541- if ( this . navigation . getState ( workspace ) === Constants . STATE . WORKSPACE ) {
542- if ( this . fieldShortcutHandler ( workspace , shortcut ) ) {
543- this . announcer . setText ( 'previous sibling (handled by field)' ) ;
544- return true ;
545- }
546- if ( cursor . previousSibling ( ) ) {
547- this . announcer . setText ( 'previous sibling (success)' ) ;
548- return true ;
549- }
550- }
551- this . announcer . setText ( 'previous sibling (no-op)' ) ;
552- return false ;
553- } ,
554- keyCodes : [ KeyCodes . M ] ,
555- } ,
556-
557- /** Jump to the root of the current stack. */
558- jumpToRoot : {
559- name : Constants . SHORTCUT_NAMES . JUMP_TO_ROOT ,
560- preconditionFn : ( workspace ) => this . canCurrentlyNavigate ( workspace ) ,
561- // Jump to the root of the current stack.
562- callback : ( workspace ) => {
563- const cursor = workspace . getCursor ( ) ;
564- if ( ! cursor ) return false ;
565- const curNode = cursor . getCurNode ( ) ;
566- const curBlock = curNode . getSourceBlock ( ) ;
567- if ( curBlock ) {
568- const rootBlock = curBlock . getRootBlock ( ) ;
569- const stackNode = ASTNode . createStackNode ( rootBlock ) as ASTNode ;
570- cursor . setCurNode ( stackNode ) ;
571- this . announcer . setText ( 'jumped to root' ) ;
572- return true ;
573- }
574- this . announcer . setText ( 'could not jump to root' ) ;
575- return false ;
576- } ,
577- keyCodes : [ KeyCodes . R ] ,
578- } ,
579-
580- /** Move the cursor out of its current context, such as a loop block. */
581- contextOut : {
582- name : Constants . SHORTCUT_NAMES . CONTEXT_OUT ,
583- preconditionFn : ( workspace ) => this . canCurrentlyNavigate ( workspace ) ,
584- callback : ( workspace ) => {
585- if ( this . navigation . getState ( workspace ) === Constants . STATE . WORKSPACE ) {
586- this . announcer . setText ( 'context out' ) ;
587- const cursor = workspace . getCursor ( ) as LineCursor ;
588- if ( cursor . contextOut ( ) ) {
589- return true ;
590- }
591- }
592- this . announcer . setText ( 'context out (no-op)' ) ;
593- return false ;
594- } ,
595- keyCodes : [ createSerializedKey ( KeyCodes . O , [ KeyCodes . SHIFT ] ) ] ,
596- } ,
597-
598- /** Move the cursor in a level of context, such as into a loop. */
599- contextIn : {
600- name : Constants . SHORTCUT_NAMES . CONTEXT_IN ,
601- preconditionFn : ( workspace ) => this . canCurrentlyNavigate ( workspace ) ,
602- // Print out the type of the current node.
603- callback : ( workspace ) => {
604- if ( this . navigation . getState ( workspace ) === Constants . STATE . WORKSPACE ) {
605- const cursor = workspace . getCursor ( ) as LineCursor ;
606- if ( cursor . contextIn ( ) ) {
607- this . announcer . setText ( 'context in' ) ;
608- return true ;
609- }
610- }
611- this . announcer . setText ( 'context in (no-op)' ) ;
612- return false ;
613- } ,
614- keyCodes : [ createSerializedKey ( KeyCodes . I , [ KeyCodes . SHIFT ] ) ] ,
615- } ,
616-
617508 /** Clean up the workspace. */
618509 cleanup : {
619510 name : Constants . SHORTCUT_NAMES . CLEAN_UP ,
0 commit comments