Commit 3574eaa7 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

0.3.4 - fix cursor movement csis

parent c031a65f
......@@ -2,7 +2,7 @@
name = "ransid"
description = "Rust ANSI Driver"
repository = "https://github.com/jackpot51/ransid"
version = "0.3.3"
version = "0.3.4"
license-file = "LICENSE"
readme = "README.md"
keywords = ["redox", "ansi"]
......
......@@ -194,19 +194,19 @@ impl Console {
self.sequence.push(String::new());
},
'A' => {
self.y -= cmp::min(self.y, self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1));
self.y -= cmp::min(self.y, cmp::max(1, self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1)));
self.escape_sequence = false;
},
'B' => {
self.y += cmp::min(self.h.checked_sub(self.y + 1).unwrap_or(0), self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1));
self.y += cmp::min(self.h.checked_sub(self.y + 1).unwrap_or(0), cmp::max(1, self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1)));
self.escape_sequence = false;
},
'C' => {
self.x += cmp::min(self.w.checked_sub(self.x + 1).unwrap_or(0), self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1));
self.x += cmp::min(self.w.checked_sub(self.x + 1).unwrap_or(0), cmp::max(1, self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1)));
self.escape_sequence = false;
},
'D' => {
self.x -= cmp::min(self.x, self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1));
self.x -= cmp::min(self.x, cmp::max(1, self.sequence.get(0).map_or("", |p| &p).parse::<usize>().unwrap_or(1)));
self.escape_sequence = false;
},
'E' => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment