Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for irb crash during completion

For some Ruby implementations Readline.point is missing. This causes irb
to crash under Ruby Enterprise Edition 2011.12 for any irb completion
that is attempted. This change at least avoids the crash though the
original function (opening the text editor) cannot be executed anymore.
  • Loading branch information...
commit 2238495439775622254cf3948f788f9d0b198ba2 1 parent db62496
@flori flori authored committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/pry-editline.rb
View
4 lib/pry-editline.rb
@@ -48,7 +48,9 @@ def self.hijack_inputrc
def self.completion_proc
lambda do |s|
- if Readline.point == 0 && Readline.line_buffer =~ / $/
+ if Readline.respond_to?(:point) && Readline.respond_to?(:line_buffer) &&
+ Readline.point == 0 && Readline.line_buffer =~ / $/
+ then
require 'tempfile'
Tempfile.open(['readline-','.rb']) do |f|
f.puts(Readline.line_buffer[0..-3])
Please sign in to comment.
Something went wrong with that request. Please try again.