diff --git a/cspell.json b/cspell.json index 308c09af..d63ad773 100644 --- a/cspell.json +++ b/cspell.json @@ -1 +1 @@ -{"language":"en","words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","Upserting","prio","Ghostty","Catmull","Lanczos","cmds","unyank","scrolloff","headsup","unsub","uzers","scopeguard","SPDLOG","globset","filetime","magick","magick","prefetcher","Prework","prefetchers","PREWORKERS","conds","translit","rxvt","Urxvt","realpath","realname","REPARSE","hardlink","hardlinking","nlink","nlink","linemodes","SIGSTOP","sevenzip","rsplitn","replacen","DECSET","DECRQM","repeek","cwds","tcsi","Hyprland","Wayfire","SWAYSOCK","btime","nsec","codegen","gethostname","fchmod","fdfind","Rustc","rustc","Sysinfo","ffprobe","vframes","luma","obase","outln","errln","tmtheme","twox","cfgs","fstype","objc","rdev","runloop","exfat","rclone","DECRQSS","DECSCUSR"],"flagWords":[],"version":"0.2"} \ No newline at end of file +{"version":"0.2","language":"en","flagWords":[],"words":["Punct","KEYMAP","splitn","crossterm","YAZI","peekable","ratatui","syntect","pbpaste","pbcopy","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","Konsole","Alacritty","Überzug","pkgs","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","Upserting","prio","Ghostty","Catmull","Lanczos","cmds","unyank","scrolloff","headsup","unsub","uzers","scopeguard","SPDLOG","globset","filetime","magick","magick","prefetcher","Prework","prefetchers","PREWORKERS","conds","translit","rxvt","Urxvt","realpath","realname","REPARSE","hardlink","hardlinking","nlink","nlink","linemodes","SIGSTOP","sevenzip","rsplitn","replacen","DECSET","DECRQM","repeek","cwds","tcsi","Hyprland","Wayfire","SWAYSOCK","btime","nsec","codegen","gethostname","fchmod","fdfind","Rustc","rustc","ffprobe","vframes","luma","obase","outln","errln","tmtheme","twox","cfgs","fstype","objc","rdev","runloop","exfat","rclone","DECRQSS","DECSCUSR","libvterm"]} \ No newline at end of file diff --git a/yazi-adapter/src/brand.rs b/yazi-adapter/src/brand.rs index 42d7b447..2d52bd24 100644 --- a/yazi-adapter/src/brand.rs +++ b/yazi-adapter/src/brand.rs @@ -1,7 +1,7 @@ use tracing::warn; use yazi_shared::env_exists; -use crate::{Mux, NVIM}; +use crate::Mux; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Brand { @@ -20,7 +20,7 @@ pub enum Brand { Hyper, Mintty, Tmux, - Neovim, + VTerm, Apple, Urxvt, Bobcat, @@ -36,6 +36,7 @@ impl Brand { ("foot", Self::Foot), ("ghostty", Self::Ghostty), ("tmux ", Self::Tmux), + ("libvterm", Self::VTerm), ("Bobcat", Self::Bobcat), ]; names.into_iter().find(|&(n, _)| resp.contains(n)).map(|(_, b)| b) @@ -44,10 +45,6 @@ impl Brand { pub fn from_env() -> Option { use Brand as B; - if NVIM.get() { - return Some(Self::Neovim); - } - let vars = [ ("KITTY_WINDOW_ID", B::Kitty), ("KONSOLE_VERSION", B::Konsole), @@ -112,7 +109,7 @@ impl Brand { B::Hyper => &[A::Iip, A::Sixel], B::Mintty => &[A::Iip], B::Tmux => &[], - B::Neovim => &[], + B::VTerm => &[], B::Apple => &[], B::Urxvt => &[], B::Bobcat => &[A::Iip, A::Sixel], diff --git a/yazi-adapter/src/lib.rs b/yazi-adapter/src/lib.rs index c05ddd45..f28b134b 100644 --- a/yazi-adapter/src/lib.rs +++ b/yazi-adapter/src/lib.rs @@ -4,7 +4,7 @@ yazi_macro::mod_pub!(drivers); yazi_macro::mod_flat!(adapter brand dimension emulator image info mux unknown); -use yazi_shared::{SyncCell, env_exists, in_wsl}; +use yazi_shared::{SyncCell, in_wsl}; pub static EMULATOR: SyncCell = SyncCell::new(Emulator::unknown()); pub static ADAPTOR: SyncCell = SyncCell::new(Adapter::Chafa); @@ -15,9 +15,6 @@ static SHOWN: SyncCell> = SyncCell::new(None); // WSL support pub static WSL: SyncCell = SyncCell::new(false); -// Neovim support -pub static NVIM: SyncCell = SyncCell::new(false); - // Tmux support pub static TMUX: SyncCell = SyncCell::new(false); static ESCAPE: SyncCell<&'static str> = SyncCell::new("\x1b"); @@ -28,9 +25,6 @@ pub fn init() -> anyhow::Result<()> { // WSL support WSL.set(in_wsl()); - // Neovim support - NVIM.set(env_exists("NVIM_LOG_FILE") && env_exists("NVIM")); - // Emulator detection EMULATOR.set(Emulator::detect().unwrap_or_default()); TMUX.set(EMULATOR.get().kind.is_left_and(|&b| b == Brand::Tmux)); diff --git a/yazi-adapter/src/mux.rs b/yazi-adapter/src/mux.rs index c358057a..0c304420 100644 --- a/yazi-adapter/src/mux.rs +++ b/yazi-adapter/src/mux.rs @@ -1,13 +1,13 @@ use anyhow::Result; use tracing::error; -use crate::{CLOSE, ESCAPE, Emulator, NVIM, START, TMUX}; +use crate::{CLOSE, ESCAPE, Emulator, START, TMUX}; pub struct Mux; impl Mux { pub fn csi(s: &str) -> std::borrow::Cow { - if TMUX.get() && !NVIM.get() { + if TMUX.get() { std::borrow::Cow::Owned(format!( "{START}{}{CLOSE}", s.trim_start_matches('\x1b').replace('\x1b', ESCAPE.get()), @@ -41,7 +41,7 @@ impl Mux { } pub fn tmux_drain() -> Result<()> { - if TMUX.get() && !NVIM.get() { + if TMUX.get() { crossterm::execute!(std::io::stderr(), crossterm::style::Print(Mux::csi("\x1b[5n")))?; _ = futures::executor::block_on(Emulator::read_until_dsr()); } diff --git a/yazi-boot/src/actions/debug.rs b/yazi-boot/src/actions/debug.rs index 6115d924..9acc7696 100644 --- a/yazi-boot/src/actions/debug.rs +++ b/yazi-boot/src/actions/debug.rs @@ -43,10 +43,6 @@ impl Actions { writeln!(s, "\nWSL")?; writeln!(s, " WSL: {:?}", yazi_adapter::WSL.get())?; - writeln!(s, "\nNeovim")?; - writeln!(s, " NVIM : {}", yazi_adapter::NVIM.get())?; - writeln!(s, " Neovim version: {}", Self::process_output("nvim", "--version"))?; - writeln!(s, "\nVariables")?; writeln!(s, " SHELL : {:?}", env::var_os("SHELL"))?; writeln!(s, " EDITOR : {:?}", env::var_os("EDITOR"))?;