Skip to content

Commit

Permalink
Merge pull request #1 from m-o-e/bugfix/cursor-prev_line
Browse files Browse the repository at this point in the history
Bugfix: Cursor.prev_line
  • Loading branch information
piotrmurach committed May 18, 2016
2 parents 4d97e0f + 1ffa6be commit 74daccb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/tty/cursor.rb
Expand Up @@ -118,7 +118,7 @@ def next_line

# @api public
def prev_line
ECMA_CSI + 'F'
ECMA_CSI + 'A' + ECMA_CSI + '1G'
end

# Clear current line
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/cursor_spec.rb
Expand Up @@ -19,7 +19,7 @@
expect(cursor.restore).to eq("\e[u")
end

it "gets current cursor positoin" do
it "gets current cursor position" do
expect(cursor.current).to eq("\e[6n")
end

Expand Down Expand Up @@ -64,7 +64,7 @@
end

it "moves cursor to previous line" do
expect(cursor.prev_line).to eq("\e[F")
expect(cursor.prev_line).to eq("\e[A\e[1G")
end

it "hides cursor for the duration of block call" do
Expand Down

0 comments on commit 74daccb

Please sign in to comment.