diff options
| author | Kyrylo Silin <silin@kyrylo.org> | 2015-03-08 08:41:48 +0200 |
|---|---|---|
| committer | Kyrylo Silin <silin@kyrylo.org> | 2015-03-08 10:06:56 +0200 |
| commit | dd92e2a3595e3bb1fe9611d3e743cd7a0bd36c61 (patch) | |
| tree | aa25d46e3ae69e2aaa90c7c318551f7bf0e083d4 /lib/pry/pry_instance.rb | |
| parent | 65fdcba0d97f2c325909454f000ce7dfbc772b2f (diff) | |
| download | pry-1369-blank-prefix-fix.tar.gz | |
Fix regression with respect to space prefixes1369-blank-prefix-fix
Fixes #1369 (Prefixing commands with a space is not working)
The regression was introduced by this commit:
68bcca22a0c0f5f1e501e6316e3d51d95677542a
Since then the main logic for the REPL was hugely refactored. This
refactoring morphed the error into this commit:
e020f8cecd32fe3498790c888cc873d0f323c518
Sorry about this hacky solution.
Diffstat (limited to 'lib/pry/pry_instance.rb')
| -rw-r--r-- | lib/pry/pry_instance.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 0877ab24..bf843790 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -269,7 +269,7 @@ class Pry @suppress_output = false inject_sticky_locals! begin - if !process_command_safely(line.lstrip) + if !process_command_safely(line) @eval_string << "#{line.chomp}\n" if !line.empty? || !@eval_string.empty? end rescue RescuableException => e @@ -400,6 +400,7 @@ class Pry # @param [String] val The line to process. # @return [Boolean] `true` if `val` is a command, `false` otherwise def process_command(val) + val = val.lstrip if /^\s\S/ !~ val val = val.chomp result = commands.process_line(val, :target => current_binding, |
