mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
Run cargo --fix edition=2018
This commit is contained in:
parent
7ab0b44847
commit
08069a4e6c
23 changed files with 156 additions and 155 deletions
|
@ -7,6 +7,7 @@ build = "build.rs"
|
||||||
description = "GPU-accelerated terminal emulator"
|
description = "GPU-accelerated terminal emulator"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
homepage = "https://github.com/jwilm/alacritty"
|
homepage = "https://github.com/jwilm/alacritty"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
|
62
src/ansi.rs
62
src/ansi.rs
|
@ -19,9 +19,9 @@ use std::str;
|
||||||
|
|
||||||
use vte;
|
use vte;
|
||||||
use base64;
|
use base64;
|
||||||
use index::{Column, Line, Contains};
|
use crate::index::{Column, Line, Contains};
|
||||||
|
|
||||||
use ::{MouseCursor, Rgb};
|
use crate::{MouseCursor, Rgb};
|
||||||
|
|
||||||
// Parse color arguments
|
// Parse color arguments
|
||||||
//
|
//
|
||||||
|
@ -176,10 +176,10 @@ pub trait TermInfo {
|
||||||
/// writing specific handler impls for tests far easier.
|
/// writing specific handler impls for tests far easier.
|
||||||
pub trait Handler {
|
pub trait Handler {
|
||||||
/// OSC to set window title
|
/// OSC to set window title
|
||||||
fn set_title(&mut self, &str) {}
|
fn set_title(&mut self, _: &str) {}
|
||||||
|
|
||||||
/// Set the window's mouse cursor
|
/// Set the window's mouse cursor
|
||||||
fn set_mouse_cursor(&mut self, MouseCursor) {}
|
fn set_mouse_cursor(&mut self, _: MouseCursor) {}
|
||||||
|
|
||||||
/// Set the cursor style
|
/// Set the cursor style
|
||||||
fn set_cursor_style(&mut self, _: Option<CursorStyle>) {}
|
fn set_cursor_style(&mut self, _: Option<CursorStyle>) {}
|
||||||
|
@ -188,42 +188,42 @@ pub trait Handler {
|
||||||
fn input(&mut self, _c: char) {}
|
fn input(&mut self, _c: char) {}
|
||||||
|
|
||||||
/// Set cursor to position
|
/// Set cursor to position
|
||||||
fn goto(&mut self, Line, Column) {}
|
fn goto(&mut self, _: Line, _: Column) {}
|
||||||
|
|
||||||
/// Set cursor to specific row
|
/// Set cursor to specific row
|
||||||
fn goto_line(&mut self, Line) {}
|
fn goto_line(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Set cursor to specific column
|
/// Set cursor to specific column
|
||||||
fn goto_col(&mut self, Column) {}
|
fn goto_col(&mut self, _: Column) {}
|
||||||
|
|
||||||
/// Insert blank characters in current line starting from cursor
|
/// Insert blank characters in current line starting from cursor
|
||||||
fn insert_blank(&mut self, Column) {}
|
fn insert_blank(&mut self, _: Column) {}
|
||||||
|
|
||||||
/// Move cursor up `rows`
|
/// Move cursor up `rows`
|
||||||
fn move_up(&mut self, Line) {}
|
fn move_up(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Move cursor down `rows`
|
/// Move cursor down `rows`
|
||||||
fn move_down(&mut self, Line) {}
|
fn move_down(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Identify the terminal (should write back to the pty stream)
|
/// Identify the terminal (should write back to the pty stream)
|
||||||
///
|
///
|
||||||
/// TODO this should probably return an io::Result
|
/// TODO this should probably return an io::Result
|
||||||
fn identify_terminal<W: io::Write>(&mut self, &mut W) {}
|
fn identify_terminal<W: io::Write>(&mut self, _: &mut W) {}
|
||||||
|
|
||||||
// Report device status
|
// Report device status
|
||||||
fn device_status<W: io::Write>(&mut self, &mut W, usize) {}
|
fn device_status<W: io::Write>(&mut self, _: &mut W, _: usize) {}
|
||||||
|
|
||||||
/// Move cursor forward `cols`
|
/// Move cursor forward `cols`
|
||||||
fn move_forward(&mut self, Column) {}
|
fn move_forward(&mut self, _: Column) {}
|
||||||
|
|
||||||
/// Move cursor backward `cols`
|
/// Move cursor backward `cols`
|
||||||
fn move_backward(&mut self, Column) {}
|
fn move_backward(&mut self, _: Column) {}
|
||||||
|
|
||||||
/// Move cursor down `rows` and set to column 1
|
/// Move cursor down `rows` and set to column 1
|
||||||
fn move_down_and_cr(&mut self, Line) {}
|
fn move_down_and_cr(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Move cursor up `rows` and set to column 1
|
/// Move cursor up `rows` and set to column 1
|
||||||
fn move_up_and_cr(&mut self, Line) {}
|
fn move_up_and_cr(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Put `count` tabs
|
/// Put `count` tabs
|
||||||
fn put_tab(&mut self, _count: i64) {}
|
fn put_tab(&mut self, _count: i64) {}
|
||||||
|
@ -252,28 +252,28 @@ pub trait Handler {
|
||||||
fn set_horizontal_tabstop(&mut self) {}
|
fn set_horizontal_tabstop(&mut self) {}
|
||||||
|
|
||||||
/// Scroll up `rows` rows
|
/// Scroll up `rows` rows
|
||||||
fn scroll_up(&mut self, Line) {}
|
fn scroll_up(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Scroll down `rows` rows
|
/// Scroll down `rows` rows
|
||||||
fn scroll_down(&mut self, Line) {}
|
fn scroll_down(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Insert `count` blank lines
|
/// Insert `count` blank lines
|
||||||
fn insert_blank_lines(&mut self, Line) {}
|
fn insert_blank_lines(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Delete `count` lines
|
/// Delete `count` lines
|
||||||
fn delete_lines(&mut self, Line) {}
|
fn delete_lines(&mut self, _: Line) {}
|
||||||
|
|
||||||
/// Erase `count` chars in current line following cursor
|
/// Erase `count` chars in current line following cursor
|
||||||
///
|
///
|
||||||
/// Erase means resetting to the default state (default colors, no content,
|
/// Erase means resetting to the default state (default colors, no content,
|
||||||
/// no mode flags)
|
/// no mode flags)
|
||||||
fn erase_chars(&mut self, Column) {}
|
fn erase_chars(&mut self, _: Column) {}
|
||||||
|
|
||||||
/// Delete `count` chars
|
/// Delete `count` chars
|
||||||
///
|
///
|
||||||
/// Deleting a character is like the delete key on the keyboard - everything
|
/// Deleting a character is like the delete key on the keyboard - everything
|
||||||
/// to the right of the deleted things is shifted left.
|
/// to the right of the deleted things is shifted left.
|
||||||
fn delete_chars(&mut self, Column) {}
|
fn delete_chars(&mut self, _: Column) {}
|
||||||
|
|
||||||
/// Move backward `count` tabs
|
/// Move backward `count` tabs
|
||||||
fn move_backward_tabs(&mut self, _count: i64) {}
|
fn move_backward_tabs(&mut self, _count: i64) {}
|
||||||
|
@ -313,10 +313,10 @@ pub trait Handler {
|
||||||
fn set_mode(&mut self, _mode: Mode) {}
|
fn set_mode(&mut self, _mode: Mode) {}
|
||||||
|
|
||||||
/// Unset mode
|
/// Unset mode
|
||||||
fn unset_mode(&mut self, Mode) {}
|
fn unset_mode(&mut self, _: Mode) {}
|
||||||
|
|
||||||
/// DECSTBM - Set the terminal scrolling region
|
/// DECSTBM - Set the terminal scrolling region
|
||||||
fn set_scrolling_region(&mut self, Range<Line>) {}
|
fn set_scrolling_region(&mut self, _: Range<Line>) {}
|
||||||
|
|
||||||
/// DECKPAM - Set keypad to applications mode (ESCape instead of digits)
|
/// DECKPAM - Set keypad to applications mode (ESCape instead of digits)
|
||||||
fn set_keypad_application_mode(&mut self) {}
|
fn set_keypad_application_mode(&mut self) {}
|
||||||
|
@ -328,22 +328,22 @@ pub trait Handler {
|
||||||
///
|
///
|
||||||
/// 'Invoke' one of G0 to G3 in the GL area. Also referred to as shift in,
|
/// 'Invoke' one of G0 to G3 in the GL area. Also referred to as shift in,
|
||||||
/// shift out and locking shift depending on the set being activated
|
/// shift out and locking shift depending on the set being activated
|
||||||
fn set_active_charset(&mut self, CharsetIndex) {}
|
fn set_active_charset(&mut self, _: CharsetIndex) {}
|
||||||
|
|
||||||
/// Assign a graphic character set to G0, G1, G2 or G3
|
/// Assign a graphic character set to G0, G1, G2 or G3
|
||||||
///
|
///
|
||||||
/// 'Designate' a graphic character set as one of G0 to G3, so that it can
|
/// 'Designate' a graphic character set as one of G0 to G3, so that it can
|
||||||
/// later be 'invoked' by `set_active_charset`
|
/// later be 'invoked' by `set_active_charset`
|
||||||
fn configure_charset(&mut self, CharsetIndex, StandardCharset) {}
|
fn configure_charset(&mut self, _: CharsetIndex, _: StandardCharset) {}
|
||||||
|
|
||||||
/// Set an indexed color value
|
/// Set an indexed color value
|
||||||
fn set_color(&mut self, usize, Rgb) {}
|
fn set_color(&mut self, _: usize, _: Rgb) {}
|
||||||
|
|
||||||
/// Reset an indexed color to original value
|
/// Reset an indexed color to original value
|
||||||
fn reset_color(&mut self, usize) {}
|
fn reset_color(&mut self, _: usize) {}
|
||||||
|
|
||||||
/// Set the clipboard
|
/// Set the clipboard
|
||||||
fn set_clipboard(&mut self, &str) {}
|
fn set_clipboard(&mut self, _: &str) {}
|
||||||
|
|
||||||
/// Run the dectest routine
|
/// Run the dectest routine
|
||||||
fn dectest(&mut self) {}
|
fn dectest(&mut self) {}
|
||||||
|
@ -1393,9 +1393,9 @@ pub mod C1 {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::io;
|
use std::io;
|
||||||
use index::{Line, Column};
|
use crate::index::{Line, Column};
|
||||||
use super::{Processor, Handler, Attr, TermInfo, Color, StandardCharset, CharsetIndex, parse_rgb_color, parse_number};
|
use super::{Processor, Handler, Attr, TermInfo, Color, StandardCharset, CharsetIndex, parse_rgb_color, parse_number};
|
||||||
use ::Rgb;
|
use crate::Rgb;
|
||||||
|
|
||||||
/// The /dev/null of `io::Write`
|
/// The /dev/null of `io::Write`
|
||||||
struct Void;
|
struct Void;
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
extern crate log;
|
extern crate log;
|
||||||
use clap::{Arg, App};
|
use clap::{Arg, App};
|
||||||
use index::{Line, Column};
|
use crate::index::{Line, Column};
|
||||||
use config::{Dimensions, Shell};
|
use crate::config::{Dimensions, Shell};
|
||||||
use window::{DEFAULT_TITLE, DEFAULT_CLASS};
|
use crate::window::{DEFAULT_TITLE, DEFAULT_CLASS};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ use std::sync::mpsc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use ::Rgb;
|
use crate::Rgb;
|
||||||
use font::Size;
|
use font::Size;
|
||||||
use serde_yaml;
|
use serde_yaml;
|
||||||
use serde::{self, de, Deserialize};
|
use serde::{self, de, Deserialize};
|
||||||
|
@ -23,10 +23,10 @@ use notify::{Watcher, watcher, DebouncedEvent, RecursiveMode};
|
||||||
|
|
||||||
use glutin::ModifiersState;
|
use glutin::ModifiersState;
|
||||||
|
|
||||||
use cli::Options;
|
use crate::cli::Options;
|
||||||
use input::{Action, Binding, MouseBinding, KeyBinding};
|
use crate::input::{Action, Binding, MouseBinding, KeyBinding};
|
||||||
use index::{Line, Column};
|
use crate::index::{Line, Column};
|
||||||
use ansi::{CursorStyle, NamedColor, Color};
|
use crate::ansi::{CursorStyle, NamedColor, Color};
|
||||||
|
|
||||||
const MAX_SCROLLBACK_LINES: u32 = 100_000;
|
const MAX_SCROLLBACK_LINES: u32 = 100_000;
|
||||||
|
|
||||||
|
@ -735,10 +735,10 @@ impl<'a> de::Deserialize<'a> for ModsWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ActionWrapper(::input::Action);
|
struct ActionWrapper(crate::input::Action);
|
||||||
|
|
||||||
impl ActionWrapper {
|
impl ActionWrapper {
|
||||||
fn into_inner(self) -> ::input::Action {
|
fn into_inner(self) -> crate::input::Action {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -811,7 +811,7 @@ impl CommandWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use ::term::{mode, TermMode};
|
use crate::term::{mode, TermMode};
|
||||||
|
|
||||||
struct ModeWrapper {
|
struct ModeWrapper {
|
||||||
pub mode: TermMode,
|
pub mode: TermMode,
|
||||||
|
@ -1008,7 +1008,7 @@ impl<'a> de::Deserialize<'a> for RawBinding {
|
||||||
let mut mods: Option<ModifiersState> = None;
|
let mut mods: Option<ModifiersState> = None;
|
||||||
let mut key: Option<Key> = None;
|
let mut key: Option<Key> = None;
|
||||||
let mut chars: Option<String> = None;
|
let mut chars: Option<String> = None;
|
||||||
let mut action: Option<::input::Action> = None;
|
let mut action: Option<crate::input::Action> = None;
|
||||||
let mut mode: Option<TermMode> = None;
|
let mut mode: Option<TermMode> = None;
|
||||||
let mut not_mode: Option<TermMode> = None;
|
let mut not_mode: Option<TermMode> = None;
|
||||||
let mut mouse: Option<::glutin::MouseButton> = None;
|
let mut mouse: Option<::glutin::MouseButton> = None;
|
||||||
|
@ -1812,7 +1812,7 @@ pub struct Delta<T: Default> {
|
||||||
}
|
}
|
||||||
|
|
||||||
trait DeserializeSize : Sized {
|
trait DeserializeSize : Sized {
|
||||||
fn deserialize<'a, D>(D) -> ::std::result::Result<Self, D::Error>
|
fn deserialize<'a, D>(_: D) -> ::std::result::Result<Self, D::Error>
|
||||||
where D: serde::de::Deserializer<'a>;
|
where D: serde::de::Deserializer<'a>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2020,7 +2020,7 @@ pub trait OnConfigReload {
|
||||||
fn on_config_reload(&mut self);
|
fn on_config_reload(&mut self);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OnConfigReload for ::display::Notifier {
|
impl OnConfigReload for crate::display::Notifier {
|
||||||
fn on_config_reload(&mut self) {
|
fn on_config_reload(&mut self) {
|
||||||
self.notify();
|
self.notify();
|
||||||
}
|
}
|
||||||
|
@ -2045,7 +2045,7 @@ impl Monitor {
|
||||||
let (config_tx, config_rx) = mpsc::channel();
|
let (config_tx, config_rx) = mpsc::channel();
|
||||||
|
|
||||||
Monitor {
|
Monitor {
|
||||||
_thread: ::util::thread::spawn_named("config watcher", move || {
|
_thread: crate::util::thread::spawn_named("config watcher", move || {
|
||||||
let (tx, rx) = mpsc::channel();
|
let (tx, rx) = mpsc::channel();
|
||||||
// The Duration argument is a debouncing period.
|
// The Duration argument is a debouncing period.
|
||||||
let mut watcher = watcher(tx, Duration::from_millis(10))
|
let mut watcher = watcher(tx, Duration::from_millis(10))
|
||||||
|
@ -2088,7 +2088,7 @@ impl Monitor {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use cli::Options;
|
use crate::cli::Options;
|
||||||
use super::Config;
|
use super::Config;
|
||||||
|
|
||||||
#[cfg(target_os="macos")]
|
#[cfg(target_os="macos")]
|
||||||
|
|
|
@ -20,16 +20,16 @@ use std::f64;
|
||||||
use parking_lot::MutexGuard;
|
use parking_lot::MutexGuard;
|
||||||
use glutin::dpi::{LogicalPosition, PhysicalSize};
|
use glutin::dpi::{LogicalPosition, PhysicalSize};
|
||||||
|
|
||||||
use cli;
|
use crate::cli;
|
||||||
use config::Config;
|
use crate::config::Config;
|
||||||
use font::{self, Rasterize};
|
use font::{self, Rasterize};
|
||||||
use meter::Meter;
|
use crate::meter::Meter;
|
||||||
use renderer::{self, GlyphCache, QuadRenderer};
|
use crate::renderer::{self, GlyphCache, QuadRenderer};
|
||||||
use term::{Term, SizeInfo, RenderableCell};
|
use crate::term::{Term, SizeInfo, RenderableCell};
|
||||||
use sync::FairMutex;
|
use crate::sync::FairMutex;
|
||||||
use window::{self, Window};
|
use crate::window::{self, Window};
|
||||||
use logging::LoggerProxy;
|
use crate::logging::LoggerProxy;
|
||||||
use Rgb;
|
use crate::Rgb;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
@ -476,8 +476,8 @@ impl Display {
|
||||||
|
|
||||||
/// Adjust the IME editor position according to the new location of the cursor
|
/// Adjust the IME editor position according to the new location of the cursor
|
||||||
pub fn update_ime_position(&mut self, terminal: &Term) {
|
pub fn update_ime_position(&mut self, terminal: &Term) {
|
||||||
use index::{Column, Line, Point};
|
use crate::index::{Column, Line, Point};
|
||||||
use term::SizeInfo;
|
use crate::term::SizeInfo;
|
||||||
let Point{line: Line(row), col: Column(col)} = terminal.cursor().point;
|
let Point{line: Line(row), col: Column(col)} = terminal.cursor().point;
|
||||||
let SizeInfo{cell_width: cw,
|
let SizeInfo{cell_width: cw,
|
||||||
cell_height: ch,
|
cell_height: ch,
|
||||||
|
|
30
src/event.rs
30
src/event.rs
|
@ -10,19 +10,19 @@ use parking_lot::MutexGuard;
|
||||||
use glutin::{self, ModifiersState, Event, ElementState};
|
use glutin::{self, ModifiersState, Event, ElementState};
|
||||||
use copypasta::{Clipboard, Load, Store, Buffer as ClipboardBuffer};
|
use copypasta::{Clipboard, Load, Store, Buffer as ClipboardBuffer};
|
||||||
|
|
||||||
use ansi::{Handler, ClearMode};
|
use crate::ansi::{Handler, ClearMode};
|
||||||
use grid::Scroll;
|
use crate::grid::Scroll;
|
||||||
use config::{self, Config};
|
use crate::config::{self, Config};
|
||||||
use cli::Options;
|
use crate::cli::Options;
|
||||||
use display::OnResize;
|
use crate::display::OnResize;
|
||||||
use index::{Line, Column, Side, Point};
|
use crate::index::{Line, Column, Side, Point};
|
||||||
use input::{self, MouseBinding, KeyBinding};
|
use crate::input::{self, MouseBinding, KeyBinding};
|
||||||
use selection::Selection;
|
use crate::selection::Selection;
|
||||||
use sync::FairMutex;
|
use crate::sync::FairMutex;
|
||||||
use term::{Term, SizeInfo, TermMode, Search};
|
use crate::term::{Term, SizeInfo, TermMode, Search};
|
||||||
use util::limit;
|
use crate::util::limit;
|
||||||
use util::fmt::Red;
|
use crate::util::fmt::Red;
|
||||||
use window::Window;
|
use crate::window::Window;
|
||||||
use glutin::dpi::PhysicalSize;
|
use glutin::dpi::PhysicalSize;
|
||||||
|
|
||||||
/// Byte sequences are sent to a `Notify` in response to some events
|
/// Byte sequences are sent to a `Notify` in response to some events
|
||||||
|
@ -30,7 +30,7 @@ pub trait Notify {
|
||||||
/// Notify that an escape sequence should be written to the pty
|
/// Notify that an escape sequence should be written to the pty
|
||||||
///
|
///
|
||||||
/// TODO this needs to be able to error somehow
|
/// TODO this needs to be able to error somehow
|
||||||
fn notify<B: Into<Cow<'static, [u8]>>>(&mut self, B);
|
fn notify<B: Into<Cow<'static, [u8]>>>(&mut self, _: B);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ActionContext<'a, N: 'a> {
|
pub struct ActionContext<'a, N: 'a> {
|
||||||
|
@ -421,7 +421,7 @@ impl<N: Notify> Processor<N> {
|
||||||
processor.on_focus_change(is_focused);
|
processor.on_focus_change(is_focused);
|
||||||
},
|
},
|
||||||
DroppedFile(path) => {
|
DroppedFile(path) => {
|
||||||
use input::ActionContext;
|
use crate::input::ActionContext;
|
||||||
let path: String = path.to_string_lossy().into();
|
let path: String = path.to_string_lossy().into();
|
||||||
processor.ctx.write_to_pty(path.into_bytes());
|
processor.ctx.write_to_pty(path.into_bytes());
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,13 +12,13 @@ use mio_more::channel::{self, Receiver, Sender};
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
use mio::unix::UnixReady;
|
use mio::unix::UnixReady;
|
||||||
|
|
||||||
use ansi;
|
use crate::ansi;
|
||||||
use display;
|
use crate::display;
|
||||||
use event;
|
use crate::event;
|
||||||
use tty;
|
use crate::tty;
|
||||||
use term::Term;
|
use crate::term::Term;
|
||||||
use util::thread;
|
use crate::util::thread;
|
||||||
use sync::FairMutex;
|
use crate::sync::FairMutex;
|
||||||
|
|
||||||
/// Messages that may be sent to the `EventLoop`
|
/// Messages that may be sent to the `EventLoop`
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -393,7 +393,7 @@ impl<T> EventLoop<T>
|
||||||
break 'event_loop;
|
break 'event_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ::tty::process_should_exit() {
|
if crate::tty::process_should_exit() {
|
||||||
break 'event_loop;
|
break 'event_loop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
use std::cmp::{min, max, Ordering};
|
use std::cmp::{min, max, Ordering};
|
||||||
use std::ops::{Deref, Range, Index, IndexMut, RangeTo, RangeFrom, RangeFull};
|
use std::ops::{Deref, Range, Index, IndexMut, RangeTo, RangeFrom, RangeFull};
|
||||||
|
|
||||||
use index::{self, Point, Line, Column, IndexRange};
|
use crate::index::{self, Point, Line, Column, IndexRange};
|
||||||
use selection::Selection;
|
use crate::selection::Selection;
|
||||||
|
|
||||||
mod row;
|
mod row;
|
||||||
pub use self::row::Row;
|
pub use self::row::Row;
|
||||||
|
|
|
@ -19,7 +19,7 @@ use std::ops::{Range, RangeTo, RangeFrom, RangeFull, RangeToInclusive};
|
||||||
use std::cmp::{max, min};
|
use std::cmp::{max, min};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|
||||||
use index::Column;
|
use crate::index::Column;
|
||||||
|
|
||||||
/// A row in the grid
|
/// A row in the grid
|
||||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
use std::ops::{Index, IndexMut};
|
use std::ops::{Index, IndexMut};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|
||||||
use index::Line;
|
use crate::index::Line;
|
||||||
use super::Row;
|
use super::Row;
|
||||||
|
|
||||||
/// Maximum number of invisible lines before buffer is resized
|
/// Maximum number of invisible lines before buffer is resized
|
||||||
|
@ -308,7 +308,7 @@ impl<T> IndexMut<Line> for Storage<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use index::Column;
|
use crate::index::Column;
|
||||||
|
|
||||||
/// Grow the buffer one line at the end of the buffer
|
/// Grow the buffer one line at the end of the buffer
|
||||||
///
|
///
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
//! Tests for the Gird
|
//! Tests for the Gird
|
||||||
|
|
||||||
use super::{Grid, BidirectionalIterator};
|
use super::{Grid, BidirectionalIterator};
|
||||||
use index::{Point, Line, Column};
|
use crate::index::{Point, Line, Column};
|
||||||
|
|
||||||
// Scroll up moves lines upwards
|
// Scroll up moves lines upwards
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -255,7 +255,7 @@ macro_rules! inclusive {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn next(&mut self) -> Option<$ty> {
|
fn next(&mut self) -> Option<$ty> {
|
||||||
use index::RangeInclusive::*;
|
use crate::index::RangeInclusive::*;
|
||||||
|
|
||||||
// this function has a sort of odd structure due to borrowck issues
|
// this function has a sort of odd structure due to borrowck issues
|
||||||
// we may need to replace self.range, so borrows of start and end need to end early
|
// we may need to replace self.range, so borrows of start and end need to end early
|
||||||
|
@ -283,7 +283,7 @@ macro_rules! inclusive {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||||
use index::RangeInclusive::*;
|
use crate::index::RangeInclusive::*;
|
||||||
|
|
||||||
match *self {
|
match *self {
|
||||||
Empty { .. } => (0, Some(0)),
|
Empty { .. } => (0, Some(0)),
|
||||||
|
|
32
src/input.rs
32
src/input.rs
|
@ -25,14 +25,14 @@ use std::time::Instant;
|
||||||
use copypasta::{Clipboard, Load, Buffer as ClipboardBuffer};
|
use copypasta::{Clipboard, Load, Buffer as ClipboardBuffer};
|
||||||
use glutin::{ElementState, MouseButton, TouchPhase, MouseScrollDelta, ModifiersState, KeyboardInput};
|
use glutin::{ElementState, MouseButton, TouchPhase, MouseScrollDelta, ModifiersState, KeyboardInput};
|
||||||
|
|
||||||
use config::{self, Key};
|
use crate::config::{self, Key};
|
||||||
use grid::Scroll;
|
use crate::grid::Scroll;
|
||||||
use event::{ClickState, Mouse};
|
use crate::event::{ClickState, Mouse};
|
||||||
use index::{Line, Column, Side, Point};
|
use crate::index::{Line, Column, Side, Point};
|
||||||
use term::SizeInfo;
|
use crate::term::SizeInfo;
|
||||||
use term::mode::TermMode;
|
use crate::term::mode::TermMode;
|
||||||
use util::fmt::Red;
|
use crate::util::fmt::Red;
|
||||||
use util::start_daemon;
|
use crate::util::start_daemon;
|
||||||
|
|
||||||
pub const FONT_SIZE_STEP: f32 = 0.5;
|
pub const FONT_SIZE_STEP: f32 = 0.5;
|
||||||
|
|
||||||
|
@ -52,10 +52,10 @@ pub struct Processor<'a, A: 'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ActionContext {
|
pub trait ActionContext {
|
||||||
fn write_to_pty<B: Into<Cow<'static, [u8]>>>(&mut self, B);
|
fn write_to_pty<B: Into<Cow<'static, [u8]>>>(&mut self, _: B);
|
||||||
fn terminal_mode(&self) -> TermMode;
|
fn terminal_mode(&self) -> TermMode;
|
||||||
fn size_info(&self) -> SizeInfo;
|
fn size_info(&self) -> SizeInfo;
|
||||||
fn copy_selection(&self, ClipboardBuffer);
|
fn copy_selection(&self, _: ClipboardBuffer);
|
||||||
fn clear_selection(&mut self);
|
fn clear_selection(&mut self);
|
||||||
fn update_selection(&mut self, point: Point, side: Side);
|
fn update_selection(&mut self, point: Point, side: Side);
|
||||||
fn simple_selection(&mut self, point: Point, side: Side);
|
fn simple_selection(&mut self, point: Point, side: Side);
|
||||||
|
@ -769,12 +769,12 @@ mod tests {
|
||||||
|
|
||||||
use glutin::{VirtualKeyCode, Event, WindowEvent, ElementState, MouseButton, ModifiersState};
|
use glutin::{VirtualKeyCode, Event, WindowEvent, ElementState, MouseButton, ModifiersState};
|
||||||
|
|
||||||
use term::{SizeInfo, Term, TermMode};
|
use crate::term::{SizeInfo, Term, TermMode};
|
||||||
use event::{Mouse, ClickState, WindowChanges};
|
use crate::event::{Mouse, ClickState, WindowChanges};
|
||||||
use config::{self, Config, ClickHandler};
|
use crate::config::{self, Config, ClickHandler};
|
||||||
use index::{Point, Side};
|
use crate::index::{Point, Side};
|
||||||
use selection::Selection;
|
use crate::selection::Selection;
|
||||||
use grid::Scroll;
|
use crate::grid::Scroll;
|
||||||
|
|
||||||
use super::{Action, Binding, Processor};
|
use super::{Action, Binding, Processor};
|
||||||
use copypasta::Buffer as ClipboardBuffer;
|
use copypasta::Buffer as ClipboardBuffer;
|
||||||
|
|
|
@ -91,8 +91,8 @@ pub mod window;
|
||||||
|
|
||||||
use std::ops::Mul;
|
use std::ops::Mul;
|
||||||
|
|
||||||
pub use grid::Grid;
|
pub use crate::grid::Grid;
|
||||||
pub use term::Term;
|
pub use crate::term::Term;
|
||||||
|
|
||||||
/// Facade around [winit's `MouseCursor`](glutin::MouseCursor)
|
/// Facade around [winit's `MouseCursor`](glutin::MouseCursor)
|
||||||
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
|
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
//! The main executable is supposed to call `initialize()` exactly once during
|
//! The main executable is supposed to call `initialize()` exactly once during
|
||||||
//! startup. All logging messages are written to stdout, given that their
|
//! startup. All logging messages are written to stdout, given that their
|
||||||
//! log-level is sufficient for the level configured in `cli::Options`.
|
//! log-level is sufficient for the level configured in `cli::Options`.
|
||||||
use cli;
|
use crate::cli;
|
||||||
use log::{self, Level};
|
use log::{self, Level};
|
||||||
use time;
|
use time;
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,14 @@ use std::time::Duration;
|
||||||
use cgmath;
|
use cgmath;
|
||||||
use fnv::FnvHasher;
|
use fnv::FnvHasher;
|
||||||
use font::{self, FontDesc, FontKey, GlyphKey, Rasterize, RasterizedGlyph, Rasterizer};
|
use font::{self, FontDesc, FontKey, GlyphKey, Rasterize, RasterizedGlyph, Rasterizer};
|
||||||
use gl::types::*;
|
use crate::gl::types::*;
|
||||||
use gl;
|
use crate::gl;
|
||||||
use index::{Column, Line, RangeInclusive};
|
use crate::index::{Column, Line, RangeInclusive};
|
||||||
use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
|
use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
|
||||||
use Rgb;
|
use crate::Rgb;
|
||||||
|
|
||||||
use config::{self, Config, Delta};
|
use crate::config::{self, Config, Delta};
|
||||||
use term::{self, cell, RenderableCell};
|
use crate::term::{self, cell, RenderableCell};
|
||||||
use glutin::dpi::PhysicalSize;
|
use glutin::dpi::PhysicalSize;
|
||||||
|
|
||||||
// Shader paths for live reload
|
// Shader paths for live reload
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
use std::cmp::{min, max};
|
use std::cmp::{min, max};
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
|
|
||||||
use index::{Point, Column, Side};
|
use crate::index::{Point, Column, Side};
|
||||||
use term::Search;
|
use crate::term::Search;
|
||||||
|
|
||||||
/// Describes a region of a 2-dimensional area
|
/// Describes a region of a 2-dimensional area
|
||||||
///
|
///
|
||||||
|
@ -431,7 +431,7 @@ impl Span {
|
||||||
/// look like [ B] and [E ].
|
/// look like [ B] and [E ].
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use index::{Line, Column, Side, Point};
|
use crate::index::{Line, Column, Side, Point};
|
||||||
use super::{Selection, Span, SpanType};
|
use super::{Selection, Span, SpanType};
|
||||||
|
|
||||||
struct Dimensions(Point);
|
struct Dimensions(Point);
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
use ansi::{NamedColor, Color};
|
use crate::ansi::{NamedColor, Color};
|
||||||
use grid;
|
use crate::grid;
|
||||||
use index::Column;
|
use crate::index::Column;
|
||||||
|
|
||||||
// Maximum number of zerowidth characters which will be stored per cell.
|
// Maximum number of zerowidth characters which will be stored per cell.
|
||||||
pub const MAX_ZEROWIDTH_CHARS: usize = 5;
|
pub const MAX_ZEROWIDTH_CHARS: usize = 5;
|
||||||
|
@ -153,8 +153,8 @@ impl Cell {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{Cell, LineLength};
|
use super::{Cell, LineLength};
|
||||||
|
|
||||||
use grid::Row;
|
use crate::grid::Row;
|
||||||
use index::Column;
|
use crate::index::Column;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn line_length_works() {
|
fn line_length_works() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use std::ops::{Index, IndexMut};
|
use std::ops::{Index, IndexMut};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use {Rgb, ansi};
|
use crate::{Rgb, ansi};
|
||||||
use config::Colors;
|
use crate::config::Colors;
|
||||||
|
|
||||||
pub const COUNT: usize = 270;
|
pub const COUNT: usize = 270;
|
||||||
|
|
||||||
|
|
|
@ -23,15 +23,15 @@ use unicode_width::UnicodeWidthChar;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use font::{self, Size};
|
use font::{self, Size};
|
||||||
use ansi::{self, Color, NamedColor, Attr, Handler, CharsetIndex, StandardCharset, CursorStyle};
|
use crate::ansi::{self, Color, NamedColor, Attr, Handler, CharsetIndex, StandardCharset, CursorStyle};
|
||||||
use grid::{BidirectionalIterator, Grid, Indexed, IndexRegion, DisplayIter, Scroll, ViewportPosition};
|
use crate::grid::{BidirectionalIterator, Grid, Indexed, IndexRegion, DisplayIter, Scroll, ViewportPosition};
|
||||||
use index::{self, Point, Column, Line, IndexRange, Contains, RangeInclusive, Linear};
|
use crate::index::{self, Point, Column, Line, IndexRange, Contains, RangeInclusive, Linear};
|
||||||
use selection::{self, Selection, Locations};
|
use crate::selection::{self, Selection, Locations};
|
||||||
use config::{Config, VisualBellAnimation};
|
use crate::config::{Config, VisualBellAnimation};
|
||||||
use {MouseCursor, Rgb};
|
use crate::{MouseCursor, Rgb};
|
||||||
use copypasta::{Clipboard, Load, Store};
|
use copypasta::{Clipboard, Load, Store};
|
||||||
use input::FONT_SIZE_STEP;
|
use crate::input::FONT_SIZE_STEP;
|
||||||
use logging::LoggerProxy;
|
use crate::logging::LoggerProxy;
|
||||||
|
|
||||||
pub mod cell;
|
pub mod cell;
|
||||||
pub mod color;
|
pub mod color;
|
||||||
|
@ -2083,16 +2083,16 @@ mod tests {
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
|
||||||
use super::{Cell, Term, SizeInfo};
|
use super::{Cell, Term, SizeInfo};
|
||||||
use term::{cell, Search};
|
use crate::term::{cell, Search};
|
||||||
|
|
||||||
use grid::{Grid, Scroll};
|
use crate::grid::{Grid, Scroll};
|
||||||
use index::{Point, Line, Column, Side};
|
use crate::index::{Point, Line, Column, Side};
|
||||||
use ansi::{self, Handler, CharsetIndex, StandardCharset};
|
use crate::ansi::{self, Handler, CharsetIndex, StandardCharset};
|
||||||
use selection::Selection;
|
use crate::selection::Selection;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use input::FONT_SIZE_STEP;
|
use crate::input::FONT_SIZE_STEP;
|
||||||
use font::Size;
|
use font::Size;
|
||||||
use config::Config;
|
use crate::config::Config;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn semantic_selection_works() {
|
fn semantic_selection_works() {
|
||||||
|
|
|
@ -18,7 +18,7 @@ use std::{env, io};
|
||||||
|
|
||||||
use terminfo::Database;
|
use terminfo::Database;
|
||||||
|
|
||||||
use config::Config;
|
use crate::config::Config;
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
mod unix;
|
mod unix;
|
||||||
|
@ -39,13 +39,13 @@ pub trait EventedReadWrite {
|
||||||
|
|
||||||
fn register(
|
fn register(
|
||||||
&mut self,
|
&mut self,
|
||||||
&mio::Poll,
|
_: &mio::Poll,
|
||||||
&mut Iterator<Item = &usize>,
|
_: &mut Iterator<Item = &usize>,
|
||||||
mio::Ready,
|
_: mio::Ready,
|
||||||
mio::PollOpt,
|
_: mio::PollOpt,
|
||||||
) -> io::Result<()>;
|
) -> io::Result<()>;
|
||||||
fn reregister(&mut self, &mio::Poll, mio::Ready, mio::PollOpt) -> io::Result<()>;
|
fn reregister(&mut self, _: &mio::Poll, _: mio::Ready, _: mio::PollOpt) -> io::Result<()>;
|
||||||
fn deregister(&mut self, &mio::Poll) -> io::Result<()>;
|
fn deregister(&mut self, _: &mio::Poll) -> io::Result<()>;
|
||||||
|
|
||||||
fn reader(&mut self) -> &mut Self::Reader;
|
fn reader(&mut self) -> &mut Self::Reader;
|
||||||
fn read_token(&self) -> mio::Token;
|
fn read_token(&self) -> mio::Token;
|
||||||
|
|
|
@ -15,11 +15,11 @@
|
||||||
//! tty related functionality
|
//! tty related functionality
|
||||||
//!
|
//!
|
||||||
|
|
||||||
use tty::EventedReadWrite;
|
use crate::tty::EventedReadWrite;
|
||||||
use term::SizeInfo;
|
use crate::term::SizeInfo;
|
||||||
use display::OnResize;
|
use crate::display::OnResize;
|
||||||
use config::{Config, Shell};
|
use crate::config::{Config, Shell};
|
||||||
use cli::Options;
|
use crate::cli::Options;
|
||||||
use mio;
|
use mio;
|
||||||
|
|
||||||
use libc::{self, c_int, pid_t, winsize, SIGCHLD, TIOCSCTTY, WNOHANG};
|
use libc::{self, c_int, pid_t, winsize, SIGCHLD, TIOCSCTTY, WNOHANG};
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
use gl;
|
use crate::gl;
|
||||||
use glutin::GlContext;
|
use glutin::GlContext;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use glutin::Icon;
|
use glutin::Icon;
|
||||||
|
@ -26,9 +26,9 @@ use glutin::{
|
||||||
};
|
};
|
||||||
use glutin::dpi::{LogicalPosition, LogicalSize, PhysicalSize};
|
use glutin::dpi::{LogicalPosition, LogicalSize, PhysicalSize};
|
||||||
|
|
||||||
use cli::Options;
|
use crate::cli::Options;
|
||||||
use config::{Decorations, WindowConfig};
|
use crate::config::{Decorations, WindowConfig};
|
||||||
use MouseCursor;
|
use crate::MouseCursor;
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
static WINDOW_ICON: &'static [u8] = include_bytes!("../assets/windows/alacritty.ico");
|
static WINDOW_ICON: &'static [u8] = include_bytes!("../assets/windows/alacritty.ico");
|
||||||
|
|
Loading…
Reference in a new issue