mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
indentation is now reset if the eval_string is cleared (i.e when the ! command is invoked)
This commit is contained in:
parent
3ea75bb026
commit
c3ce60e749
1 changed files with 4 additions and 3 deletions
|
@ -287,7 +287,10 @@ class Pry
|
||||||
# @param [Binding] target The target of the session.
|
# @param [Binding] target The target of the session.
|
||||||
# @return [String] The line received.
|
# @return [String] The line received.
|
||||||
def retrieve_line(eval_string, target)
|
def retrieve_line(eval_string, target)
|
||||||
|
@indent.reset if eval_string.empty?
|
||||||
|
|
||||||
current_prompt = select_prompt(eval_string.empty?, target.eval('self'))
|
current_prompt = select_prompt(eval_string.empty?, target.eval('self'))
|
||||||
|
|
||||||
val = readline(current_prompt)
|
val = readline(current_prompt)
|
||||||
|
|
||||||
# exit session if we receive EOF character (^D)
|
# exit session if we receive EOF character (^D)
|
||||||
|
@ -436,9 +439,7 @@ class Pry
|
||||||
# @param [String] current_prompt The prompt to use for input.
|
# @param [String] current_prompt The prompt to use for input.
|
||||||
# @return [String] The next line of input.
|
# @return [String] The next line of input.
|
||||||
def readline(current_prompt="> ")
|
def readline(current_prompt="> ")
|
||||||
if Pry.config.auto_indent
|
current_prompt += @indent.indent_level || '' if Pry.config.auto_indent
|
||||||
current_prompt += @indent.stack[-1] || ''
|
|
||||||
end
|
|
||||||
|
|
||||||
handle_read_errors do
|
handle_read_errors do
|
||||||
if input == Readline
|
if input == Readline
|
||||||
|
|
Loading…
Reference in a new issue