1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Sort completion list

#### Legacy mode:

  ```console
  $ irb --legacy
  irb(main):001:0> l[TAB][TAB]
  lambda           load             local_variables  loop
  ```

#### Before this patch:

  ```console
  $ irb
  irb(main):001:0> l[TAB][TAB]
  local_variables
  loop
  lambda
  load
  ```

#### After this patch:

  ```console
  $ irb
  irb(main):001:0> l[TAB][TAB]
  lambda
  load
  local_variables
  loop
  ```

https://github.com/ruby/reline/commit/6074069c7d
This commit is contained in:
KOBAYASHI Shuji 2019-12-27 13:41:22 +09:00 committed by aycabta
parent ded072c2b7
commit 9b928fa443

View file

@ -317,7 +317,7 @@ class Reline::LineEditor
if @menu_info
scroll_down(@highest_in_all - @first_line_started_from)
@rerender_all = true
@menu_info.list.each do |item|
@menu_info.list.sort!.each do |item|
Reline::IOGate.move_cursor_column(0)
@output.print item
@output.flush