From 1886f6baad5e45867d36c337cf0cf6c1729093b0 Mon Sep 17 00:00:00 2001 From: Jack Wright Date: Sun, 1 Dec 2024 18:27:49 -0800 Subject: [PATCH] minor formatting tweak --- nushell_completions.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nushell_completions.go b/nushell_completions.go index d6cc274..0fd02ea 100644 --- a/nushell_completions.go +++ b/nushell_completions.go @@ -76,28 +76,28 @@ let cobra_completer = {|spans| # Add space at the end of each completion let completions = if $directive != $ShellCompDirectiveNoSpace { - $completions | each {|it| {value: $"($it.value) ", description: $it.description}} + $completions | each {|it| {value: $"($it.value) ", description: $it.description}} } else { - $completions + $completions } # Cobra returns a list of completions that are supported with this directive # There is no way to currently support this in a nushell external completer let completions = if $directive == $ShellCompDirectiveFilterFileExt { - [] + [] } else { - $completions + $completions } if $directive == $ShellCompDirectiveNoFileComp { - # Allow empty results as this will stop file completion - $completions + # Allow empty results as this will stop file completion + $completions } else if ($completions | is-empty) or $directive == $ShellCompDirectiveError { - # Not returning null causes file completions to break - # Return null if there are no completions or ShellCompDirectiveError - null - } else { - $completions + # Not returning null causes file completions to break + # Return null if there are no completions or ShellCompDirectiveError + null + } else { + $completions } if ($completions | is-empty) {