mirror of
https://github.com/wez/wezterm.git
synced 2024-11-22 22:42:48 +03:00
update term to 2018 edition
This commit is contained in:
parent
571562351d
commit
9f6b21f0db
@ -2,6 +2,7 @@
|
||||
authors = ["Wez Furlong <wez@wezfurlong.org>"]
|
||||
name = "term"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "~1.0"
|
||||
|
@ -3,11 +3,6 @@
|
||||
extern crate bitflags;
|
||||
#[macro_use]
|
||||
extern crate failure;
|
||||
extern crate image;
|
||||
extern crate ordered_float;
|
||||
extern crate termwiz;
|
||||
extern crate unicode_segmentation;
|
||||
extern crate unicode_width;
|
||||
|
||||
use failure::Error;
|
||||
use std::ops::{Deref, DerefMut, Range};
|
||||
@ -18,25 +13,25 @@ use std::str;
|
||||
mod debug;
|
||||
|
||||
pub mod input;
|
||||
pub use input::*;
|
||||
pub use crate::input::*;
|
||||
|
||||
pub use termwiz::cell::{self, *};
|
||||
|
||||
pub use termwiz::surface::line::*;
|
||||
|
||||
pub mod screen;
|
||||
pub use screen::*;
|
||||
pub use crate::screen::*;
|
||||
|
||||
pub mod selection;
|
||||
use selection::{SelectionCoordinate, SelectionRange};
|
||||
use crate::selection::{SelectionCoordinate, SelectionRange};
|
||||
|
||||
use termwiz::hyperlink::Hyperlink;
|
||||
|
||||
pub mod terminal;
|
||||
pub use terminal::*;
|
||||
pub use crate::terminal::*;
|
||||
|
||||
pub mod terminalstate;
|
||||
pub use terminalstate::*;
|
||||
pub use crate::terminalstate::*;
|
||||
|
||||
/// Represents the index into screen.lines. Index 0 is the top of
|
||||
/// the scrollback (if any). The index of the top of the visible screen
|
||||
|
@ -357,7 +357,7 @@ impl TerminalState {
|
||||
/// Invalidate rows that have hyperlinks
|
||||
fn invalidate_hyperlinks(&mut self) {
|
||||
let screen = self.screen_mut();
|
||||
for mut line in &mut screen.lines {
|
||||
for line in &mut screen.lines {
|
||||
if line.has_hyperlink() {
|
||||
line.set_dirty();
|
||||
}
|
||||
@ -675,7 +675,7 @@ impl TerminalState {
|
||||
const ALT: KeyModifiers = KeyModifiers::ALT;
|
||||
const NO: KeyModifiers = KeyModifiers::NONE;
|
||||
const APPCURSOR: bool = true;
|
||||
use KeyCode::*;
|
||||
use crate::KeyCode::*;
|
||||
|
||||
let ctrl = mods & CTRL;
|
||||
let shift = mods & SHIFT;
|
||||
@ -934,7 +934,7 @@ impl TerminalState {
|
||||
|
||||
let selection = self.selection_range.map(|r| r.normalize());
|
||||
|
||||
for (i, mut line) in screen.lines.iter().skip(len - height).enumerate() {
|
||||
for (i, line) in screen.lines.iter().skip(len - height).enumerate() {
|
||||
if i >= height {
|
||||
// When scrolling back, make sure we don't emit lines that
|
||||
// are below the bottom of the viewport
|
||||
@ -965,7 +965,7 @@ impl TerminalState {
|
||||
/// Clear the dirty flag for all dirty lines
|
||||
pub fn clean_dirty_lines(&mut self) {
|
||||
let screen = self.screen_mut();
|
||||
for mut line in &mut screen.lines {
|
||||
for line in &mut screen.lines {
|
||||
line.clear_dirty();
|
||||
}
|
||||
}
|
||||
@ -973,7 +973,7 @@ impl TerminalState {
|
||||
/// When dealing with selection, mark a range of lines as dirty
|
||||
pub fn make_all_lines_dirty(&mut self) {
|
||||
let screen = self.screen_mut();
|
||||
for mut line in &mut screen.lines {
|
||||
for line in &mut screen.lines {
|
||||
line.set_dirty();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user