mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Revert "Always start the prompt in the first column (fix #551)"
This fixes #564 this commit does more harm than good, as it
causes things to break badly on libedit. The bug it's fixing is
also quite trivial and highly unlikely to annoy anybody in
practice.
This reverts commit 7af3660042
.
This commit is contained in:
parent
ac54ebd795
commit
4fe5346d53
2 changed files with 8 additions and 14 deletions
|
@ -333,25 +333,19 @@ class Pry
|
|||
def retrieve_line(eval_string, target)
|
||||
@indent.reset if eval_string.empty?
|
||||
|
||||
# If necessary, make sure the prompt starts in the first column (issue #551)
|
||||
if Pry::Helpers::BaseHelpers.use_ansi_codes? && Pry.config.correct_indent
|
||||
column_reset = "\e[0G"
|
||||
end
|
||||
|
||||
current_prompt = select_prompt(eval_string, target)
|
||||
completion_proc = Pry::InputCompleter.build_completion_proc(target,
|
||||
instance_eval(&custom_completions))
|
||||
|
||||
|
||||
indentation = Pry.config.auto_indent ? @indent.current_prefix : ''
|
||||
|
||||
completion_proc = Pry::InputCompleter.build_completion_proc(
|
||||
target, instance_eval(&custom_completions))
|
||||
|
||||
begin
|
||||
full_prompt = "#{column_reset}#{current_prompt}#{indentation}"
|
||||
val = readline(full_prompt, completion_proc)
|
||||
val = readline("#{current_prompt}#{indentation}", completion_proc)
|
||||
|
||||
# Handle <Ctrl-C> like Bash: empty the current input buffer but do not
|
||||
# quit. This is only for Ruby 1.9; other versions of Ruby do not let you
|
||||
# send Interrupt from within Readline.
|
||||
# Handle <Ctrl+C> like Bash, empty the current input buffer but do not quit.
|
||||
# This is only for ruby-1.9; other versions of ruby do not let you send Interrupt
|
||||
# from within Readline.
|
||||
rescue Interrupt => e
|
||||
output.puts ""
|
||||
eval_string.replace("")
|
||||
|
|
|
@ -37,7 +37,7 @@ describe "test Pry defaults" do
|
|||
end.new
|
||||
|
||||
Pry.start(self, :input => arity_one_input, :output => Pry::NullOutput)
|
||||
arity_one_input.prompt.should.include? Pry.prompt.call
|
||||
arity_one_input.prompt.should == Pry.prompt.call
|
||||
end
|
||||
|
||||
it 'should not pass in the prompt if the arity is 0' do
|
||||
|
|
Loading…
Reference in a new issue