MCPcopy Create free account
hub / github.com/Effect-TS/effect / processAutoCompleteCursorUp

Function processAutoCompleteCursorUp

packages/effect/src/unstable/cli/Prompt.ts:3311–3318  ·  view source on GitHub ↗
(state: AutoCompleteState)

Source from the content-addressed store, hash-verified

3309}
3310
3311const processAutoCompleteCursorUp = (state: AutoCompleteState) => {
3312 if (state.filtered.length === 0) {
3313 return Effect.succeed(Action.Beep())
3314 }
3315 const cursor = autoCompleteCursor(state)
3316 const nextCursor = cursor === 0 ? state.filtered.length - 1 : cursor - 1
3317 return Effect.succeed(Action.NextFrame({ state: { ...state, index: state.filtered[nextCursor] } }))
3318}
3319
3320const processAutoCompleteCursorDown = (state: AutoCompleteState) => {
3321 if (state.filtered.length === 0) {

Callers 1

Calls 2

autoCompleteCursorFunction · 0.85
succeedMethod · 0.45

Tested by

no test coverage detected