Skip to content

Commit

Permalink
Do not append a newline char to @line ivar
Browse files Browse the repository at this point in the history
This commit indirectly fixes issue #688 (Coolline repeats the last two
characters of closing blocks) from the bug tracker of `pry`:
pry/pry#688

------------------------------------------------------------------------
Description by jasonLaster:

When correcting for indentation, the last 2 characters of the closing
keyword "end" are repeated. Another weird glitch is that this doesn't
happen with Readline.

  [1] pry(main)> loop do
  [1] pry(main)*   loop do
  [1] pry(main)*   endnd
  [1] pry(main)* endnd
------------------------------------------------------------------------

To be honest, I found out that by accident. I don't fully realize why
this commit fixes the bug, but I think I found a mare's nest.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Reported-by: Jason Laster <jason.laster.11@gmail.com>
  • Loading branch information
kyrylo committed Aug 17, 2012
1 parent d92bfce commit e45cc15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/coolline/coolline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def readline(prompt = ">> ")

@history.save_line

@line + "\n"
@line
end

# Reads a line with no prompt
Expand Down

0 comments on commit e45cc15

Please sign in to comment.