mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Revert "Add headings for methods in the output of ls
"
This reverts commit 1c33a73964
.
Looks unpleasant for most of Pry users.
This commit is contained in:
parent
cee34d944f
commit
dac10c6437
1 changed files with 0 additions and 19 deletions
|
@ -326,9 +326,6 @@ class Pry
|
|||
def output_section(heading, body)
|
||||
return "" if body.compact.empty?
|
||||
table = Pry::Helpers.tablify_to_screen_width(body)
|
||||
if heading =~ /.+methods\z/ && body.size >= 36
|
||||
paint_heading_methods(body)
|
||||
end
|
||||
"#{text.bold(color(:heading, heading))}: \n#{table}\n"
|
||||
end
|
||||
|
||||
|
@ -336,22 +333,6 @@ class Pry
|
|||
def color(type, str)
|
||||
text.send(Pry.config.ls.send(:"#{type}_color"), str)
|
||||
end
|
||||
|
||||
# The true place for this method is {Pry::Helpers::Table}. Both JRuby and
|
||||
# Rubinius don't like it when it's there, for some reason. *shrugs*
|
||||
def paint_heading_methods(body)
|
||||
cur = ''
|
||||
body.each_with_index.inject([]) { |indices, (method, idx)|
|
||||
if method[0] != cur && method[0] =~ /[a-z]/
|
||||
indices << idx
|
||||
cur = method[0]
|
||||
end
|
||||
indices
|
||||
}.map { |i|
|
||||
body[i][0] = "\e[1;7m#{ body[i][0] }\e[0m"
|
||||
body[i][11..-1] = "\e[4m#{ body[i][11..-1] }\e[0m"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Pry::Commands.add_command(Pry::Command::Ls)
|
||||
|
|
Loading…
Reference in a new issue