MCPcopy
hub / github.com/liamg/darktile / csiCursorNextLineHandler

Method csiCursorNextLineHandler

internal/app/darktile/termutil/csi.go:407–421  ·  view source on GitHub ↗

CSI E Cursor Next Line Ps Times (default = 1) (CNL)

(params []string)

Source from the content-addressed store, hash-verified

405// CSI E
406// Cursor Next Line Ps Times (default = 1) (CNL)
407func (t *Terminal) csiCursorNextLineHandler(params []string) (renderRequired bool) {
408
409 distance := 1
410 if len(params) > 0 {
411 var err error
412 distance, err = strconv.Atoi(params[0])
413 if err != nil || distance < 1 {
414 distance = 1
415 }
416 }
417
418 t.GetActiveBuffer().movePosition(0, int16(distance))
419 t.GetActiveBuffer().setPosition(0, t.GetActiveBuffer().CursorLine())
420 return true
421}
422
423// CSI F
424// Cursor Preceding Line Ps Times (default = 1) (CPL)

Callers 1

handleCSIMethod · 0.95

Calls 4

GetActiveBufferMethod · 0.95
movePositionMethod · 0.80
setPositionMethod · 0.80
CursorLineMethod · 0.80

Tested by

no test coverage detected