add ability to view-source on closures (#7935)

closes https://github.com/nushell/nushell/issues/7934
This commit is contained in:
Darren Schroeder 2023-02-01 12:48:27 -06:00 committed by GitHub
parent 5e957ecda6
commit d13ce2aec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ impl Command for ViewSource {
let arg_span = arg.span()?;
match arg {
Value::Block { val: block_id, .. } => {
Value::Block { val: block_id, .. } | Value::Closure { val: block_id, .. } => {
let block = engine_state.get_block(block_id);
if let Some(span) = block.span {