Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "vt100"
version = "0.15.2"
authors = ["Jesse Luehrs <doy@tozt.net>"]
authors = ["Chris Titus <contact@christitus.com>", "Jesse Luehrs <doy@tozt.net>"]
edition = "2021"

description = "Library for parsing terminal data"
homepage = "https://github.com/doy/vt100-rust"
repository = "https://github.com/doy/vt100-rust"
description = "Library for parsing terminal data - up-to-date version"
homepage = "https://github.com/ChrisTitusTech/vt100-rust"
repository = "https://github.com/ChrisTitusTech/vt100-rust"
readme = "README.md"
keywords = ["terminal", "vt100"]
categories = ["command-line-interface", "encoding"]
Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) 2024 Chris Titus
Copyright (c) 2016 Jesse Luehrs

Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
13 changes: 12 additions & 1 deletion src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,18 @@ impl Grid {
self.scrollback
.iter()
.skip(scrollback_len - self.scrollback_offset)
.chain(self.rows.iter().take(rows_len - self.scrollback_offset))
// when scrollback_offset > rows_len (e.g. rows = 3,
// scrollback_len = 10, offset = 9) the skip(10 - 9)
// will take 9 rows instead of 3. we need to set
// the upper bound to rows_len (e.g. 3)
.take(rows_len)
// same for rows_len - scrollback_offset (e.g. 3 - 9).
// it'll panic with overflow. we have to saturate the subtraction.
.chain(
self.rows
.iter()
.take(rows_len.saturating_sub(self.scrollback_offset)),
)
}

pub fn drawing_rows(&self) -> impl Iterator<Item = &crate::row::Row> {
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
//! );
//! ```

#![warn(clippy::cargo)]
#![warn(clippy::pedantic)]
#![warn(clippy::nursery)]
#![warn(clippy::as_conversions)]
#![warn(clippy::get_unwrap)]
#![allow(clippy::cognitive_complexity)]
Expand Down
2 changes: 1 addition & 1 deletion src/perform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl vte::Perform for WrappedScreen {
}

fn osc_dispatch(&mut self, params: &[&[u8]], _bel_terminated: bool) {
match (params.get(0), params.get(1)) {
match (params.first(), params.get(1)) {
(Some(&b"0"), Some(s)) => self.0.osc0(s),
(Some(&b"1"), Some(s)) => self.0.osc1(s),
(Some(&b"2"), Some(s)) => self.0.osc2(s),
Expand Down
2 changes: 1 addition & 1 deletion src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ impl Screen {
}

fn u16_to_u8(i: u16) -> Option<u8> {
if i > u16::from(u8::max_value()) {
if i > u16::from(u8::MAX) {
None
} else {
// safe because we just ensured that the value fits in a u8
Expand Down