mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 12:44:17 +02:00
New "display_output" hook. (#6915)
* New "display_output" hook. * Fix unrelated "clippy" complaint in nu-tables crate. * Fix code-formattng and style issues in "display_output" hook * Enhance eval_hook to return PipelineData. This allows a hook (including display_output) to return a value. Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
This commit is contained in:
@@ -176,7 +176,7 @@ pub fn nu_repl() {
|
||||
// Check for pre_prompt hook
|
||||
let config = engine_state.get_config();
|
||||
if let Some(hook) = config.hooks.pre_prompt.clone() {
|
||||
if let Err(err) = eval_hook(&mut engine_state, &mut stack, vec![], &hook) {
|
||||
if let Err(err) = eval_hook(&mut engine_state, &mut stack, None, vec![], &hook) {
|
||||
outcome_err(&engine_state, &err);
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ pub fn nu_repl() {
|
||||
// Check for pre_execution hook
|
||||
let config = engine_state.get_config();
|
||||
if let Some(hook) = config.hooks.pre_execution.clone() {
|
||||
if let Err(err) = eval_hook(&mut engine_state, &mut stack, vec![], &hook) {
|
||||
if let Err(err) = eval_hook(&mut engine_state, &mut stack, None, vec![], &hook) {
|
||||
outcome_err(&engine_state, &err);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user