@@ -31,8 +31,8 @@ import {
3131
3232type SelectionAction =
3333 | { _tag : "Move" ; offset : - 1 | 1 }
34- | { _tag : "NextSection" }
3534 | { _tag : "PreviousSection" }
35+ | { _tag : "NextSection" }
3636 | { _tag : "TogglePreview" }
3737 | { _tag : "OpenFullscreenPreview" } ;
3838
@@ -71,18 +71,18 @@ const selectionBindings: Array<ShortcutBinding<SelectionAction>> = [
7171 keys : [ "ArrowDown" , "j" ] ,
7272 action : { _tag : "Move" , offset : 1 } ,
7373 } ,
74- {
75- id : "next-section" ,
76- description : "Next section" ,
77- keys : [ "J" ] ,
78- action : { _tag : "NextSection" } ,
79- } ,
8074 {
8175 id : "previous-section" ,
8276 description : "Previous section" ,
8377 keys : [ "K" ] ,
8478 action : { _tag : "PreviousSection" } ,
8579 } ,
80+ {
81+ id : "next-section" ,
82+ description : "Next section" ,
83+ keys : [ "J" ] ,
84+ action : { _tag : "NextSection" } ,
85+ } ,
8686 togglePreviewBinding ,
8787 openFullscreenPreviewBinding ,
8888] ;
@@ -464,17 +464,17 @@ export const useWorkspaceShortcuts = ({
464464
465465 const move = ( offset : - 1 | 1 , selection : Item ) =>
466466 select ( getAdjacentItem ( navigationModel , selection , offset ) ) ;
467- const nextSection = ( selection : Item ) =>
468- select ( getAdjacentSection ( navigationModel , selection , 1 ) ) ;
469467 const previousSection = ( selection : Item ) =>
470468 select ( getParentSection ( selection ) ?? getAdjacentSection ( navigationModel , selection , - 1 ) ) ;
469+ const nextSection = ( selection : Item ) =>
470+ select ( getAdjacentSection ( navigationModel , selection , 1 ) ) ;
471471
472472 const handleSelectionAction = ( action : SelectionAction , selection : Item ) =>
473473 Match . value ( action ) . pipe (
474474 Match . tagsExhaustive ( {
475475 Move : ( { offset } ) => move ( offset , selection ) ,
476- NextSection : ( ) => nextSection ( selection ) ,
477476 PreviousSection : ( ) => previousSection ( selection ) ,
477+ NextSection : ( ) => nextSection ( selection ) ,
478478 TogglePreview : ( ) => setShowPreviewPanel ( ( visible ) => ! visible ) ,
479479 OpenFullscreenPreview : ( ) => setShowFullscreenPreview ( true ) ,
480480 } ) ,
0 commit comments