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

Method convertRawLineToViewLine

internal/app/darktile/termutil/buffer.go:244–250  ·  view source on GitHub ↗
(rawLine uint64)

Source from the content-addressed store, hash-verified

242}
243
244func (buffer *Buffer) convertRawLineToViewLine(rawLine uint64) uint16 {
245 rawHeight := buffer.Height()
246 if int(buffer.viewHeight) > rawHeight {
247 return uint16(rawLine)
248 }
249 return uint16(int(rawLine) - (rawHeight - int(buffer.viewHeight+uint16(buffer.scrollLinesFromBottom))))
250}
251
252func (buffer *Buffer) GetVPosition() int {
253 result := int(uint(buffer.Height()) - uint(buffer.ViewHeight()) - buffer.scrollLinesFromBottom)

Callers 10

GetSelectionMethod · 0.95
GetViewHighlightMethod · 0.95
InScrollableRegionMethod · 0.95
CursorLineAbsoluteMethod · 0.95
indexMethod · 0.95
reverseIndexMethod · 0.95
carriageReturnMethod · 0.95
getCurrentLineMethod · 0.95
eraseDisplayToCursorMethod · 0.95

Calls 1

HeightMethod · 0.95

Tested by 1