Blyx Nest Blyx language
Registry / Library
library · v0.1.0

ViewPortion

Clamp a terminal scroll offset to a filled viewport.

Source repository · Package JSON

Use ViewPortion

use vendor::viewportion::viewportion;

Run the example

nest demo viewportion@0.1.0
blyxc native-run viewportion-demo/main.blyx
Example source and expected output
use vendor::viewportion::viewportion;

fn main() {
    let rows = 12.0;
    let start = 11.0;
    let height = 4.0;
    let result = viewportion_slice(rows, start, height);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

8
12
0

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP06be6b2b95d4447c0cf1c3ee41fce6f09bb8d45a345f458975128f1622a9987c6d9292bcdd