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

Method index

internal/app/darktile/termutil/buffer.go:363–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361}
362
363func (buffer *Buffer) index() {
364
365 // This sequence causes the active position to move downward one line without changing the column position.
366 // If the active position is at the bottom margin, a scroll up is performed."
367
368 cursorVY := buffer.convertRawLineToViewLine(buffer.cursorPosition.Line)
369
370 if buffer.InScrollableRegion() {
371
372 if uint(cursorVY) < buffer.bottomMargin {
373 buffer.cursorPosition.Line++
374 } else {
375 buffer.areaScrollUp(1)
376 }
377
378 return
379 }
380
381 if cursorVY >= buffer.ViewHeight()-1 {
382 buffer.lines = append(buffer.lines, newLine())
383 maxLines := buffer.GetMaxLines()
384 if uint64(len(buffer.lines)) > maxLines {
385 copy(buffer.lines, buffer.lines[uint64(len(buffer.lines))-maxLines:])
386 buffer.lines = buffer.lines[:maxLines]
387 }
388 }
389 buffer.cursorPosition.Line++
390}
391
392func (buffer *Buffer) reverseIndex() {
393

Callers 4

verticalTabMethod · 0.95
newLineExMethod · 0.95
handleANSIMethod · 0.80
handleScreenStateMethod · 0.80

Calls 6

InScrollableRegionMethod · 0.95
areaScrollUpMethod · 0.95
ViewHeightMethod · 0.95
GetMaxLinesMethod · 0.95
newLineFunction · 0.85

Tested by

no test coverage detected