Skip to content

Commit

Permalink
No need to check x > 0
Browse files Browse the repository at this point in the history
Checked in the previous line.
  • Loading branch information
ima1zumi committed Nov 18, 2021
1 parent a045668 commit bf774c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/reline/ansi.rb
Expand Up @@ -266,15 +266,15 @@ def self.move_cursor_column(x)

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
end

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
Expand Down

0 comments on commit bf774c0

Please sign in to comment.