Permalink
Browse files

Renamed replace_line to #line= and made it copy its argument

  • Loading branch information...
1 parent 0b25bc5 commit 64b48c51e71fbafdf86940463237dac46b8fa816 @Mon-Ouie committed Mar 27, 2013
Showing with 8 additions and 8 deletions.
  1. +8 −8 lib/coolline/coolline.rb
View
@@ -197,13 +197,11 @@ def readline(prompt = ">> ", default_line = "")
@history.delete_empty
- @line = default_line.dup
- @pos = @line.size
- @accumulator = nil
-
+ @accumulator = nil
@history_moved = false
+ @should_exit = false
- @should_exit = false
+ self.line = default_line
render
@@ -415,9 +413,11 @@ def word_boundary?(char)
char =~ word_boundaries_regexp
end
- def replace_line(new_line)
- @line = new_line
- @pos = new_line.size
+ def line=(new_line)
+ @line = new_line.dup
+ @pos = new_line.size
+
+ render
end
private

0 comments on commit 64b48c5

Please sign in to comment.