MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / navigateActiveBuffer

Function navigateActiveBuffer

packages/app-core/src/lib/buffer-navigation.ts:75–97  ·  view source on GitHub ↗
(
  runtime: BufferNavigationRuntime,
  delta: 1 | -1
)

Source from the content-addressed store, hash-verified

73}
74
75export function navigateActiveBuffer(
76 runtime: BufferNavigationRuntime,
77 delta: 1 | -1
78): void {
79 const target = getBufferNavigationTarget(
80 runtime.paneLayout,
81 runtime.activePaneId,
82 runtime.notes,
83 delta
84 )
85
86 if (target.kind === 'focus') {
87 void runtime.focusTabInPane(target.paneId, target.path)
88 return
89 }
90 if (target.kind === 'open') {
91 void runtime.openNoteInPane(target.paneId, target.path)
92 return
93 }
94 if (target.kind === 'create-quick') {
95 void runtime.createAndOpen('quick', '', { focusTitle: true })
96 }
97}

Callers 3

registerVimCommandsFunction · 0.90
registerVimNoteCommandsFunction · 0.90
handlerFunction · 0.90

Calls 1

Tested by

no test coverage detected