From c861069865da7e47dbf3f923a02f324b6c636ade Mon Sep 17 00:00:00 2001 From: Xavier Ruiz Date: Wed, 26 Nov 2025 19:47:58 -0500 Subject: [PATCH] fix(carapace example): update invariant Using previous invariant can sometimes be incorrect. See: https://github.com/carapace-sh/carapace/blob/09b28a62d9ce4acbade91bc967cee173454407c1/internal/common/message.go#L92-L114 --- cookbook/external_completers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/external_completers.md b/cookbook/external_completers.md index c59288e0461..ffcaf3bceb7 100644 --- a/cookbook/external_completers.md +++ b/cookbook/external_completers.md @@ -95,7 +95,7 @@ The solution to this involves manually checking the value to filter it out: let carapace_completer = {|spans: list| carapace $spans.0 nushell ...$spans | from json - | if ($in | default [] | where value == $"($spans | last)ERR" | is-empty) { $in } else { null } + | if ($in | default [] | any {|| $in.display | str starts-with "ERR"}) { null } else { $in } } ``` @@ -109,7 +109,7 @@ let fish_completer = ... let carapace_completer = {|spans: list| carapace $spans.0 nushell ...$spans | from json - | if ($in | default [] | where value =~ '^-.*ERR$' | is-empty) { $in } else { null } + | if ($in | default [] | any {|| $in.display | str starts-with "ERR"}) { null } else { $in } } # This completer will use carapace by default