mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 06:12:16 +03:00
update for recent rustfmt changes
No functional changes
This commit is contained in:
parent
57b438f867
commit
d73892a4fd
@ -3,8 +3,8 @@
|
||||
//! background on what's happening in here.
|
||||
use failure::{self, Error};
|
||||
use guiloop::{GuiSender, WindowId};
|
||||
use mio::{Events, Poll, PollOpt, Ready, Token};
|
||||
use mio::unix::EventedFd;
|
||||
use mio::{Events, Poll, PollOpt, Ready, Token};
|
||||
use mio_extras::channel::{channel as mio_channel, Receiver as MioReceiver, Sender as MioSender};
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::sync::mpsc::{channel, Receiver, Sender, TryRecvError};
|
||||
|
@ -4,9 +4,9 @@ pub use self::fcwrap::Pattern as FontPattern;
|
||||
use super::hbwrap as harfbuzz;
|
||||
use config::{Config, TextStyle};
|
||||
use failure::{self, Error};
|
||||
use font::{fcwrap, ftwrap};
|
||||
use font::{shape_with_harfbuzz, FallbackIdx, Font, FontMetrics, FontSystem, GlyphInfo, NamedFont,
|
||||
RasterizedGlyph};
|
||||
use font::{fcwrap, ftwrap};
|
||||
use std::cell::RefCell;
|
||||
use std::mem;
|
||||
use std::slice;
|
||||
|
@ -82,7 +82,7 @@ impl FontConfiguration {
|
||||
}
|
||||
}
|
||||
// matches so far...
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
for rule in &self.config.font_rules {
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Abstracts over the font selection system for the system
|
||||
|
||||
use super::hbwrap as harfbuzz;
|
||||
use super::super::config::{Config, TextStyle};
|
||||
use super::hbwrap as harfbuzz;
|
||||
use failure::Error;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
|
@ -10,12 +10,12 @@
|
||||
//! Copyright (c) 2016 Alex Crichton
|
||||
//! Copyright (c) 2017 The Tokio Authors
|
||||
|
||||
use futures::{Async, Future};
|
||||
use futures::executor::{self, Notify, Spawn};
|
||||
use futures::future::{ExecuteError, Executor};
|
||||
use futures::{Async, Future};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::mpsc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use guiloop::{GuiReceiver, GuiSender};
|
||||
|
||||
|
@ -18,11 +18,11 @@ use std::io::{Read, Write};
|
||||
use std::os::unix::io::{AsRawFd, RawFd};
|
||||
use std::process::{Child, Command, ExitStatus};
|
||||
use std::rc::Rc;
|
||||
use term::{self, Terminal};
|
||||
use term::{MouseButton, MouseEventKind};
|
||||
use term::hyperlink::Hyperlink;
|
||||
use term::KeyCode;
|
||||
use term::KeyModifiers;
|
||||
use term::hyperlink::Hyperlink;
|
||||
use term::{self, Terminal};
|
||||
use term::{MouseButton, MouseEventKind};
|
||||
|
||||
struct Host {
|
||||
display: glium::Display,
|
||||
|
@ -1,8 +1,8 @@
|
||||
use super::SessionTerminated;
|
||||
use failure::Error;
|
||||
use futurecore;
|
||||
use mio::{Event, Evented, Events, Poll, PollOpt, Ready, Token};
|
||||
use mio::unix::EventedFd;
|
||||
use mio::{Event, Evented, Events, Poll, PollOpt, Ready, Token};
|
||||
pub use mio_extras::channel::{channel, Receiver as GuiReceiver, Sender as GuiSender};
|
||||
use sigchld;
|
||||
use std::cell::RefCell;
|
||||
@ -13,8 +13,8 @@ use std::rc::Rc;
|
||||
use std::sync::mpsc::TryRecvError;
|
||||
use std::time::{Duration, Instant};
|
||||
use xcb;
|
||||
use xwindows::Connection;
|
||||
use xwindows::xwin::TerminalWindow;
|
||||
use xwindows::Connection;
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos")))]
|
||||
pub use xcb::xproto::Window as WindowId;
|
||||
|
@ -51,14 +51,14 @@ use std::str;
|
||||
mod config;
|
||||
|
||||
mod futurecore;
|
||||
mod opengl;
|
||||
#[cfg(target_os = "macos")]
|
||||
mod remotemio;
|
||||
mod opengl;
|
||||
|
||||
mod clipboard;
|
||||
mod guiloop;
|
||||
#[cfg(target_os = "macos")]
|
||||
mod gliumwindows;
|
||||
mod guiloop;
|
||||
|
||||
use guiloop::{GuiEventLoop, TerminalWindow};
|
||||
|
||||
|
@ -5,16 +5,16 @@ use config::TextStyle;
|
||||
use euclid;
|
||||
use failure::{err_msg, Error};
|
||||
use font::{FontConfiguration, GlyphInfo};
|
||||
use glium::{self, IndexBuffer, Surface, VertexBuffer};
|
||||
use glium::backend::Facade;
|
||||
use glium::texture::SrgbTexture2d;
|
||||
use glium::{self, IndexBuffer, Surface, VertexBuffer};
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::mem;
|
||||
use std::ops::{Deref, Range};
|
||||
use std::rc::Rc;
|
||||
use term::{self, CursorPosition, Line, Underline};
|
||||
use term::color::RgbaTuple;
|
||||
use term::{self, CursorPosition, Line, Underline};
|
||||
|
||||
type Transform3D = euclid::Transform3D<f32>;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
//! Keeping track of sprite textures
|
||||
|
||||
use failure::Error;
|
||||
use glium::{self, Rect};
|
||||
use glium::backend::Facade;
|
||||
use glium::texture::{SrgbTexture2d, Texture2dDataSource};
|
||||
use glium::{self, Rect};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub const TEX_SIZE: u32 = 4096;
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
use failure::Error;
|
||||
use libc::{self, winsize};
|
||||
use mio::{Poll, PollOpt, Ready, Token};
|
||||
use mio::event::Evented;
|
||||
use mio::unix::EventedFd;
|
||||
use mio::{Poll, PollOpt, Ready, Token};
|
||||
use std::io;
|
||||
use std::mem;
|
||||
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
|
||||
|
@ -1,14 +1,14 @@
|
||||
use failure::Error;
|
||||
use futures::sync::oneshot;
|
||||
use guiloop::GuiSender;
|
||||
use mio::{Event, Evented, Events, Poll, PollOpt, Ready, Token};
|
||||
use mio::unix::EventedFd;
|
||||
use mio::{Event, Evented, Events, Poll, PollOpt, Ready, Token};
|
||||
use mio_extras::channel::{channel as mio_channel, Receiver as MioReceiver, Sender as MioSender};
|
||||
use std::collections::HashMap;
|
||||
use std::io;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::sync::Arc;
|
||||
use std::sync::mpsc::TryRecvError;
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
@ -2,8 +2,8 @@ use egli;
|
||||
use gl;
|
||||
use glium;
|
||||
use glium::backend::Backend;
|
||||
use mio::{Evented, Poll, PollOpt, Ready, Token};
|
||||
use mio::unix::EventedFd;
|
||||
use mio::{Evented, Poll, PollOpt, Ready, Token};
|
||||
use std::cell::RefCell;
|
||||
use std::io;
|
||||
use std::mem;
|
||||
@ -244,18 +244,16 @@ impl Window {
|
||||
0,
|
||||
xcb::WINDOW_CLASS_INPUT_OUTPUT as u16,
|
||||
screen.root_visual(),
|
||||
&[
|
||||
(
|
||||
xcb::CW_EVENT_MASK,
|
||||
xcb::EVENT_MASK_EXPOSURE | xcb::EVENT_MASK_KEY_PRESS
|
||||
| xcb::EVENT_MASK_BUTTON_PRESS
|
||||
| xcb::EVENT_MASK_BUTTON_RELEASE
|
||||
| xcb::EVENT_MASK_POINTER_MOTION
|
||||
| xcb::EVENT_MASK_BUTTON_MOTION
|
||||
| xcb::EVENT_MASK_KEY_RELEASE
|
||||
| xcb::EVENT_MASK_STRUCTURE_NOTIFY,
|
||||
),
|
||||
],
|
||||
&[(
|
||||
xcb::CW_EVENT_MASK,
|
||||
xcb::EVENT_MASK_EXPOSURE | xcb::EVENT_MASK_KEY_PRESS
|
||||
| xcb::EVENT_MASK_BUTTON_PRESS
|
||||
| xcb::EVENT_MASK_BUTTON_RELEASE
|
||||
| xcb::EVENT_MASK_POINTER_MOTION
|
||||
| xcb::EVENT_MASK_BUTTON_MOTION
|
||||
| xcb::EVENT_MASK_KEY_RELEASE
|
||||
| xcb::EVENT_MASK_STRUCTURE_NOTIFY,
|
||||
)],
|
||||
).request_check()?;
|
||||
Rc::new(WindowHolder {
|
||||
window_id,
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![allow(non_upper_case_globals, dead_code)]
|
||||
use xcb::KeyPressEvent;
|
||||
use xcb::ffi::xproto::xcb_keysym_t;
|
||||
use xcb::KeyPressEvent;
|
||||
|
||||
pub const XK_VoidSymbol: xcb_keysym_t = 0xff_ffff;
|
||||
pub const XK_BackSpace: xcb_keysym_t = 0xff08;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use super::{Connection, Window};
|
||||
use super::super::{get_shell, spawn_window};
|
||||
use super::super::opengl::render::Renderer;
|
||||
use super::super::{get_shell, spawn_window};
|
||||
use super::xkeysyms;
|
||||
use super::{Connection, Window};
|
||||
use clipboard::{Clipboard, ClipboardImpl, Paste};
|
||||
use config::Config;
|
||||
use failure::Error;
|
||||
@ -17,8 +17,8 @@ use std::os::unix::io::{AsRawFd, RawFd};
|
||||
use std::process::Child;
|
||||
use std::process::Command;
|
||||
use std::rc::Rc;
|
||||
use term::{self, KeyCode, KeyModifiers, MouseButton, MouseEvent, MouseEventKind};
|
||||
use term::hyperlink::Hyperlink;
|
||||
use term::{self, KeyCode, KeyModifiers, MouseButton, MouseEvent, MouseEventKind};
|
||||
use xcb;
|
||||
|
||||
/// Holds the terminal state for a tab owned by this window
|
||||
|
@ -74,19 +74,17 @@ impl RgbColor {
|
||||
let mut chars = s.chars().skip(1);
|
||||
|
||||
macro_rules! digit {
|
||||
() => {
|
||||
{
|
||||
let hi = match chars.next().unwrap().to_digit(16) {
|
||||
Some(v) => (v as u8) << 4,
|
||||
None => return None
|
||||
};
|
||||
let lo = match chars.next().unwrap().to_digit(16) {
|
||||
Some(v) => v as u8,
|
||||
None => return None
|
||||
};
|
||||
hi | lo
|
||||
}
|
||||
}
|
||||
() => {{
|
||||
let hi = match chars.next().unwrap().to_digit(16) {
|
||||
Some(v) => (v as u8) << 4,
|
||||
None => return None,
|
||||
};
|
||||
let lo = match chars.next().unwrap().to_digit(16) {
|
||||
Some(v) => v as u8,
|
||||
None => return None,
|
||||
};
|
||||
hi | lo
|
||||
}};
|
||||
}
|
||||
Some(Self::new(digit!(), digit!(), digit!()))
|
||||
} else {
|
||||
@ -270,8 +268,30 @@ impl Default for ColorPalette {
|
||||
|
||||
// 24 grey scales
|
||||
static GREYS: [u8; 24] = [
|
||||
0x08, 0x12, 0x1c, 0x26, 0x30, 0x3a, 0x44, 0x4e, 0x58, 0x62, 0x6c, 0x76, 0x80, 0x8a,
|
||||
0x94, 0x9e, 0xa8, 0xb2 /* Grey70 */, 0xbc, 0xc6, 0xd0, 0xda, 0xe4, 0xee,
|
||||
0x08,
|
||||
0x12,
|
||||
0x1c,
|
||||
0x26,
|
||||
0x30,
|
||||
0x3a,
|
||||
0x44,
|
||||
0x4e,
|
||||
0x58,
|
||||
0x62,
|
||||
0x6c,
|
||||
0x76,
|
||||
0x80,
|
||||
0x8a,
|
||||
0x94,
|
||||
0x9e,
|
||||
0xa8,
|
||||
0xb2, /* Grey70 */
|
||||
0xbc,
|
||||
0xc6,
|
||||
0xd0,
|
||||
0xda,
|
||||
0xe4,
|
||||
0xee,
|
||||
];
|
||||
|
||||
for idx in 0..24 {
|
||||
|
@ -201,16 +201,14 @@ mod test {
|
||||
|
||||
assert_eq!(
|
||||
Rule::match_hyperlinks(" http://example.com", &rules),
|
||||
vec![
|
||||
RuleMatch {
|
||||
range: 2..20,
|
||||
link: Rc::new(Hyperlink {
|
||||
url: "http://example.com".to_owned(),
|
||||
id: "".to_owned(),
|
||||
implicit: true,
|
||||
}),
|
||||
},
|
||||
]
|
||||
vec![RuleMatch {
|
||||
range: 2..20,
|
||||
link: Rc::new(Hyperlink {
|
||||
url: "http://example.com".to_owned(),
|
||||
id: "".to_owned(),
|
||||
implicit: true,
|
||||
}),
|
||||
}]
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
|
@ -289,8 +289,8 @@ impl Screen {
|
||||
///
|
||||
/// scroll the region down by num_rows. Any rows that would be scrolled
|
||||
/// beyond the bottom get removed from the screen.
|
||||
/// In other words, we remove (bottom-num_rows..bottom) and then insert num_rows
|
||||
/// at scroll_top.
|
||||
/// In other words, we remove (bottom-num_rows..bottom) and then insert
|
||||
/// num_rows at scroll_top.
|
||||
pub fn scroll_down(&mut self, scroll_region: &Range<VisibleRowIndex>, num_rows: usize) {
|
||||
debug!("scroll_down {:?} {}", scroll_region, num_rows);
|
||||
let phys_scroll = self.phys_range(scroll_region);
|
||||
|
@ -990,7 +990,8 @@ impl TerminalState {
|
||||
}
|
||||
|
||||
/// Moves the cursor to the next tab stop. If there are no more tab stops,
|
||||
/// the cursor moves to the right margin. HT does not cause text to auto wrap.
|
||||
/// the cursor moves to the right margin. HT does not cause text to auto
|
||||
/// wrap.
|
||||
fn c0_horizontal_tab(&mut self) {
|
||||
let x = match self.tabs.find_next_tab_stop(self.cursor.x) {
|
||||
Some(x) => x,
|
||||
|
@ -2,10 +2,10 @@
|
||||
//! processing routines.
|
||||
|
||||
use super::*;
|
||||
mod selection;
|
||||
mod c0;
|
||||
mod c1;
|
||||
mod csi;
|
||||
mod selection;
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
struct TestHost {
|
||||
|
Loading…
Reference in New Issue
Block a user