scroll

package
v1.18.2 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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