summaryrefslogtreecommitdiff
path: root/lib/reline/ansi.rb
diff options
context:
space:
mode:
authoraycabta <[email protected]>2020-02-14 22:34:56 +0900
committeraycabta <[email protected]>2020-02-14 22:47:27 +0900
commit2efb38e766b6fc304bb933d696c7500425d178a1 (patch)
tree43837b3b7899395a9b0d57ff126f7a87c765d33f /lib/reline/ansi.rb
parent78282d4655c05348ce7df24058623d3e868a08e6 (diff)
[ruby/reline] Use IO#write instead of IO#print
IO#print always adds a string of $\ automatically. https://github.com/ruby/reline/commit/a93119c847
Diffstat (limited to 'lib/reline/ansi.rb')
-rw-r--r--lib/reline/ansi.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb
index 9959529425..3ef02d6e7a 100644
--- a/lib/reline/ansi.rb
+++ b/lib/reline/ansi.rb
@@ -124,12 +124,12 @@ class Reline::ANSI
end
def self.move_cursor_column(x)
- print "\e[#{x + 1}G"
+ @@output.write "\e[#{x + 1}G"
end
def self.move_cursor_up(x)
if x > 0
- print "\e[#{x}A" if x > 0
+ @@output.write "\e[#{x}A" if x > 0
elsif x < 0
move_cursor_down(-x)
end
@@ -137,24 +137,24 @@ class Reline::ANSI
def self.move_cursor_down(x)
if x > 0
- print "\e[#{x}B" if x > 0
+ @@output.write "\e[#{x}B" if x > 0
elsif x < 0
move_cursor_up(-x)
end
end
def self.erase_after_cursor
- print "\e[K"
+ @@output.write "\e[K"
end
def self.scroll_down(x)
return if x.zero?
- print "\e[#{x}S"
+ @@output.write "\e[#{x}S"
end
def self.clear_screen
- print "\e[2J"
- print "\e[1;1H"
+ @@output.write "\e[2J"
+ @@output.write "\e[1;1H"
end
@@old_winch_handler = nil