Registry / Library

library · v0.1.0
ViewPortion
Clamp a terminal scroll offset to a filled viewport.
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
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.0 | Download ZIP | 06be6b2b95 | d4447c0cf1c3ee41fce6f09bb8d45a345f458975128f1622a9987c6d9292bcdd |