window

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 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

Overview

Package window is the rows a virtualized view of base makes: a table's, an editor's.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

Rows is the rows a virtualized view makes: those in view and a reach around them, moved only when the viewport nears the window's edge, so scrolling a little changes no rows and a scroll finds the rows of the next frames made already.

func New

func New(margin, ahead int) *Rows

New is a window keeping margin rows made past the viewport's edges and making ahead rows ahead of it when it moves, at least.

func (*Rows) Span

func (w *Rows) Span(vStart, vEnd, count int) (int, int)

Span is the rows to make with visible rows in view of count: the last window while it covers them with half a viewport to spare, else the visible rows, a viewport and a half more ahead the way they scrolled and half a viewport behind, or as many on one side as the other end leaves.

Jump to

Keyboard shortcuts

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