reline 0.3.2 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8198104fe3ad27c73acaaffc9c8b1c8b9a5c50069a26a71cd940dd2b5dc13afc
4
- data.tar.gz: 171ff8cdf2ae4aebaf4cfb6cea131e2d90e5eb56a2c09dbe19acfa8765522ffc
3
+ metadata.gz: 3e5c7a3a92a99dc4e59ae8299c90086a1d5508a7aa7f23579ac9e69a516da22a
4
+ data.tar.gz: 4779c4eba572d69bda056dafdc974f898678a9a0d40636ffc54836bbcedce2e8
5
5
  SHA512:
6
- metadata.gz: e3411f0086a0445d2d805fc46528a86b947c58b8e61a664dc08b437596702ef1f360cd7e85a1dab64bf159f6f39691b9d5110f951bd5376f4fce0439e9557532
7
- data.tar.gz: 968ac4a376ba350590fd37d05525a5a2e5e26c44e159b5fd9b0c7400e260850e91088357c007651373d44b7b7d37c699852014d07258428be86081581baf0229
6
+ metadata.gz: ec283bebd9d93cc46c0587da2d051f29a2f119c785eff4a0d554b019a6f4cc2c9503670e0f073c11ce3399b72ecd2b3cdd4d92315251022b4ef54378bb9eea35
7
+ data.tar.gz: ffab61dee9ca267ff0015280a0fb0cbd5c76b271867dd86fc1861379af4821929917a467017b1a9b6cd17c92e3bbc74905c7b43865406b5053890bdb42b00007
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- [![Build Status](https://travis-ci.com/ruby/reline.svg?branch=master)](https://travis-ci.com/ruby/reline)
1
+ [![Gem Version](https://badge.fury.io/rb/reline.svg)](https://badge.fury.io/rb/reline)
2
+ [![CI](https://github.com/ruby/reline/actions/workflows/reline.yml/badge.svg)](https://github.com/ruby/reline/actions/workflows/reline.yml)
2
3
 
3
4
  This is a screen capture of *IRB improved by Reline*.
4
5
 
data/lib/reline/ansi.rb CHANGED
@@ -7,6 +7,9 @@ class Reline::ANSI
7
7
  CAPNAME_KEY_BINDINGS = {
8
8
  'khome' => :ed_move_to_beg,
9
9
  'kend' => :ed_move_to_end,
10
+ 'kdch1' => :key_delete,
11
+ 'kpp' => :ed_search_prev_history,
12
+ 'knp' => :ed_search_next_history,
10
13
  'kcuu1' => :ed_prev_history,
11
14
  'kcud1' => :ed_next_history,
12
15
  'kcuf1' => :ed_next_char,
@@ -29,8 +32,8 @@ class Reline::ANSI
29
32
  false
30
33
  end
31
34
 
32
- def self.set_default_key_bindings(config)
33
- if Reline::Terminfo.enabled?
35
+ def self.set_default_key_bindings(config, allow_terminfo: true)
36
+ if allow_terminfo && Reline::Terminfo.enabled?
34
37
  set_default_key_bindings_terminfo(config)
35
38
  else
36
39
  set_default_key_bindings_comprehensive_list(config)
@@ -142,6 +145,10 @@ class Reline::ANSI
142
145
  @@output = val
143
146
  end
144
147
 
148
+ def self.with_raw_input
149
+ @@input.raw { yield }
150
+ end
151
+
145
152
  @@buf = []
146
153
  def self.inner_getc
147
154
  unless @@buf.empty?
data/lib/reline/config.rb CHANGED
@@ -93,7 +93,7 @@ class Reline::Config
93
93
  end
94
94
 
95
95
  def editing_mode_is?(*val)
96
- (val.respond_to?(:any?) ? val : [val]).any?(@editing_mode_label)
96
+ val.any?(@editing_mode_label)
97
97
  end
98
98
 
99
99
  def keymap
@@ -31,6 +31,10 @@ class Reline::GeneralIO
31
31
  @@input = val
32
32
  end
33
33
 
34
+ def self.with_raw_input
35
+ yield
36
+ end
37
+
34
38
  def self.getc
35
39
  unless @@buf.empty?
36
40
  return @@buf.shift