1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] No need to check x > 0

Checked in the previous line.

https://github.com/ruby/reline/commit/bf774c0f2c
This commit is contained in:
ima1zumi 2021-11-17 23:10:45 +09:00 committed by git
parent 0b22e3e1df
commit 4d4716d939

View file

@ -277,7 +277,7 @@ class Reline::ANSI
def self.move_cursor_up(x)
if x > 0
@@output.write "\e[#{x}A" if x > 0
@@output.write "\e[#{x}A"
elsif x < 0
move_cursor_down(-x)
end
@ -285,7 +285,7 @@ class Reline::ANSI
def self.move_cursor_down(x)
if x > 0
@@output.write "\e[#{x}B" if x > 0
@@output.write "\e[#{x}B"
elsif x < 0
move_cursor_up(-x)
end