From e4a8db56f9f0879a8abf7cbc652b5b0949f9e485 Mon Sep 17 00:00:00 2001 From: rezural <69941255+rezural@users.noreply.github.com> Date: Thu, 4 Mar 2021 18:06:22 +1100 Subject: [PATCH] use add_exit_callback, update to rezural/nushell which contains add_exit_callback, and contains updated keybindings (#3121) --- crates/nu-command/Cargo.toml | 2 +- crates/nu-command/src/commands/table/command.rs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index 7b83d4bd1f..12ec1695fe 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -62,7 +62,7 @@ itertools = "0.10.0" lazy_static = "1.*" log = "0.4.14" meval = "0.2.0" -minus = { optional = true, features = ["async_std_lib", "search"], git = "https://github.com/rezural/minus", branch = "add-finished-callback" } +minus = { optional = true, features = ["async_std_lib", "search"], git = "https://github.com/rezural/minus", branch = "nushell" } num-bigint = { version = "0.3.1", features = ["serde"] } num-format = { version = "0.4.0", features = ["with-num-bigint"] } num-traits = "0.2.14" diff --git a/crates/nu-command/src/commands/table/command.rs b/crates/nu-command/src/commands/table/command.rs index 27cea6f2d5..35657b9c02 100644 --- a/crates/nu-command/src/commands/table/command.rs +++ b/crates/nu-command/src/commands/table/command.rs @@ -210,13 +210,9 @@ async fn table( // This is called when the pager finishes, to indicate to the // while loop below to finish, in case of long running InputStream consumer // that doesnt finish by the time the user quits out of the pager - pager - .lock() - .await - .on_finished_callbacks - .push(Box::new(move || { - finished_within_callback.store(true, Ordering::Relaxed); - })); + pager.lock().await.add_exit_callback(move || { + finished_within_callback.store(true, Ordering::Relaxed); + }); } while !finished.clone().load(Ordering::Relaxed) { let mut new_input: VecDeque = VecDeque::new();