style: apply nightly rustfmt import grouping across the workspace
rustfmt.toml sets group_imports, imports_granularity and imports_layout, which are nightly-only; agents formatted with stable rustfmt, which ignored them. This is a formatting-only pass with `cargo +nightly fmt`. Test Plan: - cargo clippy --workspace --all-targets -- -D warnings - cargo test --workspace
This commit is contained in:
1 parent
3fd4ea6ae9
commit
126da77a37
259 files changed
+2495
-1547
No files matched your search
@@ -13,9 +13,9 @@
|
||||
|
||||
use ghostty_vt::kitty::graphics_command::{Command, Control, Display, Quiet, Response};
|
||||
|
||||
use super::graphics_image::{Error as ImageError, LoadingImage};
|
||||
use super::graphics_storage::{
|
||||
Error as StorageError, ImageStorage, Location, Placement, TerminalInfo,
|
||||
use super::{
|
||||
graphics_image::{Error as ImageError, LoadingImage},
|
||||
graphics_storage::{Error as StorageError, ImageStorage, Location, Placement, TerminalInfo},
|
||||
};
|
||||
use crate::page_list::{PageList, Pin};
|
||||
|
||||
@@ -466,9 +466,10 @@ fn encode_error(r: &mut Response, err: ImageError) {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ghostty_vt::kitty::graphics_command::{Parser, TransmissionFormat};
|
||||
|
||||
use super::*;
|
||||
use crate::terminal::{Options, Terminal};
|
||||
use ghostty_vt::kitty::graphics_command::{Parser, TransmissionFormat};
|
||||
|
||||
fn run(h: &mut Terminal, s: &str) -> Option<Response> {
|
||||
let cmd = Parser::parse_string(s.as_bytes()).unwrap();
|
||||
|
||||
@@ -3,14 +3,20 @@
|
||||
//! [`LoadingImage`] is an image that is still being transmitted (possibly in
|
||||
//! chunks). [`Image`] is a fully loaded and validated image.
|
||||
|
||||
use std::io::{Cursor, Read, Seek, SeekFrom};
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
use std::os::unix::fs::FileExt;
|
||||
use std::path::Path;
|
||||
use std::time::Instant;
|
||||
use std::{
|
||||
io::{Cursor, Read, Seek, SeekFrom},
|
||||
os::unix::{ffi::OsStrExt, fs::FileExt},
|
||||
path::Path,
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use ghostty_vt::kitty::graphics_command::{
|
||||
Command, Display, Quiet, TransmissionCompression, TransmissionFormat, TransmissionMedium,
|
||||
Command,
|
||||
Display,
|
||||
Quiet,
|
||||
TransmissionCompression,
|
||||
TransmissionFormat,
|
||||
TransmissionMedium,
|
||||
};
|
||||
|
||||
use crate::page_list::Pin;
|
||||
@@ -138,8 +144,7 @@ impl LoadingImage {
|
||||
|
||||
/// Reads the data from a shared memory segment.
|
||||
fn read_shared_memory(&mut self, offset: u32, size: u32, path: &[u8]) -> Result<(), Error> {
|
||||
use rustix::fs::Mode;
|
||||
use rustix::shm;
|
||||
use rustix::{fs::Mode, shm};
|
||||
|
||||
let path_str = String::from_utf8_lossy(path);
|
||||
let fd = match shm::open(path, shm::OFlags::RDONLY, Mode::empty()) {
|
||||
@@ -565,9 +570,10 @@ pub struct Rect {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ghostty_vt::kitty::graphics_command::{Control, Transmission};
|
||||
|
||||
use super::*;
|
||||
|
||||
const RGB_NONE_20X15: &[u8] =
|
||||
include_bytes!("testdata/image-rgb-none-20x15-2147483647-raw.data");
|
||||
const RGB_ZLIB_128X96: &[u8] =
|
||||
@@ -894,10 +900,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn image_load_shared_memory() {
|
||||
use rustix::fs::Mode;
|
||||
use rustix::shm;
|
||||
use std::io::Write;
|
||||
|
||||
use rustix::{fs::Mode, shm};
|
||||
|
||||
let name = format!("/ghostty-kitty-test-{}", std::process::id());
|
||||
let fd = shm::open(
|
||||
name.as_str(),
|
||||
|
||||
@@ -21,9 +21,11 @@ use std::collections::{BTreeMap, HashMap};
|
||||
use ghostty_vt::kitty::graphics_command::Delete;
|
||||
|
||||
use super::graphics_image::{Image, LoadingImage, Rect};
|
||||
use crate::page_list::{Overflow, PageList, TrackedPin};
|
||||
use crate::point::{Coordinate, Point};
|
||||
use crate::size::CellCountInt;
|
||||
use crate::{
|
||||
page_list::{Overflow, PageList, TrackedPin},
|
||||
point::{Coordinate, Point},
|
||||
size::CellCountInt,
|
||||
};
|
||||
|
||||
/// The subset of terminal state that the storage needs to read.
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
||||
|
||||
@@ -2,14 +2,18 @@
|
||||
//! Kitty graphics protocol unicode placeholder, virtual placement feature
|
||||
//! (`ZIG/src/terminal/kitty/graphics_unicode.zig`).
|
||||
|
||||
use super::graphics_image::Image;
|
||||
use super::graphics_render::Placement as RenderPlacement;
|
||||
use super::graphics_storage::{ImageStorage, Location, PlacementKey};
|
||||
use crate::page::Cell;
|
||||
use crate::page_list::{CellSubset, Direction, PageList, Pin, RowIterator};
|
||||
use crate::point::Tag;
|
||||
use crate::size::CellCountInt;
|
||||
use crate::style::Color;
|
||||
use super::{
|
||||
graphics_image::Image,
|
||||
graphics_render::Placement as RenderPlacement,
|
||||
graphics_storage::{ImageStorage, Location, PlacementKey},
|
||||
};
|
||||
use crate::{
|
||||
page::Cell,
|
||||
page_list::{CellSubset, Direction, PageList, Pin, RowIterator},
|
||||
point::Tag,
|
||||
size::CellCountInt,
|
||||
style::Color,
|
||||
};
|
||||
|
||||
/// Codepoint for the unicode placeholder character.
|
||||
pub const PLACEHOLDER: u32 = 0x10EEEE;
|
||||
@@ -638,11 +642,13 @@ const DIACRITICS: &[u32] = &[
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ghostty_vt::{modes::Mode, sgr::Attribute};
|
||||
|
||||
use super::*;
|
||||
use crate::kitty::graphics_storage::Placement as StoragePlacement;
|
||||
use crate::terminal::{Options, Terminal};
|
||||
use ghostty_vt::modes::Mode;
|
||||
use ghostty_vt::sgr::Attribute;
|
||||
use crate::{
|
||||
kitty::graphics_storage::Placement as StoragePlacement,
|
||||
terminal::{Options, Terminal},
|
||||
};
|
||||
|
||||
fn term(cols: u16, rows: u16) -> Terminal {
|
||||
let mut t = Terminal::new(Options::new(cols, rows)).unwrap();
|
||||
|
||||
@@ -17,7 +17,6 @@ pub mod graphics_storage;
|
||||
pub mod graphics_unicode;
|
||||
|
||||
pub use ghostty_vt::kitty::{color, graphics_command, key};
|
||||
|
||||
pub use graphics_command::{Command, Parser as CommandParser, Response};
|
||||
pub use graphics_exec::{ExecTerminal, execute};
|
||||
pub use graphics_image::Image;
|
||||
|
||||
Reference in new issue
Block a user