repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/lib.rs | lapce-rpc/src/lib.rs | #![allow(clippy::manual_clamp)]
pub mod buffer;
pub mod core;
pub mod counter;
pub mod dap_types;
pub mod file;
pub mod file_line;
mod parse;
pub mod plugin;
pub mod proxy;
pub mod source_control;
pub mod stdio;
pub mod style;
pub mod terminal;
pub use parse::{Call, RequestId, RpcObject};
use serde::{Deserialize, Ser... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/source_control.rs | lapce-rpc/src/source_control.rs | use std::path::PathBuf;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct DiffInfo {
pub head: String,
pub branches: Vec<String>,
pub tags: Vec<String>,
pub diffs: Vec<FileDiff>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Par... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/parse.rs | lapce-rpc/src/parse.rs | use anyhow::{Result, anyhow};
use serde::de::DeserializeOwned;
use serde_json::Value;
#[derive(Debug, Clone)]
pub struct RpcObject(pub Value);
pub type RequestId = u64;
#[derive(Debug, Clone, PartialEq, Eq)]
/// An RPC call, which may be either a notification or a request.
pub enum Call<N, R> {
/// An id and an ... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/stdio.rs | lapce-rpc/src/stdio.rs | use std::{
io::{self, BufRead, Write},
thread,
};
use anyhow::Result;
use crossbeam_channel::{Receiver, Sender};
use serde::{Serialize, de::DeserializeOwned};
use serde_json::{Value, json};
use crate::{RpcError, RpcMessage, RpcObject};
pub fn stdio_transport<W, R, Req1, Notif1, Resp1, Req2, Notif2, Resp2>(
... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/core.rs | lapce-rpc/src/core.rs | use std::{
collections::HashMap,
path::PathBuf,
sync::{
Arc,
atomic::{AtomicU64, Ordering},
},
};
use crossbeam_channel::{Receiver, Sender};
use lsp_types::{
CancelParams, CompletionResponse, LogMessageParams, ProgressParams,
PublishDiagnosticsParams, ShowMessageParams, Signatur... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/file.rs | lapce-rpc/src/file.rs | use std::{
cmp::{Ord, Ordering, PartialOrd},
collections::HashMap,
path::{Path, PathBuf},
};
use serde::{Deserialize, Serialize};
/// UTF8 line and column-offset
#[derive(
Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize,
)]
pub struct LineCol {
pub line: usize,
pub c... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/terminal.rs | lapce-rpc/src/terminal.rs | use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use crate::counter::Counter;
#[derive(Eq, PartialEq, Hash, Copy, Clone, Debug, Serialize, Deserialize)]
pub struct TermId(pub u64);
impl TermId {
pub fn next() -> Self {
static TERMINAL_ID_COUNTER: Counter = Counter::new();
Self... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/style.rs | lapce-rpc/src/style.rs | use std::{collections::HashMap, path::PathBuf, sync::Arc};
use serde::{Deserialize, Serialize};
pub type LineStyles = HashMap<usize, Arc<Vec<LineStyle>>>;
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct LineStyle {
pub start: usize,
pub end: usize,
pub style: Style,
}
#[derive(Clone, Debug, P... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/counter.rs | lapce-rpc/src/counter.rs | use std::sync::atomic::{self, AtomicU64};
pub struct Counter(AtomicU64);
impl Counter {
pub const fn new() -> Counter {
Counter(AtomicU64::new(1))
}
pub fn next(&self) -> u64 {
self.0.fetch_add(1, atomic::Ordering::Relaxed)
}
}
impl Default for Counter {
fn default() -> Self {
... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/buffer.rs | lapce-rpc/src/buffer.rs | use serde::{Deserialize, Serialize};
use crate::counter::Counter;
#[derive(Eq, PartialEq, Hash, Copy, Clone, Debug, Serialize, Deserialize)]
pub struct BufferId(pub u64);
impl BufferId {
pub fn next() -> Self {
static BUFFER_ID_COUNTER: Counter = Counter::new();
Self(BUFFER_ID_COUNTER.next())
... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/file_line.rs | lapce-rpc/src/file_line.rs | use std::path::PathBuf;
use lsp_types::Position;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FileLine {
pub path: PathBuf,
pub position: Position,
pub content: String,
}
| rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/proxy.rs | lapce-rpc/src/proxy.rs | use std::{
collections::HashMap,
path::PathBuf,
sync::{
Arc,
atomic::{AtomicU64, Ordering},
},
};
use crossbeam_channel::{Receiver, Sender};
use indexmap::IndexMap;
use lapce_xi_rope::RopeDelta;
use lsp_types::{
CallHierarchyIncomingCall, CallHierarchyItem, CodeAction, CodeActionRes... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-rpc/src/plugin.rs | lapce-rpc/src/plugin.rs | use core::fmt;
use std::{collections::HashMap, path::PathBuf};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::counter::Counter;
#[derive(Eq, PartialEq, Hash, Clone, Copy, Debug, Serialize, Deserialize)]
pub struct PluginId(pub u64);
impl PluginId {
pub fn next() -> Self {
static ... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/lib.rs | lapce-proxy/src/lib.rs | #![allow(clippy::manual_clamp)]
pub mod buffer;
pub mod cli;
pub mod dispatch;
pub mod plugin;
pub mod terminal;
pub mod watcher;
use std::{
io::{BufReader, stdin, stdout},
process::exit,
sync::Arc,
thread,
};
use anyhow::{Result, anyhow};
use clap::Parser;
use dispatch::Dispatcher;
use lapce_core::{... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/cli.rs | lapce-proxy/src/cli.rs | use std::path::PathBuf;
use anyhow::{Error, Result, anyhow};
use lapce_core::directory::Directory;
use lapce_rpc::{
RpcMessage,
file::{LineCol, PathObject},
proxy::{ProxyMessage, ProxyNotification},
};
#[derive(Default, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum PathObjectType {
#[default... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/dispatch.rs | lapce-proxy/src/dispatch.rs | use std::{
collections::{HashMap, HashSet},
fs, io,
path::{Path, PathBuf},
sync::{
Arc,
atomic::{AtomicU64, Ordering},
},
thread,
time::Duration,
};
use alacritty_terminal::{event::WindowSize, event_loop::Msg};
use anyhow::{Context, Result, anyhow};
use crossbeam_channel::Se... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/watcher.rs | lapce-proxy/src/watcher.rs | use std::{
collections::VecDeque,
path::{Path, PathBuf},
sync::Arc,
};
use crossbeam_channel::{Receiver, unbounded};
use notify::{
Event, EventKind, RecommendedWatcher, RecursiveMode, Watcher,
event::{ModifyKind, RenameMode},
recommended_watcher,
};
use parking_lot::Mutex;
/// Wrapper around a... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/terminal.rs | lapce-proxy/src/terminal.rs | use std::{
borrow::Cow,
collections::VecDeque,
io::{self, ErrorKind, Read, Write},
num::NonZeroUsize,
path::PathBuf,
sync::Arc,
time::Duration,
};
use alacritty_terminal::{
event::{OnResize, WindowSize},
event_loop::Msg,
tty::{self, EventedPty, EventedReadWrite, Options, Shell, ... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/buffer.rs | lapce-proxy/src/buffer.rs | use std::{
borrow::Cow,
ffi::OsString,
fs,
fs::File,
io::{Read, Write},
path::{Path, PathBuf},
time::SystemTime,
};
use anyhow::{Result, anyhow};
use floem_editor_core::buffer::rope_text::CharIndicesJoin;
use lapce_core::encoding::offset_utf8_to_utf16;
use lapce_rpc::buffer::BufferId;
use l... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/catalog.rs | lapce-proxy/src/plugin/catalog.rs | use std::{
borrow::Cow,
collections::HashMap,
path::PathBuf,
sync::{
Arc,
atomic::{AtomicUsize, Ordering},
},
thread,
};
use lapce_rpc::{
RpcError,
dap_types::{self, DapId, DapServer, SetBreakpointsResponse},
plugin::{PluginId, VoltID, VoltInfo, VoltMetadata},
pr... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/wasi.rs | lapce-proxy/src/plugin/wasi.rs | #[cfg(test)]
mod tests;
use std::{
collections::{HashMap, VecDeque},
fs,
io::{Read, Seek, Write},
path::{Path, PathBuf},
process,
sync::{Arc, RwLock},
thread,
};
use anyhow::{Result, anyhow};
use jsonrpc_lite::{Id, Params};
use lapce_core::directory::Directory;
use lapce_rpc::{
RpcErro... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/psp.rs | lapce-proxy/src/plugin/psp.rs | use std::{
borrow::Cow,
collections::HashMap,
path::{Path, PathBuf},
sync::{
Arc,
atomic::{AtomicU64, Ordering},
},
thread,
};
use anyhow::{Result, anyhow};
use crossbeam_channel::{Receiver, Sender};
use dyn_clone::DynClone;
use floem_editor_core::buffer::rope_text::{RopeText, R... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/lsp.rs | lapce-proxy/src/plugin/lsp.rs | #[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
use std::{
io::{BufRead, BufReader, BufWriter, Write},
path::{Path, PathBuf},
process::{self, Child, Command, Stdio},
sync::Arc,
thread,
};
use anyhow::{Result, anyhow};
use jsonrpc_lite::{Id, Params};
use lapce_core::meta;
us... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/mod.rs | lapce-proxy/src/plugin/mod.rs | pub mod catalog;
pub mod dap;
pub mod lsp;
pub mod psp;
pub mod wasi;
use std::{
borrow::Cow,
collections::HashMap,
fs,
path::{Path, PathBuf},
sync::{
Arc,
atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering},
},
time::Duration,
};
use anyhow::{Result, anyhow};
use crossb... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/dap.rs | lapce-proxy/src/plugin/dap.rs | use std::{
collections::HashMap,
io::{BufReader, BufWriter, Write},
path::PathBuf,
process::{Child, Command, Stdio},
sync::{
Arc,
atomic::{AtomicU64, Ordering},
},
thread,
};
use anyhow::{Result, anyhow};
use crossbeam_channel::{Receiver, Sender};
use lapce_rpc::{
RpcErr... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/plugin/wasi/tests.rs | lapce-proxy/src/plugin/wasi/tests.rs | use std::collections::HashMap;
use lapce_rpc::plugin::VoltMetadata;
use serde_json::{Value, json};
use super::{load_volt, unflatten_map};
#[test]
fn test_unflatten_map() {
let map: HashMap<String, Value> = serde_json::from_value(json!({
"a.b.c": "d",
"a.d": ["e"],
}))
.unwrap();
asser... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-proxy/src/bin/lapce-proxy.rs | lapce-proxy/src/bin/lapce-proxy.rs | use lapce_proxy::mainloop;
fn main() {
mainloop();
}
| rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/lib.rs | yazi-core/src/lib.rs | yazi_macro::mod_pub!(cmp confirm help input mgr notify pick spot tab tasks which);
yazi_macro::mod_flat!(core);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/core.rs | yazi-core/src/core.rs | use crossterm::cursor::SetCursorStyle;
use ratatui::layout::{Position, Rect};
use yazi_shared::Layer;
use crate::{cmp::Cmp, confirm::Confirm, help::Help, input::Input, mgr::Mgr, notify::Notify, pick::Pick, tab::{Folder, Tab}, tasks::Tasks, which::Which};
pub struct Core {
pub mgr: Mgr,
pub tasks: Tasks,
pub ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tasks/tasks.rs | yazi-core/src/tasks/tasks.rs | use std::{sync::Arc, time::Duration};
use parking_lot::Mutex;
use tokio::{task::JoinHandle, time::sleep};
use yazi_adapter::Dimension;
use yazi_parser::app::TaskSummary;
use yazi_proxy::AppProxy;
use yazi_scheduler::{Ongoing, Scheduler, TaskSnap};
use super::{TASKS_BORDER, TASKS_PADDING, TASKS_PERCENT};
pub struct T... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tasks/process.rs | yazi-core/src/tasks/process.rs | use std::mem;
use yazi_parser::tasks::ProcessOpenOpt;
use super::Tasks;
impl Tasks {
// TODO: remove
pub fn open_shell_compat(&self, mut opt: ProcessOpenOpt) {
if opt.spread {
self.scheduler.process_open(opt);
return;
}
if opt.args.is_empty() {
return;
}
if opt.args.len() == 2 {
self.schedule... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tasks/file.rs | yazi-core/src/tasks/file.rs | use hashbrown::HashSet;
use tracing::debug;
use yazi_shared::url::{UrlBuf, UrlBufCov, UrlLike};
use super::Tasks;
use crate::mgr::Yanked;
impl Tasks {
pub fn file_cut(&self, src: &Yanked, dest: &UrlBuf, force: bool) {
for u in src.iter() {
let Some(Ok(to)) = u.name().map(|n| dest.try_join(n)) else {
debug!(... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tasks/prework.rs | yazi-core/src/tasks/prework.rs | use yazi_config::{YAZI, plugin::MAX_PREWORKERS};
use yazi_fs::{File, Files, FsHash64, SortBy};
use super::Tasks;
use crate::mgr::Mimetype;
impl Tasks {
pub fn fetch_paged(&self, paged: &[File], mimetype: &Mimetype) {
let mut loaded = self.scheduler.runner.prework.loaded.lock();
let mut tasks: [Vec<_>; MAX_PREWOR... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tasks/mod.rs | yazi-core/src/tasks/mod.rs | yazi_macro::mod_flat!(file plugin prework process tasks);
pub const TASKS_BORDER: u16 = 2;
pub const TASKS_PADDING: u16 = 2;
pub const TASKS_PERCENT: u16 = 80;
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tasks/plugin.rs | yazi-core/src/tasks/plugin.rs | use yazi_parser::app::PluginOpt;
use super::Tasks;
impl Tasks {
pub fn plugin_entry(&self, opt: PluginOpt) { self.scheduler.plugin_entry(opt); }
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/help/help.rs | yazi-core/src/help/help.rs | use anyhow::Result;
use crossterm::{cursor::SetCursorStyle, event::KeyCode};
use unicode_width::UnicodeWidthStr;
use yazi_adapter::Dimension;
use yazi_config::{KEYMAP, YAZI, keymap::{Chord, Key}};
use yazi_macro::{act, render, render_and};
use yazi_shared::Layer;
use yazi_widgets::Scrollable;
use crate::help::HELP_MAR... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/help/mod.rs | yazi-core/src/help/mod.rs | yazi_macro::mod_flat!(help);
const HELP_MARGIN: u16 = 1;
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/mgr/yanked.rs | yazi-core/src/mgr/yanked.rs | use std::ops::Deref;
use hashbrown::HashSet;
use yazi_dds::Pubsub;
use yazi_fs::FilesOp;
use yazi_macro::err;
use yazi_shared::url::{Url, UrlBuf, UrlBufCov, UrlCov, UrlLike};
#[derive(Debug, Default)]
pub struct Yanked {
pub cut: bool,
urls: HashSet<UrlBufCov>,
version: u64,
revision: u64,
}
impl Deref for ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/mgr/tabs.rs | yazi-core/src/mgr/tabs.rs | use std::ops::{Deref, DerefMut};
use yazi_dds::Pubsub;
use yazi_fs::File;
use yazi_macro::err;
use crate::tab::{Folder, Tab};
pub struct Tabs {
pub cursor: usize,
pub items: Vec<Tab>,
}
impl Default for Tabs {
fn default() -> Self { Self { cursor: 0, items: vec![Default::default()] } }
}
impl Tabs {
pub fn se... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/mgr/mgr.rs | yazi-core/src/mgr/mgr.rs | use std::iter;
use ratatui::layout::Rect;
use yazi_adapter::Dimension;
use yazi_config::popup::{Origin, Position};
use yazi_fs::Splatable;
use yazi_shared::url::{AsUrl, Url, UrlBuf};
use yazi_watcher::Watcher;
use super::{Mimetype, Tabs, Yanked};
use crate::tab::{Folder, Tab};
pub struct Mgr {
pub tabs: Tabs,
pu... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/mgr/mimetype.rs | yazi-core/src/mgr/mimetype.rs | use hashbrown::HashMap;
use yazi_shared::{pool::Symbol, url::{Url, UrlBufCov, UrlCov}};
#[derive(Default)]
pub struct Mimetype(HashMap<UrlBufCov, Symbol<str>>);
impl Mimetype {
pub fn get<'a, 'b>(&'a self, url: impl Into<Url<'b>>) -> Option<&'a str> {
self.0.get(&UrlCov::new(url)).map(|s| s.as_ref())
}
pub fn o... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/mgr/mod.rs | yazi-core/src/mgr/mod.rs | yazi_macro::mod_flat!(mgr mimetype tabs yanked);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/spot/mod.rs | yazi-core/src/spot/mod.rs | yazi_macro::mod_flat!(spot);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/spot/spot.rs | yazi-core/src/spot/spot.rs | use tokio_util::sync::CancellationToken;
use yazi_config::YAZI;
use yazi_fs::File;
use yazi_macro::render;
use yazi_parser::mgr::SpotLock;
use yazi_plugin::isolate;
use yazi_shared::{pool::Symbol, url::UrlBuf};
#[derive(Default)]
pub struct Spot {
pub lock: Option<SpotLock>,
pub skip: usize,
pub(super) ct: Option<... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/input/mod.rs | yazi-core/src/input/mod.rs | yazi_macro::mod_flat!(input);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/input/input.rs | yazi-core/src/input/input.rs | use std::{ops::{Deref, DerefMut}, rc::Rc};
use tokio::sync::mpsc::UnboundedSender;
use yazi_config::popup::Position;
use yazi_shared::{Ids, errors::InputError};
#[derive(Default)]
pub struct Input {
pub(super) inner: yazi_widgets::input::Input,
pub visible: bool,
pub title: String,
pub position: Position,
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/pick/pick.rs | yazi-core/src/pick/pick.rs | use anyhow::Result;
use tokio::sync::oneshot::Sender;
use yazi_config::{YAZI, popup::Position};
use yazi_widgets::Scrollable;
#[derive(Default)]
pub struct Pick {
pub title: String,
pub items: Vec<String>,
pub position: Position,
pub offset: usize,
pub cursor: usize,
pub callback: Option<Sender<Result... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/pick/mod.rs | yazi-core/src/pick/mod.rs | yazi_macro::mod_flat!(pick);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/cmp/mod.rs | yazi-core/src/cmp/mod.rs | yazi_macro::mod_flat!(cmp);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/cmp/cmp.rs | yazi-core/src/cmp/cmp.rs | use hashbrown::HashMap;
use yazi_parser::cmp::CmpItem;
use yazi_shared::{Id, url::UrlBuf};
use yazi_widgets::Scrollable;
#[derive(Default)]
pub struct Cmp {
pub caches: HashMap<UrlBuf, Vec<CmpItem>>,
pub cands: Vec<CmpItem>,
pub offset: usize,
pub cursor: usize,
pub ticket: Id,
pub visible: bool,
}
impl Cmp ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/confirm/mod.rs | yazi-core/src/confirm/mod.rs | yazi_macro::mod_flat!(confirm);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/confirm/confirm.rs | yazi-core/src/confirm/confirm.rs | use ratatui::{text::Line, widgets::Paragraph};
use tokio::sync::oneshot::Sender;
use yazi_config::popup::Position;
#[derive(Default)]
pub struct Confirm {
pub title: Line<'static>,
pub body: Paragraph<'static>,
pub list: Paragraph<'static>,
pub position: Position,
pub offset: usize,
pub callback: Option<Se... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/notify/notify.rs | yazi-core/src/notify/notify.rs | use std::ops::ControlFlow;
use ratatui::layout::Rect;
use tokio::task::JoinHandle;
use super::{Message, NOTIFY_SPACING};
#[derive(Default)]
pub struct Notify {
pub(super) tick_handle: Option<JoinHandle<()>>,
pub messages: Vec<Message>,
}
impl Notify {
pub fn limit(&self, area: Rect) -> usize {
if sel... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/notify/mod.rs | yazi-core/src/notify/mod.rs | yazi_macro::mod_pub!(commands);
yazi_macro::mod_flat!(message notify);
pub const NOTIFY_BORDER: u16 = 2;
pub const NOTIFY_SPACING: u16 = 1;
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/notify/message.rs | yazi-core/src/notify/message.rs | use std::time::{Duration, Instant};
use unicode_width::UnicodeWidthStr;
use yazi_parser::app::{NotifyLevel, NotifyOpt};
use super::NOTIFY_BORDER;
pub struct Message {
pub title: String,
pub content: String,
pub level: NotifyLevel,
pub timeout: Duration,
pub instant: Instant,
pub percent: u8,
pub max_... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/notify/commands/push.rs | yazi-core/src/notify/commands/push.rs | use std::time::{Duration, Instant};
use yazi_parser::app::NotifyOpt;
use yazi_proxy::AppProxy;
use crate::notify::{Message, Notify};
impl Notify {
pub fn push(&mut self, opt: NotifyOpt) {
let instant = Instant::now();
let mut msg = Message::from(opt);
msg.timeout += instant - self.messages.first().map_or(ins... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/notify/commands/mod.rs | yazi-core/src/notify/commands/mod.rs | yazi_macro::mod_flat!(push tick);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/notify/commands/tick.rs | yazi-core/src/notify/commands/tick.rs | use std::time::Duration;
use ratatui::layout::Rect;
use yazi_parser::notify::TickOpt;
use yazi_proxy::AppProxy;
use crate::notify::Notify;
impl Notify {
pub fn tick(&mut self, opt: TickOpt, area: Rect) {
self.tick_handle.take().map(|h| h.abort());
let limit = self.limit(area);
if limit == 0 {
return;
}
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/which/which.rs | yazi-core/src/which/which.rs | use yazi_config::{KEYMAP, keymap::{ChordCow, Key}};
use yazi_macro::{emit, render, render_and};
use yazi_shared::Layer;
use crate::which::WhichSorter;
#[derive(Default)]
pub struct Which {
pub times: usize,
pub cands: Vec<ChordCow>,
// Visibility
pub visible: bool,
pub silent: bool,
}
impl Which {
pub fn r#t... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/which/mod.rs | yazi-core/src/which/mod.rs | yazi_macro::mod_flat!(sorter which);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/which/sorter.rs | yazi-core/src/which/sorter.rs | use std::{borrow::Cow, mem};
use yazi_config::{YAZI, keymap::ChordCow, which::SortBy};
use yazi_shared::{natsort, translit::Transliterator};
#[derive(Clone, Copy, PartialEq)]
pub struct WhichSorter {
pub by: SortBy,
pub sensitive: bool,
pub reverse: bool,
pub translit: bool,
}
impl Default for WhichSor... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/backstack.rs | yazi-core/src/tab/backstack.rs | use yazi_shared::url::{Url, UrlBuf};
#[derive(Default)]
pub struct Backstack {
cursor: usize,
stack: Vec<UrlBuf>,
}
impl Backstack {
pub fn push(&mut self, url: Url) {
if self.stack.is_empty() {
self.stack.push(url.to_owned());
return;
}
if self.stack[self.cursor] == url {
return;
}
self.curs... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/finder.rs | yazi-core/src/tab/finder.rs | use anyhow::Result;
use hashbrown::HashMap;
use yazi_fs::{Files, Filter, FilterCase};
use yazi_shared::{path::{AsPath, PathBufDyn}, url::UrlBuf};
use crate::tab::Folder;
pub struct Finder {
pub filter: Filter,
pub matched: HashMap<PathBufDyn, u8>,
lock: FinderLock,
}
#[derive(Default)]
struct FinderLock {... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/history.rs | yazi-core/src/tab/history.rs | use std::ops::{Deref, DerefMut};
use hashbrown::HashMap;
use yazi_shared::url::{AsUrl, UrlBuf};
use super::Folder;
#[derive(Default)]
pub struct History(HashMap<UrlBuf, Folder>);
impl Deref for History {
type Target = HashMap<UrlBuf, Folder>;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl DerefMut for Hist... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/preference.rs | yazi-core/src/tab/preference.rs | use yazi_config::YAZI;
use yazi_fs::{FilesSorter, SortBy};
#[derive(Clone, PartialEq)]
pub struct Preference {
// Sorting
pub sort_by: SortBy,
pub sort_sensitive: bool,
pub sort_reverse: bool,
pub sort_dir_first: bool,
pub sort_translit: bool,
// Display
pub linemode: String,
pub show_hidden: bo... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/mod.rs | yazi-core/src/tab/mod.rs | yazi_macro::mod_flat!(backstack finder folder history mode preference preview selected tab);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/selected.rs | yazi-core/src/tab/selected.rs | use std::ops::Deref;
use hashbrown::HashMap;
use indexmap::IndexMap;
use yazi_fs::FilesOp;
use yazi_shared::{timestamp_us, url::{Url, UrlBuf, UrlBufCov, UrlCov}};
#[derive(Default)]
pub struct Selected {
inner: IndexMap<UrlBufCov, u64>,
parents: HashMap<UrlBufCov, usize>,
}
impl Selected {
pub fn len(&self) -> ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/mode.rs | yazi-core/src/tab/mode.rs | use std::{collections::BTreeSet, fmt::Display, mem};
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub enum Mode {
#[default]
Normal,
Select(usize, BTreeSet<usize>),
Unset(usize, BTreeSet<usize>),
}
impl Mode {
pub fn visual_mut(&mut self) -> Option<(usize, &mut BTreeSet<usize>)> {
match self {
Self::Norm... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/folder.rs | yazi-core/src/tab/folder.rs | use std::mem;
use yazi_config::{LAYOUT, YAZI};
use yazi_dds::Pubsub;
use yazi_fs::{File, Files, FilesOp, FolderStage, cha::Cha};
use yazi_macro::err;
use yazi_parser::Step;
use yazi_proxy::MgrProxy;
use yazi_shared::{Id, path::{AsPath, PathBufDyn, PathDyn}, url::UrlBuf};
use yazi_widgets::Scrollable;
pub struct Folde... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/preview.rs | yazi-core/src/tab/preview.rs | use std::time::Duration;
use tokio::{pin, task::JoinHandle};
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
use tokio_util::sync::CancellationToken;
use yazi_adapter::ADAPTOR;
use yazi_config::{LAYOUT, YAZI};
use yazi_fs::{File, Files, FilesOp, cha::Cha};
use yazi_macro::render;
use yazi_parser::mgr... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-core/src/tab/tab.rs | yazi-core/src/tab/tab.rs | use anyhow::Result;
use ratatui::layout::Rect;
use tokio::task::JoinHandle;
use yazi_adapter::Dimension;
use yazi_config::{LAYOUT, popup::{Origin, Position}};
use yazi_fs::File;
use yazi_shared::{Id, Ids, url::UrlBuf};
use super::{Backstack, Finder, Folder, History, Mode, Preference, Preview};
use crate::{spot::Spot, ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/lib.rs | yazi-plugin/src/lib.rs | yazi_macro::mod_pub!(bindings elements external fs isolate loader process pubsub runtime theme utils);
yazi_macro::mod_flat!(lua);
pub fn init() -> anyhow::Result<()> {
crate::loader::init();
crate::init_lua()?;
Ok(())
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/lua.rs | yazi-plugin/src/lua.rs | use anyhow::{Context, Result};
use futures::executor::block_on;
use mlua::Lua;
use yazi_binding::{Runtime, runtime_mut};
use yazi_boot::BOOT;
use yazi_macro::plugin_preset as preset;
use yazi_shared::RoCell;
pub static LUA: RoCell<Lua> = RoCell::new();
pub(super) fn init_lua() -> Result<()> {
LUA.init(Lua::new());
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/pubsub/pubsub.rs | yazi-plugin/src/pubsub/pubsub.rs | use mlua::{ExternalResult, Function, Lua, Value};
use yazi_binding::{Id, runtime};
use yazi_dds::ember::Ember;
pub struct Pubsub;
impl Pubsub {
pub(super) fn r#pub(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|lua, (kind, value): (mlua::String, Value)| {
yazi_dds::Pubsub::r#pub(Ember::from_lua(lua... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/pubsub/mod.rs | yazi-plugin/src/pubsub/mod.rs | use mlua::{IntoLua, Lua, Value};
use yazi_binding::{Composer, ComposerGet, ComposerSet};
yazi_macro::mod_flat!(pubsub);
pub(super) fn compose() -> Composer<ComposerGet, ComposerSet> {
fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> {
match key {
b"pub" => Pubsub::r#pub(lua)?,
b"pub_to" => Pubsub::pub_to... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/process/command.rs | yazi-plugin/src/process/command.rs | use std::{any::TypeId, ffi::OsStr, io, process::Stdio};
use mlua::{AnyUserData, ExternalError, IntoLua, IntoLuaMulti, Lua, MetaMethod, Table, UserData, Value};
use tokio::process::{ChildStderr, ChildStdin, ChildStdout};
use yazi_binding::Error;
use yazi_shared::wtf8::FromWtf8;
use super::{Child, output::Output};
use ... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/process/process.rs | yazi-plugin/src/process/process.rs | use mlua::Lua;
pub fn install(lua: &Lua) -> mlua::Result<()> {
super::Command::install(lua)?;
Ok(())
}
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/process/status.rs | yazi-plugin/src/process/status.rs | use mlua::UserData;
pub struct Status {
inner: std::process::ExitStatus,
}
impl Status {
pub fn new(inner: std::process::ExitStatus) -> Self { Self { inner } }
}
impl UserData for Status {
fn add_fields<F: mlua::UserDataFields<Self>>(fields: &mut F) {
fields.add_field_method_get("success", |_, me| Ok(me.inner.s... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/process/mod.rs | yazi-plugin/src/process/mod.rs | yazi_macro::mod_flat!(child command output process status);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/process/child.rs | yazi-plugin/src/process/child.rs | use std::{ops::DerefMut, process::ExitStatus, time::Duration};
use futures::future::try_join3;
use mlua::{AnyUserData, ExternalError, IntoLua, IntoLuaMulti, Table, UserData, UserDataMethods, Value};
use tokio::{io::{self, AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader, BufWriter}, process::{ChildStderr, Child... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/process/output.rs | yazi-plugin/src/process/output.rs | use mlua::{UserData, Value};
use yazi_binding::cached_field;
use super::Status;
pub struct Output {
inner: std::process::Output,
v_status: Option<Value>,
v_stdout: Option<Value>,
v_stderr: Option<Value>,
}
impl Output {
pub fn new(inner: std::process::Output) -> Self {
Self { inner, v_status: None, v_stdout:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/loader/mod.rs | yazi-plugin/src/loader/mod.rs | yazi_macro::mod_flat!(chunk loader require);
pub(super) fn init() { LOADER.with(<_>::default); }
pub(super) fn install(lua: &mlua::Lua) -> mlua::Result<()> { Require::install(lua) }
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/loader/require.rs | yazi-plugin/src/loader/require.rs | use std::{borrow::Cow, sync::Arc};
use mlua::{ExternalResult, Function, IntoLua, Lua, MetaMethod, MultiValue, ObjectLike, Table, Value};
use yazi_binding::{runtime, runtime_mut};
use super::LOADER;
pub(super) struct Require;
impl Require {
pub(super) fn install(lua: &Lua) -> mlua::Result<()> {
lua.globals().raw_... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/loader/loader.rs | yazi-plugin/src/loader/loader.rs | use std::{borrow::Cow, ops::Deref};
use anyhow::{Context, Result, bail, ensure};
use hashbrown::HashMap;
use mlua::{ChunkMode, ExternalError, Lua, Table};
use parking_lot::RwLock;
use yazi_boot::BOOT;
use yazi_fs::provider::local::Local;
use yazi_macro::plugin_preset as preset;
use yazi_shared::{BytesExt, LOG_LEVEL, R... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/loader/chunk.rs | yazi-plugin/src/loader/chunk.rs | use std::borrow::Cow;
use mlua::{AsChunk, ChunkMode};
use yazi_shared::natsort;
pub struct Chunk {
pub mode: ChunkMode,
pub bytes: Cow<'static, [u8]>,
pub since: String,
pub sync_peek: bool,
pub sync_entry: bool,
}
impl Chunk {
#[inline]
pub fn compatible(&self) -> bool {
let s = yazi_boot:... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/runtime/runtime.rs | yazi-plugin/src/runtime/runtime.rs | use mlua::{IntoLua, Lua, LuaSerdeExt, Value};
use yazi_binding::{Composer, ComposerGet, ComposerSet, SER_OPT, Url};
use yazi_boot::ARGS;
use yazi_config::YAZI;
pub fn compose() -> Composer<ComposerGet, ComposerSet> {
fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> {
match key {
b"args" => args().into_lua(lu... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/runtime/mod.rs | yazi-plugin/src/runtime/mod.rs | yazi_macro::mod_flat!(plugin runtime term);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/runtime/term.rs | yazi-plugin/src/runtime/term.rs | use mlua::{Function, IntoLua, IntoLuaMulti, Lua, Value};
use yazi_adapter::{Dimension, EMULATOR};
use yazi_binding::{Composer, ComposerGet, ComposerSet};
pub(super) fn term() -> Composer<ComposerGet, ComposerSet> {
fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> {
match key {
b"light" => EMULATOR.light.into... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/runtime/plugin.rs | yazi-plugin/src/runtime/plugin.rs | use mlua::{Function, IntoLua, Lua, UserData, Value};
use yazi_binding::{Composer, ComposerGet, ComposerSet, FileRef, cached_field};
use yazi_config::YAZI;
pub(super) fn plugin() -> Composer<ComposerGet, ComposerSet> {
fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> {
match key {
b"fetchers" => fetchers(lua)... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/external/fd.rs | yazi-plugin/src/external/fd.rs | use std::process::Stdio;
use anyhow::Result;
use tokio::{io::{AsyncBufReadExt, BufReader}, process::{Child, Command}, sync::mpsc::{self, UnboundedReceiver}};
use yazi_fs::{File, FsUrl};
use yazi_shared::url::{AsUrl, UrlBuf, UrlLike};
use yazi_vfs::VfsFile;
pub struct FdOpt {
pub cwd: UrlBuf,
pub hidden: bool,
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/external/rg.rs | yazi-plugin/src/external/rg.rs | use std::process::Stdio;
use anyhow::Result;
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}};
use yazi_fs::{File, FsUrl};
use yazi_shared::url::{AsUrl, UrlBuf, UrlLike};
use yazi_vfs::VfsFile;
pub struct RgOpt {
pub cwd: UrlBuf,
pub hidden: bool,
pub subj... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/external/highlighter.rs | yazi-plugin/src/external/highlighter.rs | use std::{borrow::Cow, io::Cursor, mem, path::{Path, PathBuf}, sync::OnceLock};
use anyhow::{Result, anyhow};
use ratatui::{layout::Size, text::{Line, Span, Text}};
use syntect::{LoadingError, dumps, easy::HighlightLines, highlighting::{self, Theme, ThemeSet}, parsing::{SyntaxReference, SyntaxSet}};
use tokio::io::{As... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/external/mod.rs | yazi-plugin/src/external/mod.rs | yazi_macro::mod_flat!(fd highlighter rg rga);
| rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/external/rga.rs | yazi-plugin/src/external/rga.rs | use std::process::Stdio;
use anyhow::Result;
use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}};
use yazi_fs::{File, FsUrl};
use yazi_shared::url::{AsUrl, UrlBuf, UrlLike};
use yazi_vfs::VfsFile;
pub struct RgaOpt {
pub cwd: UrlBuf,
pub hidden: bool,
pub sub... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/app.rs | yazi-plugin/src/utils/app.rs | use std::any::TypeId;
use mlua::{AnyUserData, ExternalError, Function, Lua};
use tokio::process::{ChildStderr, ChildStdin, ChildStdout};
use yazi_binding::{Id, Permit, PermitRef, deprecate};
use yazi_proxy::{AppProxy, HIDER};
use super::Utils;
impl Utils {
pub(super) fn id(lua: &Lua) -> mlua::Result<Function> {
l... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/user.rs | yazi-plugin/src/utils/user.rs | #[cfg(unix)]
use mlua::{Function, Lua};
use super::Utils;
impl Utils {
#[cfg(unix)]
pub(super) fn uid(lua: &Lua) -> mlua::Result<Function> {
use uzers::Users;
lua.create_function(|_, ()| Ok(yazi_shared::USERS_CACHE.get_current_uid()))
}
#[cfg(unix)]
pub(super) fn gid(lua: &Lua) -> mlua::Result<Function> {
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/process.rs | yazi-plugin/src/utils/process.rs | use mlua::{Function, Lua};
use super::Utils;
impl Utils {
#[cfg(target_os = "macos")]
pub(super) fn proc_info(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|lua, pid: usize| {
let info = unsafe {
let mut info: libc::proc_taskinfo = std::mem::zeroed();
libc::proc_pidinfo(
pid as _,
... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/call.rs | yazi-plugin/src/utils/call.rs | use mlua::{Function, Lua, Table};
use yazi_binding::deprecate;
use yazi_dds::Sendable;
use yazi_macro::{emit, render};
use yazi_shared::{Layer, Source, event::Cmd};
use super::Utils;
impl Utils {
pub(super) fn render(lua: &Lua) -> mlua::Result<Function> {
lua.create_function(|lua, ()| {
deprecate!(lua, "`ya.ren... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/image.rs | yazi-plugin/src/utils/image.rs | use mlua::{Function, IntoLuaMulti, Lua, Value};
use yazi_adapter::{ADAPTOR, Image};
use yazi_binding::{Error, UrlRef, elements::Rect};
use yazi_fs::FsUrl;
use yazi_shared::url::{AsUrl, UrlLike};
use super::Utils;
use crate::bindings::ImageInfo;
impl Utils {
pub(super) fn image_info(lua: &Lua) -> mlua::Result<Functio... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
sxyazi/yazi | https://github.com/sxyazi/yazi/blob/3c39a326abaacb37d9ff15af7668756d60624dfa/yazi-plugin/src/utils/sync.rs | yazi-plugin/src/utils/sync.rs | use anyhow::Context;
use futures::future::join_all;
use mlua::{ExternalError, ExternalResult, Function, IntoLuaMulti, Lua, MultiValue, Value, Variadic};
use tokio::sync::oneshot;
use yazi_binding::{Handle, runtime, runtime_mut};
use yazi_dds::Sendable;
use yazi_parser::app::{PluginCallback, PluginOpt};
use yazi_proxy::... | rust | MIT | 3c39a326abaacb37d9ff15af7668756d60624dfa | 2026-01-04T15:33:17.426354Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.