MCPcopy
hub / github.com/codeaashu/claude-code / downOrHistoryDown

Function downOrHistoryDown

src/hooks/useTextInput.ts:293–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

291 return cursor
292 }
293 function downOrHistoryDown() {
294 if (disableCursorMovementForUpDownKeys) {
295 onHistoryDown?.()
296 return cursor
297 }
298 // Try to move by wrapped lines first
299 const cursorDown = cursor.down()
300 if (!cursorDown.equals(cursor)) {
301 return cursorDown
302 }
303
304 // If we can't move by wrapped lines and this is multiline input,
305 // try to move by logical lines (to handle paragraph boundaries)
306 if (multiline) {
307 const cursorDownLogical = cursor.downLogicalLine()
308 if (!cursorDownLogical.equals(cursor)) {
309 return cursorDownLogical
310 }
311 }
312
313 // Can't move down at all - trigger history navigation
314 onHistoryDown?.()
315 return cursor
316 }
317
318 function mapKey(key: Key): InputMapper {
319 switch (true) {

Callers 1

useTextInputFunction · 0.85

Calls 3

downMethod · 0.80
downLogicalLineMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected