scroll

package
v0.23.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Align

func Align(sel, off, h, total int) int

Align returns a y-offset that keeps the selection away from viewport edges. It behaves like a lightweight scrolloff: nudge just enough to keep a small buffer.

func AlignWithBuffer added in v0.20.2

func AlignWithBuffer(sel, off, h, total, buf int) int

AlignWithBuffer is like Align but allows an explicit buffer size.

func Reveal

func Reveal(start, end, off, h, total int) int

Reveal returns a y-offset that makes sure the span [start,end] is visible with a small buffer above and below when possible. If the span is already comfortably visible, the current offset is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL