Verified Commit 995d5ec5 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

0.5.0 - update vte to 0.8

parent e77e8fce
......@@ -2,7 +2,7 @@
name = "ransid"
description = "Rust ANSI Driver"
repository = "https://gitlab.redox-os.org/redox-os/ransid"
version = "0.4.9"
version = "0.5.0"
license = "MIT"
readme = "README.md"
keywords = ["redox", "ansi"]
......@@ -14,4 +14,4 @@ path = "src/lib.rs"
[dependencies]
log = "0.4"
vte = "0.3"
vte = "0.8"
......@@ -30,7 +30,7 @@ impl Color {
13 => encode_rgb(0xff, 0x00, 0xff),
14 => encode_rgb(0x00, 0xff, 0xff),
15 => encode_rgb(0xff, 0xff, 0xff),
16 ... 231 => {
16 ..= 231 => {
let convert = |value: u8| -> u8 {
match value {
0 => 0,
......@@ -43,11 +43,10 @@ impl Color {
let b = convert((value - 16) % 6);
encode_rgb(r, g, b)
},
232 ... 255 => {
232 ..= 255 => {
let gray = (value - 232) * 10 + 8;
encode_rgb(gray, gray, gray)
},
_ => encode_rgb(0, 0, 0)
}
}
}
......
......@@ -411,7 +411,7 @@ impl State {
});
},
'S' => {
let param = params.get(0).map(|v| *v).unwrap_or(1);;
let param = params.get(0).map(|v| *v).unwrap_or(1);
self.scroll(cmp::max(0, param) as usize, callback);
},
'T' => {
......@@ -600,7 +600,7 @@ impl State {
29 => {
self.strikethrough = false;
},
30 ... 37 => self.foreground = Color::Ansi(*value as u8 - 30),
30 ..= 37 => self.foreground = Color::Ansi(*value as u8 - 30),
38 => match value_iter.next().map(|v| *v).unwrap_or(0) {
2 => {
//True color
......@@ -619,7 +619,7 @@ impl State {
39 => {
self.foreground = self.foreground_default;
},
40 ... 47 => self.background = Color::Ansi(*value as u8 - 40),
40 ..= 47 => self.background = Color::Ansi(*value as u8 - 40),
48 => match value_iter.next().map(|v| *v).unwrap_or(0) {
2 => {
//True color
......@@ -698,7 +698,7 @@ impl State {
}
}
pub fn esc<F: FnMut(Event)>(&mut self, c: char, _params: &[i64], intermediates: &[u8], callback: &mut F) {
pub fn esc<F: FnMut(Event)>(&mut self, c: char, intermediates: &[u8], callback: &mut F) {
match c {
'D' => {
self.y += 1;
......@@ -826,8 +826,8 @@ impl<'a, F: FnMut(Event)> vte::Perform for Performer<'a, F> {
self.state.execute(byte as char, self.callback);
}
fn hook(&mut self, _params: &[i64], _intermediates: &[u8], _ignore: bool) {
trace!("[hook] params={:?}, intermediates={:?}, ignore={:?}", _params, _intermediates, _ignore);
fn hook(&mut self, _params: &[i64], _intermediates: &[u8], _ignore: bool, _action: char) {
trace!("[hook] params={:?}, intermediates={:?}, ignore={:?}, action={:?}", _params, _intermediates, _ignore, _action);
}
fn put(&mut self, _byte: u8) {
......@@ -838,8 +838,8 @@ impl<'a, F: FnMut(Event)> vte::Perform for Performer<'a, F> {
trace!("[unhook]");
}
fn osc_dispatch(&mut self, params: &[&[u8]]) {
trace!("[osc] params={:?}", params);
fn osc_dispatch(&mut self, params: &[&[u8]], _bell_terminated: bool) {
trace!("[osc] params={:?}, bell_terminated={:?}", params, _bell_terminated);
self.state.osc(params, self.callback);
}
......@@ -848,9 +848,9 @@ impl<'a, F: FnMut(Event)> vte::Perform for Performer<'a, F> {
self.state.csi(c, params, intermediates, self.callback);
}
fn esc_dispatch(&mut self, params: &[i64], intermediates: &[u8], _ignore: bool, byte: u8) {
trace!("[esc] params={:?}, intermediates={:?}, ignore={:?}, byte={:02x} at {}, {}", params, intermediates, _ignore, byte, self.state.x, self.state.y);
self.state.esc(byte as char, params, intermediates, self.callback);
fn esc_dispatch(&mut self, intermediates: &[u8], _ignore: bool, byte: u8) {
trace!("[esc] intermediates={:?}, ignore={:?}, byte={:02x} at {}, {}", intermediates, _ignore, byte, self.state.x, self.state.y);
self.state.esc(byte as char, intermediates, self.callback);
}
}
......
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