add basic paging to text views

This commit is contained in:
Jonathan Turner
2019-07-24 19:44:12 +12:00
parent 72384629fd
commit 568931c80c
5 changed files with 237 additions and 125 deletions

View File

@@ -4,16 +4,16 @@ use nu::{
ShellError, Spanned, Value,
};
struct NewSkip {
struct Skip {
skip_amount: i64,
}
impl NewSkip {
fn new() -> NewSkip {
NewSkip { skip_amount: 0 }
impl Skip {
fn new() -> Skip {
Skip { skip_amount: 0 }
}
}
impl Plugin for NewSkip {
impl Plugin for Skip {
fn config(&mut self) -> Result<CommandConfig, ShellError> {
Ok(CommandConfig {
name: "skip".to_string(),
@@ -59,5 +59,5 @@ impl Plugin for NewSkip {
}
fn main() {
serve_plugin(&mut NewSkip::new());
serve_plugin(&mut Skip::new());
}