diff --git a/lib/cli/src/Cardano/CLI.hs b/lib/cli/src/Cardano/CLI.hs index 83adc05077b..3d900fbaaa9 100644 --- a/lib/cli/src/Cardano/CLI.hs +++ b/lib/cli/src/Cardano/CLI.hs @@ -216,6 +216,8 @@ import Data.Char ( toLower ) import Data.Either ( isRight ) +import Data.List + ( nub, sort ) import Data.List.Extra ( enumerate ) import Data.List.NonEmpty @@ -520,7 +522,7 @@ decodeKey = \case unCharPos (CharPosition x) = x markCharsRedAtIndices :: Integral i => [i] -> String -> String -markCharsRedAtIndices ixs txt = go 0 ixs txt ++ def +markCharsRedAtIndices ixs = go 0 (sort $ nub ixs) where go _c [] [] = mempty go c (i:is) (s:ss)