irb 1.3.8.pre.10 → 1.3.8.pre.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/irb.gemspec +1 -1
- data/lib/irb/context.rb +2 -0
- data/lib/irb/input-method.rb +29 -8
- data/lib/irb/ruby-lex.rb +2 -2
- data/lib/irb/version.rb +2 -2
- data/lib/irb.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11626f5579d5c88f1358bac49d6cfb81663193cf79b19b49e5958bf930fb61de
|
4
|
+
data.tar.gz: 75253829683f5dee7208b964abd7ae7924867bf910fcdbba9cd9fdf4a3848751
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7faa90700c773424719934303c87ade13c38426c5a604425e9bf5921cb1e7234bd002f7179ecbe64597806b286acbff314e085e93ccb0b02ee69399bda59e77
|
7
|
+
data.tar.gz: 05b5f9834f71f15733c7541c66ad7a8ef32a38acdb2101d923db70810c47b4d82382ae187754eaf97931dbe0546b7767985c27a178e2883b5812638825fed376
|
data/irb.gemspec
CHANGED
data/lib/irb/context.rb
CHANGED
data/lib/irb/input-method.rb
CHANGED
@@ -265,7 +265,8 @@ module IRB
|
|
265
265
|
|
266
266
|
class ReidlineInputMethod < InputMethod
|
267
267
|
include Reline
|
268
|
-
|
268
|
+
|
269
|
+
# Creates a new input method object using Reline
|
269
270
|
def initialize
|
270
271
|
IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false)
|
271
272
|
super
|
@@ -319,11 +320,6 @@ module IRB
|
|
319
320
|
[Reline::Key.new(nil, 0xE4, true)], # Normal Alt+d.
|
320
321
|
[195, 164] # The "ä" that appears when Alt+d is pressed on xterm.
|
321
322
|
]
|
322
|
-
begin
|
323
|
-
require 'rdoc'
|
324
|
-
rescue LoadError
|
325
|
-
return nil
|
326
|
-
end
|
327
323
|
|
328
324
|
if just_cursor_moving and completion_journey_data.nil?
|
329
325
|
return nil
|
@@ -370,14 +366,39 @@ module IRB
|
|
370
366
|
end
|
371
367
|
return nil if doc.nil?
|
372
368
|
width = 40
|
369
|
+
|
370
|
+
right_x = cursor_pos_to_render.x + autocomplete_dialog.width
|
371
|
+
if right_x + width > screen_width
|
372
|
+
right_width = screen_width - (right_x + 1)
|
373
|
+
left_x = autocomplete_dialog.column - width
|
374
|
+
left_x = 0 if left_x < 0
|
375
|
+
left_width = width > autocomplete_dialog.column ? autocomplete_dialog.column : width
|
376
|
+
if right_width.positive? and left_width.positive?
|
377
|
+
if right_width >= left_width
|
378
|
+
width = right_width
|
379
|
+
x = right_x
|
380
|
+
else
|
381
|
+
width = left_width
|
382
|
+
x = left_x
|
383
|
+
end
|
384
|
+
elsif right_width.positive? and left_width <= 0
|
385
|
+
width = right_width
|
386
|
+
x = right_x
|
387
|
+
elsif right_width <= 0 and left_width.positive?
|
388
|
+
width = left_width
|
389
|
+
x = left_x
|
390
|
+
else # Both are negative width.
|
391
|
+
return nil
|
392
|
+
end
|
393
|
+
else
|
394
|
+
x = right_x
|
395
|
+
end
|
373
396
|
formatter = RDoc::Markup::ToAnsi.new
|
374
397
|
formatter.width = width
|
375
398
|
dialog.trap_key = alt_d
|
376
399
|
message = 'Press Alt+d to read the full document'
|
377
400
|
contents = [message] + doc.accept(formatter).split("\n")
|
378
401
|
|
379
|
-
x = cursor_pos_to_render.x + autocomplete_dialog.width
|
380
|
-
x = autocomplete_dialog.column - width if x + width >= screen_width
|
381
402
|
y = cursor_pos_to_render.y
|
382
403
|
DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
|
383
404
|
}
|
data/lib/irb/ruby-lex.rb
CHANGED
@@ -477,7 +477,7 @@ class RubyLex
|
|
477
477
|
|
478
478
|
def take_corresponding_syntax_to_kw_do(tokens, index)
|
479
479
|
syntax_of_do = nil
|
480
|
-
# Finding a syntax
|
480
|
+
# Finding a syntax corresponding to "do".
|
481
481
|
index.downto(0) do |i|
|
482
482
|
tk = tokens[i]
|
483
483
|
# In "continue", the token isn't the corresponding syntax to "do".
|
@@ -508,7 +508,7 @@ class RubyLex
|
|
508
508
|
|
509
509
|
def is_the_in_correspond_to_a_for(tokens, index)
|
510
510
|
syntax_of_in = nil
|
511
|
-
# Finding a syntax
|
511
|
+
# Finding a syntax corresponding to "do".
|
512
512
|
index.downto(0) do |i|
|
513
513
|
tk = tokens[i]
|
514
514
|
# In "continue", the token isn't the corresponding syntax to "do".
|
data/lib/irb/version.rb
CHANGED
data/lib/irb.rb
CHANGED
@@ -613,7 +613,7 @@ module IRB
|
|
613
613
|
ret = conv.primitive_convert(str, dst)
|
614
614
|
case ret
|
615
615
|
when :invalid_byte_sequence
|
616
|
-
conv.insert_output(
|
616
|
+
conv.insert_output(conv.primitive_errinfo[3].dump[1..-2])
|
617
617
|
redo
|
618
618
|
when :undefined_conversion
|
619
619
|
c = conv.primitive_errinfo[3].dup.force_encoding(conv.primitive_errinfo[1])
|
@@ -867,7 +867,7 @@ module IRB
|
|
867
867
|
|
868
868
|
# If the expression is invalid, Ripper.sexp should return nil which will
|
869
869
|
# result in false being returned. Any valid expression should return an
|
870
|
-
# s-expression where the second
|
870
|
+
# s-expression where the second element of the top level array is an
|
871
871
|
# array of parsed expressions. The first element of each expression is the
|
872
872
|
# expression's type.
|
873
873
|
verbose, $VERBOSE = $VERBOSE, nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.8.pre.
|
4
|
+
version: 1.3.8.pre.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keiju ISHITSUKA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reline
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.8.pre.
|
19
|
+
version: 0.2.8.pre.11
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.8.pre.
|
26
|
+
version: 0.2.8.pre.11
|
27
27
|
description: Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
|
28
28
|
email:
|
29
29
|
- keiju@ruby-lang.org
|