1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-30 14:49:26 +03:00

bump some deps

This commit is contained in:
Wez Furlong 2019-05-27 20:08:02 -07:00
parent 91ea7cd576
commit 98bd82e212
6 changed files with 48 additions and 47 deletions

View File

@ -8,7 +8,7 @@ edition = "2018"
bitflags = "~1.0" bitflags = "~1.0"
failure = "~0.1" failure = "~0.1"
image = "0.21" image = "0.21"
ordered-float = "~0.5" ordered-float = "1.0"
unicode-segmentation = "~1.2" unicode-segmentation = "~1.2"
unicode-width = "~0.1" unicode-width = "~0.1"
serde = {version="~1.0", features = ["rc"]} serde = {version="~1.0", features = ["rc"]}

View File

@ -4,7 +4,7 @@
use super::*; use super::*;
use failure::bail; use failure::bail;
use image::{self, GenericImageView}; use image::{self, GenericImageView};
use ordered_float::NotNaN; use ordered_float::NotNan;
use std::fmt::Write; use std::fmt::Write;
use std::sync::Arc; use std::sync::Arc;
use termwiz::escape::csi::{ use termwiz::escape::csi::{
@ -1315,7 +1315,7 @@ impl TerminalState {
let image_data = Arc::new(ImageData::with_raw_data(image.data)); let image_data = Arc::new(ImageData::with_raw_data(image.data));
let mut ypos = NotNaN::new(0.0).unwrap(); let mut ypos = NotNan::new(0.0).unwrap();
let cursor_x = self.cursor.x; let cursor_x = self.cursor.x;
let x_delta = 1.0 / available_pixel_width as f32; let x_delta = 1.0 / available_pixel_width as f32;
let y_delta = 1.0 / available_pixel_height as f32; let y_delta = 1.0 / available_pixel_height as f32;
@ -1324,7 +1324,7 @@ impl TerminalState {
width_in_cells, height_in_cells, width, height width_in_cells, height_in_cells, width, height
); );
for _ in 0..height_in_cells { for _ in 0..height_in_cells {
let mut xpos = NotNaN::new(0.0).unwrap(); let mut xpos = NotNan::new(0.0).unwrap();
let cursor_y = self.cursor.y; let cursor_y = self.cursor.y;
eprintln!( eprintln!(
"setting cells for y={} x=[{}..{}]", "setting cells for y={} x=[{}..{}]",

View File

@ -1,36 +1,37 @@
[package] [package]
authors = ["Wez Furlong"] authors = ["Wez Furlong"]
name = "termwiz" name = "termwiz"
version = "0.1.0" version = "0.2"
edition = "2018" edition = "2018"
repository = "https://github.com/wez/wezterm" repository = "https://github.com/wez/wezterm"
description = "Terminal Wizardry for Unix and Windows" description = "Terminal Wizardry for Unix and Windows"
license = "MIT" license = "MIT"
documentation = "https://docs.rs/termwiz" documentation = "https://docs.rs/termwiz"
keywords = ["terminal", "readline", "console", "curses"] keywords = ["terminal", "readline", "console", "curses"]
readme = "README.md"
[dependencies] [dependencies]
base64 = "~0.9" base64 = "0.10"
bitflags = "~1.0" bitflags = "1.0"
cassowary = "~0.3" cassowary = "0.3"
derive_builder = "~0.5" derive_builder = "0.7"
failure = "~0.1" failure = "0.1"
fnv = "~1.0" fnv = "1.0"
image = "0.21" image = "0.21"
libc = "~0.2" libc = "0.2"
memmem = "~0.1" memmem = "0.1"
num = "~0.2" num = "0.2"
num-traits = "~0.2" num-traits = "0.2"
ordered-float = "~0.5" ordered-float = "1.0"
palette = "~0.4" palette = "0.4"
regex = "~0.2" regex = "0.2"
semver = "0.9" semver = "0.9"
serde = {version="~1.0", features = ["rc"]} serde = {version="1.0", features = ["rc"]}
serde_derive = "~1.0" serde_derive = "1.0"
smallvec = "~0.6" smallvec = "0.6"
terminfo = "~0.6" terminfo = "0.6"
unicode-segmentation = "~1.2" unicode-segmentation = "1.2"
unicode-width = "~0.1" unicode-width = "0.1"
vte = "0.3" vte = "0.3"
[dev-dependencies] [dev-dependencies]
@ -38,10 +39,10 @@ varbincode = "0.1"
[dependencies.num-derive] [dependencies.num-derive]
features = ["full-syntax"] features = ["full-syntax"]
version = "~0.2" version = "0.2"
[target."cfg(unix)".dependencies] [target."cfg(unix)".dependencies]
signal-hook = "~0.1" signal-hook = "0.1"
termios = "~0.3" termios = "0.3"
[target."cfg(windows)".dependencies.winapi] [target."cfg(windows)".dependencies.winapi]
features = [ features = [
"winbase", "winbase",
@ -52,4 +53,4 @@ features = [
"fileapi", "fileapi",
"synchapi", "synchapi",
] ]
version = "~0.3" version = "0.3"

View File

@ -4,7 +4,7 @@ use bitflags::bitflags;
use failure::{bail, ensure, err_msg, Fallible}; use failure::{bail, ensure, err_msg, Fallible};
use num; use num;
use num_derive::*; use num_derive::*;
use ordered_float::NotNaN; use ordered_float::NotNan;
use std::collections::HashMap; use std::collections::HashMap;
use std::fmt::{Display, Error as FmtError, Formatter}; use std::fmt::{Display, Error as FmtError, Formatter};
use std::str; use std::str;
@ -251,8 +251,8 @@ pub enum ITermProprietary {
/// The response to RequestCellSize. The height and width are the dimensions /// The response to RequestCellSize. The height and width are the dimensions
/// of a cell measured in points /// of a cell measured in points
ReportCellSize { ReportCellSize {
height_points: NotNaN<f32>, height_points: NotNan<f32>,
width_points: NotNaN<f32>, width_points: NotNan<f32>,
}, },
/// Place a string in the systems pasteboard /// Place a string in the systems pasteboard
Copy(String), Copy(String),
@ -539,8 +539,8 @@ impl ITermProprietary {
if osc.len() == 3 && keyword == "ReportCellSize" && p1.is_some() { if osc.len() == 3 && keyword == "ReportCellSize" && p1.is_some() {
if let Some(p1) = p1 { if let Some(p1) = p1 {
return Ok(ITermProprietary::ReportCellSize { return Ok(ITermProprietary::ReportCellSize {
height_points: NotNaN::new(p1.parse()?)?, height_points: NotNan::new(p1.parse()?)?,
width_points: NotNaN::new(String::from_utf8_lossy(osc[2]).parse()?)?, width_points: NotNan::new(String::from_utf8_lossy(osc[2]).parse()?)?,
}); });
} }
} }
@ -728,8 +728,8 @@ mod test {
"\x1b]1337;ReportCellSize=12;15.5\x07" "\x1b]1337;ReportCellSize=12;15.5\x07"
), ),
OperatingSystemCommand::ITermProprietary(ITermProprietary::ReportCellSize { OperatingSystemCommand::ITermProprietary(ITermProprietary::ReportCellSize {
height_points: NotNaN::new(12.0).unwrap(), height_points: NotNan::new(12.0).unwrap(),
width_points: NotNaN::new(15.5).unwrap() width_points: NotNan::new(15.5).unwrap()
}) })
); );

View File

@ -11,21 +11,21 @@
// protocol appears to track the images out of band as attachments with // protocol appears to track the images out of band as attachments with
// z-order. // z-order.
use ordered_float::NotNaN; use ordered_float::NotNan;
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_derive::*; use serde_derive::*;
use std::sync::Arc; use std::sync::Arc;
fn deserialize_notnan<'de, D>(deserializer: D) -> Result<NotNaN<f32>, D::Error> fn deserialize_notnan<'de, D>(deserializer: D) -> Result<NotNan<f32>, D::Error>
where where
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
let value = f32::deserialize(deserializer)?; let value = f32::deserialize(deserializer)?;
NotNaN::new(value).map_err(|e| serde::de::Error::custom(format!("{:?}", e))) NotNan::new(value).map_err(|e| serde::de::Error::custom(format!("{:?}", e)))
} }
#[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))] #[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))]
fn serialize_notnan<S>(value: &NotNaN<f32>, serializer: S) -> Result<S::Ok, S::Error> fn serialize_notnan<S>(value: &NotNan<f32>, serializer: S) -> Result<S::Ok, S::Error>
where where
S: Serializer, S: Serializer,
{ {
@ -38,22 +38,22 @@ pub struct TextureCoordinate {
deserialize_with = "deserialize_notnan", deserialize_with = "deserialize_notnan",
serialize_with = "serialize_notnan" serialize_with = "serialize_notnan"
)] )]
pub x: NotNaN<f32>, pub x: NotNan<f32>,
#[serde( #[serde(
deserialize_with = "deserialize_notnan", deserialize_with = "deserialize_notnan",
serialize_with = "serialize_notnan" serialize_with = "serialize_notnan"
)] )]
pub y: NotNaN<f32>, pub y: NotNan<f32>,
} }
impl TextureCoordinate { impl TextureCoordinate {
pub fn new(x: NotNaN<f32>, y: NotNaN<f32>) -> Self { pub fn new(x: NotNan<f32>, y: NotNan<f32>) -> Self {
Self { x, y } Self { x, y }
} }
pub fn new_f32(x: f32, y: f32) -> Self { pub fn new_f32(x: f32, y: f32) -> Self {
let x = NotNaN::new(x).unwrap(); let x = NotNan::new(x).unwrap();
let y = NotNaN::new(y).unwrap(); let y = NotNan::new(y).unwrap();
Self::new(x, y) Self::new(x, y)
} }
} }

View File

@ -1,7 +1,7 @@
use crate::cell::{AttributeChange, Cell, CellAttributes}; use crate::cell::{AttributeChange, Cell, CellAttributes};
use crate::color::ColorAttribute; use crate::color::ColorAttribute;
use crate::image::ImageCell; use crate::image::ImageCell;
use ordered_float::NotNaN; use ordered_float::NotNan;
use serde_derive::*; use serde_derive::*;
use std::borrow::Cow; use std::borrow::Cow;
use std::cmp::min; use std::cmp::min;
@ -277,9 +277,9 @@ impl Surface {
self.ypos -= scroll; self.ypos -= scroll;
} }
let mut ypos = NotNaN::new(0.0).unwrap(); let mut ypos = NotNan::new(0.0).unwrap();
for y in 0..image.height { for y in 0..image.height {
let mut xpos = NotNaN::new(0.0).unwrap(); let mut xpos = NotNan::new(0.0).unwrap();
for x in 0..image.width { for x in 0..image.width {
self.lines[self.ypos + y].set_cell( self.lines[self.ypos + y].set_cell(
self.xpos + x, self.xpos + x,