summaryrefslogtreecommitdiff
path: root/lib/optparse.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2019-10-21 09:12:38 +0900
committerNobuyoshi Nakada <[email protected]>2019-10-21 09:54:11 +0900
commit263ee6639d6f9f599613a20731c0646d125e0813 ()
tree4133ba914924764fdd3a748308386f96aa86e970 /lib/optparse.rb
parent71ffe40a447a17a1c3388374b7c9979c826b131d (diff)
Make suggestions order stable [Bug #16263]
As the result order of `DidYouMean::SpellChecker#correct` is undefined, keep the order of the original candidates.
-rw-r--r--lib/optparse.rb2
1 files changed, 1 insertions, 1 deletions
@@ -1787,7 +1787,7 @@ XXX
end
all_candidates.select! {|cand| cand.is_a?(String) }
checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
- DidYouMean.formatter.message_for(checker.correct(opt))
end
def candidate(word)