@@ -91,6 +91,10 @@ import {
9191 normalizeStatuslineFields ,
9292} from "./settings-preview.js" ;
9393import { withQueuedRetry } from "./settings-write-queue.js" ;
94+ import { reorderStatuslineField } from "./statusline-order.js" ;
95+
96+ const reorderField = reorderStatuslineField ;
97+
9498import { promptStatuslineSettingsPanel } from "./statusline-settings-panel.js" ;
9599import { promptThemeSettingsPanel } from "./theme-settings-panel.js" ;
96100import {
@@ -481,24 +485,6 @@ async function configureDashboardDisplaySettings(
481485 } ) ;
482486}
483487
484- function reorderField (
485- fields : DashboardStatuslineField [ ] ,
486- key : DashboardStatuslineField ,
487- direction : - 1 | 1 ,
488- ) : DashboardStatuslineField [ ] {
489- const index = fields . indexOf ( key ) ;
490- if ( index < 0 ) return fields ;
491- const target = index + direction ;
492- if ( target < 0 || target >= fields . length ) return fields ;
493- const next = [ ...fields ] ;
494- const current = next [ index ] ;
495- const swap = next [ target ] ;
496- if ( ! current || ! swap ) return fields ;
497- next [ index ] = swap ;
498- next [ target ] = current ;
499- return next ;
500- }
501-
502488async function promptStatuslineSettings (
503489 initial : DashboardDisplaySettings ,
504490) : Promise < DashboardDisplaySettings | null > {
0 commit comments