mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
da62d6d7c2
commit
1bee98aa39
5 changed files with 8 additions and 30 deletions
|
|
@ -1,7 +1,4 @@
|
||||||
use std::{
|
use std::{path::{Path, PathBuf}, sync::atomic::{AtomicBool, Ordering}};
|
||||||
path::{Path, PathBuf},
|
|
||||||
sync::atomic::{AtomicBool, Ordering},
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use config::{preview::PreviewAdaptor, BOOT, PREVIEW};
|
use config::{preview::PreviewAdaptor, BOOT, PREVIEW};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
use std::{
|
use std::{io::{stdout, BufWriter, Write}, path::Path};
|
||||||
io::{stdout, BufWriter, Write},
|
|
||||||
path::Path,
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use base64::{engine::general_purpose, Engine};
|
use base64::{engine::general_purpose, Engine};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
use std::{
|
use std::{io::{stdout, Write}, path::Path};
|
||||||
io::{stdout, Write},
|
|
||||||
path::Path,
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use base64::{engine::general_purpose, Engine};
|
use base64::{engine::general_purpose, Engine};
|
||||||
|
|
@ -23,9 +20,7 @@ impl Kitty {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(super) fn image_hide() -> Result<()> {
|
pub(super) fn image_hide() -> Result<()> { Ok(stdout().write_all(b"\x1b\\\x1b_Ga=d\x1b\\")?) }
|
||||||
Ok(stdout().write_all(b"\x1b\\\x1b_Ga=d\x1b\\")?)
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn encode(img: DynamicImage) -> Result<Vec<u8>> {
|
async fn encode(img: DynamicImage) -> Result<Vec<u8>> {
|
||||||
fn output(raw: &[u8], format: u8, size: (u32, u32)) -> Result<Vec<u8>> {
|
fn output(raw: &[u8], format: u8, size: (u32, u32)) -> Result<Vec<u8>> {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
use std::{
|
use std::{io::{stdout, BufWriter, Write}, path::Path};
|
||||||
io::{stdout, BufWriter, Write},
|
|
||||||
path::Path,
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
use color_quant::NeuQuant;
|
use color_quant::NeuQuant;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
use std::io::{stdout, Write};
|
use std::io::{stdout, Write};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crossterm::{
|
use crossterm::{cursor::{MoveTo, RestorePosition, SavePosition, SetCursorStyle}, execute, queue, terminal::{Clear, ClearType}};
|
||||||
cursor::{MoveTo, RestorePosition, SavePosition, SetCursorStyle},
|
|
||||||
execute, queue,
|
|
||||||
terminal::{Clear, ClearType},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::Term;
|
use crate::Term;
|
||||||
|
|
||||||
|
|
@ -46,12 +42,8 @@ impl Term {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_cursor_block() -> Result<()> {
|
pub fn set_cursor_block() -> Result<()> { Ok(execute!(stdout(), SetCursorStyle::BlinkingBlock)?) }
|
||||||
Ok(execute!(stdout(), SetCursorStyle::BlinkingBlock)?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_cursor_bar() -> Result<()> {
|
pub fn set_cursor_bar() -> Result<()> { Ok(execute!(stdout(), SetCursorStyle::BlinkingBar)?) }
|
||||||
Ok(execute!(stdout(), SetCursorStyle::BlinkingBar)?)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue