Skip to content

Commit fea2be8

Browse files
committed
feat(commands): minor search improvements
1 parent a47fd04 commit fea2be8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/commands/search.cr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,27 @@ module Docr::Commands
9898
exit_program
9999
end
100100

101-
types.sort_by!(&.[0]).reverse!.sort_by! do |(score, type)|
101+
types.sort_by! do |(score, type)|
102102
if type.responds_to?(:full_name)
103-
type.full_name
103+
{score, type.full_name}
104104
else
105-
type.name
105+
{score, type.name}
106106
end
107-
end.reverse!
107+
end
108108

109109
stdout << types.size << " result"
110110
stdout << "s" if types.size > 1
111111
stdout << " found:\n\n"
112112

113113
if options.has? "debug"
114-
types.each do |score, type|
114+
types.reverse_each do |score, type|
115115
Colorize.with.dark_gray.surround(stdout) do
116116
stdout << '[' << score << "] "
117117
end
118118
Formatters::Default.signature stdout, type, true, false
119119
end
120120
else
121-
types.each do |_, type|
121+
types.reverse_each do |_, type|
122122
Formatters::Default.signature stdout, type, true, false
123123
end
124124
end

0 commit comments

Comments
 (0)