mirror of
https://github.com/sxyazi/yazi.git
synced 2026-05-13 08:16:40 +00:00
feat: sort search results by full URN (#2164)
This commit is contained in:
parent
05ecbca994
commit
21f6a92ea3
21 changed files with 410 additions and 330 deletions
43
Cargo.lock
generated
43
Cargo.lock
generated
|
|
@ -333,9 +333,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.6"
|
||||
version = "1.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333"
|
||||
checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"libc",
|
||||
|
|
@ -663,12 +663,6 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "diff"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
|
|
@ -1282,13 +1276,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "instability"
|
||||
version = "0.3.5"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "898e106451f7335950c9cc64f8ec67b5f65698679ac67ed00619aeef14e1cf75"
|
||||
checksum = "894813a444908c0c8c0e221b041771d107c4a21de1d317dc49bcc66e3c9e5b3f"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"indoc",
|
||||
"pretty_assertions",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
|
|
@ -1914,16 +1907,6 @@ dependencies = [
|
|||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pretty_assertions"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
|
||||
dependencies = [
|
||||
"diff",
|
||||
"yansi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr2"
|
||||
version = "2.0.0"
|
||||
|
|
@ -2456,9 +2439,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.94"
|
||||
version = "2.0.95"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3"
|
||||
checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -2668,7 +2651,6 @@ version = "0.8.19"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
|
|
@ -3309,9 +3291,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.6.21"
|
||||
version = "0.6.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6f5bb5257f2407a5425c6e749bfd9692192a73e70a6060516ac04f889087d68"
|
||||
checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
@ -3334,12 +3316,6 @@ version = "0.5.5"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
|
||||
|
||||
[[package]]
|
||||
name = "yansi"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
|
||||
|
||||
[[package]]
|
||||
name = "yazi-adapter"
|
||||
version = "0.4.3"
|
||||
|
|
@ -3389,9 +3365,10 @@ dependencies = [
|
|||
"clap_complete_nushell",
|
||||
"crossterm",
|
||||
"md-5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
"toml_edit",
|
||||
"toml",
|
||||
"vergen-gitcl",
|
||||
"yazi-boot",
|
||||
"yazi-dds",
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ anyhow = { workspace = true }
|
|||
clap = { workspace = true }
|
||||
crossterm = { workspace = true }
|
||||
md-5 = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
toml_edit = "0.22.22"
|
||||
toml = { version = "0.8.19" }
|
||||
|
||||
[build-dependencies]
|
||||
yazi-shared = { path = "../yazi-shared", version = "0.4.3" }
|
||||
|
|
|
|||
|
|
@ -63,16 +63,13 @@ async fn run() -> anyhow::Result<()> {
|
|||
Command::Pack(cmd) => {
|
||||
package::init()?;
|
||||
if cmd.install {
|
||||
package::Package::install_from_config("plugin", false).await?;
|
||||
package::Package::install_from_config("flavor", false).await?;
|
||||
package::Package::load().await?.install(false).await?;
|
||||
} else if cmd.list {
|
||||
package::Package::list_from_config("plugin").await?;
|
||||
package::Package::list_from_config("flavor").await?;
|
||||
package::Package::load().await?.print()?;
|
||||
} else if cmd.upgrade {
|
||||
package::Package::install_from_config("plugin", true).await?;
|
||||
package::Package::install_from_config("flavor", true).await?;
|
||||
package::Package::load().await?.install(true).await?;
|
||||
} else if let Some(repo) = cmd.add {
|
||||
package::Package::add_to_config(&repo).await?;
|
||||
package::Package::load().await?.add(&repo).await?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use anyhow::Result;
|
||||
use yazi_fs::must_exists;
|
||||
|
||||
use super::{Git, Package};
|
||||
use super::{Dependency, Git};
|
||||
|
||||
impl Package {
|
||||
impl Dependency {
|
||||
pub(super) async fn add(&mut self) -> Result<()> {
|
||||
self.header("Upgrading package `{name}`")?;
|
||||
|
||||
|
|
|
|||
113
yazi-cli/src/package/dependency.rs
Normal file
113
yazi-cli/src/package/dependency.rs
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
use std::{borrow::Cow, io::BufWriter, path::PathBuf};
|
||||
|
||||
use anyhow::Result;
|
||||
use md5::{Digest, Md5};
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use yazi_fs::Xdg;
|
||||
|
||||
pub(crate) struct Dependency {
|
||||
pub(crate) repo: String,
|
||||
pub(crate) child: String,
|
||||
pub(crate) rev: String,
|
||||
pub(super) is_flavor: bool,
|
||||
}
|
||||
|
||||
impl Dependency {
|
||||
pub(super) fn new(url: &str, rev: Option<&str>) -> Self {
|
||||
let mut parts = url.splitn(2, ':');
|
||||
|
||||
let mut repo = parts.next().unwrap_or_default().to_owned();
|
||||
let child = if let Some(s) = parts.next() {
|
||||
format!("{s}.yazi")
|
||||
} else {
|
||||
repo.push_str(".yazi");
|
||||
String::new()
|
||||
};
|
||||
|
||||
Self { repo, child, rev: rev.unwrap_or_default().to_owned(), is_flavor: false }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn use_(&self) -> Cow<str> {
|
||||
if self.child.is_empty() {
|
||||
self.repo.trim_end_matches(".yazi").into()
|
||||
} else {
|
||||
format!("{}:{}", self.repo, self.child.trim_end_matches(".yazi")).into()
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn name(&self) -> Option<&str> {
|
||||
let s = if self.child.is_empty() {
|
||||
self.repo.split('/').last().filter(|s| !s.is_empty())
|
||||
} else {
|
||||
Some(self.child.as_str())
|
||||
};
|
||||
|
||||
s.filter(|s| s.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'-' | b'.')))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn local(&self) -> PathBuf {
|
||||
Xdg::state_dir()
|
||||
.join("packages")
|
||||
.join(format!("{:x}", Md5::new_with_prefix(self.remote()).finalize()))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn remote(&self) -> String {
|
||||
// Support more Git hosting services in the future
|
||||
format!("https://github.com/{}.git", self.repo)
|
||||
}
|
||||
|
||||
pub(super) fn header(&self, s: &str) -> Result<()> {
|
||||
use crossterm::style::{Attribute, Print, SetAttributes};
|
||||
|
||||
crossterm::execute!(
|
||||
BufWriter::new(std::io::stdout()),
|
||||
Print("\n"),
|
||||
SetAttributes(Attribute::Reverse.into()),
|
||||
SetAttributes(Attribute::Bold.into()),
|
||||
Print(" "),
|
||||
Print(s.replacen("{name}", self.name().unwrap_or_default(), 1)),
|
||||
Print(" "),
|
||||
SetAttributes(Attribute::Reset.into()),
|
||||
Print("\n\n"),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for Dependency {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
#[derive(Deserialize)]
|
||||
struct Shadow {
|
||||
#[serde(rename = "use")]
|
||||
use_: String,
|
||||
rev: Option<String>,
|
||||
}
|
||||
|
||||
let outer = Shadow::deserialize(deserializer)?;
|
||||
Ok(Self::new(&outer.use_, outer.rev.as_deref()))
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for Dependency {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
#[derive(Serialize)]
|
||||
struct Shadow<'a> {
|
||||
#[serde(rename = "use")]
|
||||
use_: Cow<'a, str>,
|
||||
rev: Option<&'a String>,
|
||||
}
|
||||
|
||||
Shadow { use_: self.use_(), rev: Some(&self.rev).filter(|&s| !s.is_empty()) }
|
||||
.serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
|
@ -5,11 +5,11 @@ use tokio::fs;
|
|||
use yazi_fs::{Xdg, maybe_exists, must_exists, remove_dir_clean};
|
||||
use yazi_macro::outln;
|
||||
|
||||
use super::Package;
|
||||
use super::Dependency;
|
||||
|
||||
const TRACKER: &str = "DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY";
|
||||
|
||||
impl Package {
|
||||
impl Dependency {
|
||||
pub(super) async fn deploy(&mut self) -> Result<()> {
|
||||
let Some(name) = self.name().map(ToOwned::to_owned) else { bail!("Invalid package url") };
|
||||
let from = self.local().join(&self.child);
|
||||
|
|
@ -36,6 +36,7 @@ For safety, please manually delete it from your plugin/flavor directory and re-r
|
|||
let files = if self.is_flavor {
|
||||
&["flavor.toml", "tmtheme.xml", "README.md", "preview.png", "LICENSE", "LICENSE-tmtheme"][..]
|
||||
} else {
|
||||
// TODO: init.lua
|
||||
&["init.lua", "README.md", "LICENSE"][..]
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use anyhow::Result;
|
||||
use yazi_fs::must_exists;
|
||||
|
||||
use super::{Git, Package};
|
||||
use super::{Dependency, Git};
|
||||
|
||||
impl Package {
|
||||
impl Dependency {
|
||||
pub(super) async fn install(&mut self) -> Result<()> {
|
||||
self.header("Installing package `{name}`")?;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#![allow(clippy::module_inception)]
|
||||
|
||||
yazi_macro::mod_flat!(add deploy git install package parser upgrade);
|
||||
yazi_macro::mod_flat!(add dependency deploy git install package upgrade);
|
||||
|
||||
use anyhow::Context;
|
||||
use yazi_fs::Xdg;
|
||||
|
|
|
|||
|
|
@ -1,78 +1,133 @@
|
|||
use std::{borrow::Cow, io::BufWriter, path::PathBuf};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Result;
|
||||
use md5::{Digest, Md5};
|
||||
use anyhow::{Context, Result, bail};
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use tokio::fs;
|
||||
use yazi_fs::Xdg;
|
||||
use yazi_macro::outln;
|
||||
|
||||
use super::Dependency;
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct Package {
|
||||
pub(crate) repo: String,
|
||||
pub(crate) child: String,
|
||||
pub(crate) rev: String,
|
||||
pub(super) is_flavor: bool,
|
||||
plugins: Vec<Dependency>,
|
||||
flavors: Vec<Dependency>,
|
||||
}
|
||||
|
||||
impl Package {
|
||||
pub(super) fn new(url: &str, rev: Option<&str>) -> Self {
|
||||
let mut parts = url.splitn(2, ':');
|
||||
|
||||
let mut repo = parts.next().unwrap_or_default().to_owned();
|
||||
let child = if let Some(s) = parts.next() {
|
||||
format!("{s}.yazi")
|
||||
} else {
|
||||
repo.push_str(".yazi");
|
||||
String::new()
|
||||
};
|
||||
|
||||
Self { repo, child, rev: rev.unwrap_or_default().to_owned(), is_flavor: false }
|
||||
pub(crate) async fn load() -> Result<Self> {
|
||||
Ok(match fs::read_to_string(Self::path()).await {
|
||||
Ok(s) => toml::from_str(&s)?,
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Self::default(),
|
||||
Err(e) => Err(e)?,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn use_(&self) -> Cow<str> {
|
||||
if self.child.is_empty() {
|
||||
self.repo.trim_end_matches(".yazi").into()
|
||||
} else {
|
||||
format!("{}:{}", self.repo, self.child.trim_end_matches(".yazi")).into()
|
||||
pub(crate) async fn add(&mut self, use_: &str) -> Result<()> {
|
||||
let mut dep = Dependency::new(use_, None);
|
||||
let Some(name) = dep.name() else { bail!("Invalid package `use`") };
|
||||
|
||||
if self.plugins.iter().any(|d| d.repo == dep.repo && d.child == dep.child) {
|
||||
bail!("Plugin `{name}` already exists in package.toml");
|
||||
}
|
||||
if self.flavors.iter().any(|d| d.repo == dep.repo && d.child == dep.child) {
|
||||
bail!("Flavor `{name}` already exists in package.toml");
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn name(&self) -> Option<&str> {
|
||||
let s = if self.child.is_empty() {
|
||||
self.repo.split('/').last().filter(|s| !s.is_empty())
|
||||
dep.add().await?;
|
||||
if dep.is_flavor {
|
||||
self.flavors.push(dep);
|
||||
} else {
|
||||
Some(self.child.as_str())
|
||||
};
|
||||
self.plugins.push(dep);
|
||||
}
|
||||
|
||||
s.filter(|s| s.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'-' | b'.')))
|
||||
Ok(fs::write(Self::path(), toml::to_string_pretty(self)?).await?)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn local(&self) -> PathBuf {
|
||||
Xdg::state_dir()
|
||||
.join("packages")
|
||||
.join(format!("{:x}", Md5::new_with_prefix(self.remote()).finalize()))
|
||||
pub(crate) async fn install(&mut self, upgrade: bool) -> Result<()> {
|
||||
for d in &mut self.plugins {
|
||||
if upgrade {
|
||||
d.upgrade().await?;
|
||||
} else {
|
||||
d.install().await?;
|
||||
}
|
||||
}
|
||||
for d in &mut self.flavors {
|
||||
if upgrade {
|
||||
d.upgrade().await?;
|
||||
} else {
|
||||
d.install().await?;
|
||||
}
|
||||
}
|
||||
|
||||
let s = toml::to_string_pretty(self)?;
|
||||
fs::write(Self::path(), s).await.context("Failed to write package.toml")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn remote(&self) -> String {
|
||||
// Support more Git hosting services in the future
|
||||
format!("https://github.com/{}.git", self.repo)
|
||||
}
|
||||
pub(crate) fn print(&self) -> Result<()> {
|
||||
outln!("Plugins:")?;
|
||||
for d in &self.plugins {
|
||||
if d.rev.is_empty() {
|
||||
outln!("\t{}", d.use_())?;
|
||||
} else {
|
||||
outln!("\t{} ({})", d.use_(), d.rev)?;
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn header(&self, s: &str) -> Result<()> {
|
||||
use crossterm::style::{Attribute, Print, SetAttributes};
|
||||
outln!("Flavors:")?;
|
||||
for d in &self.flavors {
|
||||
if d.rev.is_empty() {
|
||||
outln!("\t{}", d.use_())?;
|
||||
} else {
|
||||
outln!("\t{} ({})", d.use_(), d.rev)?;
|
||||
}
|
||||
}
|
||||
|
||||
crossterm::execute!(
|
||||
BufWriter::new(std::io::stdout()),
|
||||
Print("\n"),
|
||||
SetAttributes(Attribute::Reverse.into()),
|
||||
SetAttributes(Attribute::Bold.into()),
|
||||
Print(" "),
|
||||
Print(s.replacen("{name}", self.name().unwrap_or_default(), 1)),
|
||||
Print(" "),
|
||||
SetAttributes(Attribute::Reset.into()),
|
||||
Print("\n\n"),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn path() -> PathBuf { Xdg::config_dir().join("package.toml") }
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for Package {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
#[derive(Deserialize)]
|
||||
struct Outer {
|
||||
#[serde(default)]
|
||||
plugin: Shadow,
|
||||
#[serde(default)]
|
||||
flavor: Shadow,
|
||||
}
|
||||
#[derive(Default, Deserialize)]
|
||||
struct Shadow {
|
||||
deps: Vec<Dependency>,
|
||||
}
|
||||
|
||||
let outer = Outer::deserialize(deserializer)?;
|
||||
Ok(Self { plugins: outer.plugin.deps, flavors: outer.flavor.deps })
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for Package {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
#[derive(Serialize)]
|
||||
struct Outer<'a> {
|
||||
plugin: Shadow<'a>,
|
||||
flavor: Shadow<'a>,
|
||||
}
|
||||
#[derive(Serialize)]
|
||||
struct Shadow<'a> {
|
||||
deps: &'a [Dependency],
|
||||
}
|
||||
|
||||
Outer { plugin: Shadow { deps: &self.plugins }, flavor: Shadow { deps: &self.flavors } }
|
||||
.serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,139 +0,0 @@
|
|||
use anyhow::{Context, Result, bail};
|
||||
use tokio::fs;
|
||||
use toml_edit::{Array, DocumentMut, InlineTable, Item, Value};
|
||||
use yazi_fs::Xdg;
|
||||
use yazi_macro::outln;
|
||||
|
||||
use super::Package;
|
||||
|
||||
impl Package {
|
||||
pub(crate) async fn add_to_config(use_: &str) -> Result<()> {
|
||||
let mut package = Self::new(use_, None);
|
||||
let Some(name) = package.name() else { bail!("Invalid package `use`") };
|
||||
|
||||
let path = Xdg::config_dir().join("package.toml");
|
||||
let mut doc = Self::ensure_config(&fs::read_to_string(&path).await.unwrap_or_default())?;
|
||||
|
||||
Self::ensure_unique(&doc, name)?;
|
||||
package.add().await?;
|
||||
|
||||
let mut table = InlineTable::new();
|
||||
table.insert("use", package.use_().as_ref().into());
|
||||
if !package.rev.is_empty() {
|
||||
table.insert("rev", package.rev.into());
|
||||
}
|
||||
|
||||
if package.is_flavor {
|
||||
doc["flavor"]["deps"].as_array_mut().unwrap().push(table);
|
||||
} else {
|
||||
doc["plugin"]["deps"].as_array_mut().unwrap().push(table);
|
||||
}
|
||||
|
||||
fs::write(path, doc.to_string()).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn install_from_config(section: &str, upgrade: bool) -> Result<()> {
|
||||
let path = Xdg::config_dir().join("package.toml");
|
||||
let Ok(s) = fs::read_to_string(&path).await else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let mut doc = s.parse::<DocumentMut>().context("Failed to parse package.toml")?;
|
||||
let Some(deps) = doc.get_mut(section).and_then(|d| d.get_mut("deps")) else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let deps = deps.as_array_mut().context("`deps` must be an array")?;
|
||||
for dep in deps.iter_mut() {
|
||||
let dep = dep.as_inline_table_mut().context("Dependency must be an inline table")?;
|
||||
let use_ = dep.get("use").and_then(Value::as_str).context("Missing `use` field")?;
|
||||
let rev = dep.get("rev").and_then(Value::as_str);
|
||||
|
||||
let mut package = Package::new(use_, rev);
|
||||
if upgrade {
|
||||
package.upgrade().await?;
|
||||
} else {
|
||||
package.install().await?;
|
||||
}
|
||||
|
||||
if package.rev.is_empty() {
|
||||
dep.remove("rev");
|
||||
} else {
|
||||
dep.insert("rev", package.rev.into());
|
||||
}
|
||||
}
|
||||
|
||||
fs::write(path, doc.to_string()).await.context("Failed to write package.toml")
|
||||
}
|
||||
|
||||
pub(crate) async fn list_from_config(section: &str) -> Result<()> {
|
||||
let path = Xdg::config_dir().join("package.toml");
|
||||
let Ok(s) = fs::read_to_string(&path).await else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let doc = s.parse::<DocumentMut>().context("Failed to parse package.toml")?;
|
||||
let Some(deps) = doc.get(section).and_then(|d| d.get("deps")) else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let deps = deps.as_array().context("`deps` must be an array")?;
|
||||
outln!("{section}s:")?;
|
||||
|
||||
for dep in deps {
|
||||
let Some(dep) = dep.as_inline_table() else { continue };
|
||||
match (dep.get("use").and_then(Value::as_str), dep.get("rev").and_then(Value::as_str)) {
|
||||
(Some(use_), None) => outln!("\t{use_}")?,
|
||||
(Some(use_), Some(rev)) => outln!("\t{use_} ({rev})")?,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn ensure_config(s: &str) -> Result<DocumentMut> {
|
||||
let mut doc = s.parse::<DocumentMut>().context("Failed to parse package.toml")?;
|
||||
|
||||
doc
|
||||
.entry("plugin")
|
||||
.or_insert(toml_edit::table())
|
||||
.as_table_mut()
|
||||
.context("Failed to get `plugin` table")?
|
||||
.entry("deps")
|
||||
.or_insert(Item::Value(Array::new().into()))
|
||||
.as_array()
|
||||
.context("Failed to get `deps` array")?;
|
||||
|
||||
doc
|
||||
.entry("flavor")
|
||||
.or_insert(toml_edit::table())
|
||||
.as_table_mut()
|
||||
.context("Failed to get `flavor` table")?
|
||||
.entry("deps")
|
||||
.or_insert(Item::Value(Array::new().into()))
|
||||
.as_array()
|
||||
.context("Failed to get `deps` array")?;
|
||||
|
||||
Ok(doc)
|
||||
}
|
||||
|
||||
fn ensure_unique(doc: &DocumentMut, name: &str) -> Result<()> {
|
||||
#[inline]
|
||||
fn same(v: &Value, name: &str) -> bool {
|
||||
v.as_inline_table()
|
||||
.and_then(|t| t.get("use"))
|
||||
.and_then(Value::as_str)
|
||||
.is_some_and(|s| Package::new(s, None).name() == Some(name))
|
||||
}
|
||||
|
||||
if doc["plugin"]["deps"].as_array().unwrap().into_iter().any(|v| same(v, name)) {
|
||||
bail!("Plugin `{name}` already exists in package.toml");
|
||||
}
|
||||
if doc["flavor"]["deps"].as_array().unwrap().into_iter().any(|v| same(v, name)) {
|
||||
bail!("Flavor `{name}` already exists in package.toml");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use anyhow::Result;
|
||||
|
||||
use super::Package;
|
||||
use super::Dependency;
|
||||
|
||||
impl Package {
|
||||
impl Dependency {
|
||||
pub(super) async fn upgrade(&mut self) -> Result<()> {
|
||||
if self.rev.starts_with('=') { Ok(()) } else { self.add().await }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ proc-macro = true
|
|||
|
||||
[dependencies]
|
||||
# External dependencies
|
||||
syn = { version = "2.0.94", features = [ "full" ] }
|
||||
syn = { version = "2.0.95", features = [ "full" ] }
|
||||
quote = "1.0.38"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ indexmap = { version = "2.7.0", features = [ "serde" ] }
|
|||
ratatui = { workspace = true }
|
||||
regex = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
toml = { version = "0.8.19", features = [ "preserve_order" ] }
|
||||
toml = { version = "0.8.19" }
|
||||
tracing = { workspace = true }
|
||||
validator = { version = "0.19.0", features = [ "derive" ] }
|
||||
|
||||
|
|
|
|||
|
|
@ -248,6 +248,8 @@ globs = []
|
|||
dirs = [
|
||||
{ name = ".config", text = "" },
|
||||
{ name = ".git", text = "" },
|
||||
{ name = ".github", text = "" },
|
||||
{ name = ".npm", text = "" },
|
||||
{ name = "Desktop", text = "" },
|
||||
{ name = "Development", text = "" },
|
||||
{ name = "Documents", text = "" },
|
||||
|
|
@ -263,6 +265,10 @@ files = [
|
|||
{ name = ".babelrc", text = "", fg = "#cbcb41" },
|
||||
{ name = ".bash_profile", text = "", fg = "#89e051" },
|
||||
{ name = ".bashrc", text = "", fg = "#89e051" },
|
||||
{ name = ".clang-format", text = "", fg = "#6d8086" },
|
||||
{ name = ".clang-tidy", text = "", fg = "#6d8086" },
|
||||
{ name = ".codespellrc", text = "", fg = "#35da60" },
|
||||
{ name = ".condarc", text = "", fg = "#43b02a" },
|
||||
{ name = ".dockerignore", text = "", fg = "#458ee6" },
|
||||
{ name = ".ds_store", text = "", fg = "#41535b" },
|
||||
{ name = ".editorconfig", text = "", fg = "#fff2f2" },
|
||||
|
|
@ -278,12 +284,15 @@ files = [
|
|||
{ name = ".gtkrc-2.0", text = "", fg = "#ffffff" },
|
||||
{ name = ".gvimrc", text = "", fg = "#019833" },
|
||||
{ name = ".justfile", text = "", fg = "#6d8086" },
|
||||
{ name = ".luacheckrc", text = "", fg = "#00a2ff" },
|
||||
{ name = ".luaurc", text = "", fg = "#00a2ff" },
|
||||
{ name = ".mailmap", text = "", fg = "#f54d27" },
|
||||
{ name = ".nanorc", text = "", fg = "#440077" },
|
||||
{ name = ".npmignore", text = "", fg = "#e8274b" },
|
||||
{ name = ".npmrc", text = "", fg = "#e8274b" },
|
||||
{ name = ".nuxtrc", text = "", fg = "#00c58e" },
|
||||
{ name = ".nvmrc", text = "", fg = "#5fa04e" },
|
||||
{ name = ".pre-commit-config.yaml", text = "", fg = "#f8b424" },
|
||||
{ name = ".prettierignore", text = "", fg = "#4285f4" },
|
||||
{ name = ".prettierrc", text = "", fg = "#4285f4" },
|
||||
{ name = ".prettierrc.cjs", text = "", fg = "#4285f4" },
|
||||
|
|
@ -294,6 +303,7 @@ files = [
|
|||
{ name = ".prettierrc.toml", text = "", fg = "#4285f4" },
|
||||
{ name = ".prettierrc.yaml", text = "", fg = "#4285f4" },
|
||||
{ name = ".prettierrc.yml", text = "", fg = "#4285f4" },
|
||||
{ name = ".pylintrc", text = "", fg = "#6d8086" },
|
||||
{ name = ".settings.json", text = "", fg = "#854cc7" },
|
||||
{ name = ".SRCINFO", text = "", fg = "#0f94d2" },
|
||||
{ name = ".vimrc", text = "", fg = "#019833" },
|
||||
|
|
@ -306,15 +316,17 @@ files = [
|
|||
{ name = ".zshrc", text = "", fg = "#89e051" },
|
||||
{ name = "_gvimrc", text = "", fg = "#019833" },
|
||||
{ name = "_vimrc", text = "", fg = "#019833" },
|
||||
{ name = "avif", text = "", fg = "#a074c4" },
|
||||
{ name = "AUTHORS", text = "", fg = "#a172ff" },
|
||||
{ name = "AUTHORS.txt", text = "", fg = "#a172ff" },
|
||||
{ name = "brewfile", text = "", fg = "#701516" },
|
||||
{ name = "bspwmrc", text = "", fg = "#2f2f2f" },
|
||||
{ name = "build", text = "", fg = "#89e051" },
|
||||
{ name = "build.gradle", text = "", fg = "#005f87" },
|
||||
{ name = "build.zig.zon", text = "", fg = "#f69a1b" },
|
||||
{ name = "bun.lockb", text = "", fg = "#eadcd1" },
|
||||
{ name = "cantorrc", text = "", fg = "#1c99f3" },
|
||||
{ name = "checkhealth", text = "", fg = "#75b4fb" },
|
||||
{ name = "cmakelists.txt", text = "", fg = "#6d8086" },
|
||||
{ name = "cmakelists.txt", text = "", fg = "#dce3eb" },
|
||||
{ name = "code_of_conduct", text = "", fg = "#e41662" },
|
||||
{ name = "code_of_conduct.md", text = "", fg = "#e41662" },
|
||||
{ name = "commit_editmsg", text = "", fg = "#f54d27" },
|
||||
|
|
@ -326,6 +338,9 @@ files = [
|
|||
{ name = "containerfile", text = "", fg = "#458ee6" },
|
||||
{ name = "copying", text = "", fg = "#cbcb41" },
|
||||
{ name = "copying.lesser", text = "", fg = "#cbcb41" },
|
||||
{ name = "Directory.Build.props", text = "", fg = "#00a2ff" },
|
||||
{ name = "Directory.Build.targets", text = "", fg = "#00a2ff" },
|
||||
{ name = "Directory.Packages.props", text = "", fg = "#00a2ff" },
|
||||
{ name = "docker-compose.yaml", text = "", fg = "#458ee6" },
|
||||
{ name = "docker-compose.yml", text = "", fg = "#458ee6" },
|
||||
{ name = "dockerfile", text = "", fg = "#458ee6" },
|
||||
|
|
@ -338,7 +353,7 @@ files = [
|
|||
{ name = "fp-info-cache", text = "", fg = "#ffffff" },
|
||||
{ name = "fp-lib-table", text = "", fg = "#ffffff" },
|
||||
{ name = "FreeCAD.conf", text = "", fg = "#cb333b" },
|
||||
{ name = "gemfile$", text = "", fg = "#701516" },
|
||||
{ name = "Gemfile", text = "", fg = "#701516" },
|
||||
{ name = "gnumakefile", text = "", fg = "#6d8086" },
|
||||
{ name = "go.mod", text = "", fg = "#519aba" },
|
||||
{ name = "go.sum", text = "", fg = "#519aba" },
|
||||
|
|
@ -364,6 +379,7 @@ files = [
|
|||
{ name = "i18n.config.ts", text = "", fg = "#7986cb" },
|
||||
{ name = "i3blocks.conf", text = "", fg = "#e8ebee" },
|
||||
{ name = "i3status.conf", text = "", fg = "#e8ebee" },
|
||||
{ name = "index.theme", text = "", fg = "#2db96f" },
|
||||
{ name = "ionic.config.json", text = "", fg = "#4f8ff7" },
|
||||
{ name = "justfile", text = "", fg = "#6d8086" },
|
||||
{ name = "kalgebrarc", text = "", fg = "#1c99f3" },
|
||||
|
|
@ -399,6 +415,8 @@ files = [
|
|||
{ name = "py.typed", text = "", fg = "#ffbc03" },
|
||||
{ name = "QtProject.conf", text = "", fg = "#40cd52" },
|
||||
{ name = "rakefile", text = "", fg = "#701516" },
|
||||
{ name = "readme", text = "", fg = "#ededed" },
|
||||
{ name = "readme.md", text = "", fg = "#ededed" },
|
||||
{ name = "rmd", text = "", fg = "#519aba" },
|
||||
{ name = "robots.txt", text = "", fg = "#5d7096" },
|
||||
{ name = "security", text = "", fg = "#bec4c9" },
|
||||
|
|
@ -414,8 +432,8 @@ files = [
|
|||
{ name = "tmux.conf.local", text = "", fg = "#14ba19" },
|
||||
{ name = "tsconfig.json", text = "", fg = "#519aba" },
|
||||
{ name = "unlicense", text = "", fg = "#d0bf41" },
|
||||
{ name = "vagrantfile$", text = "", fg = "#1563ff" },
|
||||
{ name = "vercel.json", text = "▲", fg = "#ffffff" },
|
||||
{ name = "vagrantfile", text = "", fg = "#1563ff" },
|
||||
{ name = "vercel.json", text = "", fg = "#ffffff" },
|
||||
{ name = "vlcrc", text = "", fg = "#ee7a00" },
|
||||
{ name = "webpack", text = "", fg = "#519aba" },
|
||||
{ name = "weston.ini", text = "", fg = "#ffbb01" },
|
||||
|
|
@ -432,18 +450,22 @@ exts = [
|
|||
{ name = "7z", text = "", fg = "#eca517" },
|
||||
{ name = "a", text = "", fg = "#dcddd6" },
|
||||
{ name = "aac", text = "", fg = "#00afff" },
|
||||
{ name = "adb", text = "", fg = "#22ffff" },
|
||||
{ name = "ads", text = "", fg = "#ffffff" },
|
||||
{ name = "ai", text = "", fg = "#cbcb41" },
|
||||
{ name = "aif", text = "", fg = "#00afff" },
|
||||
{ name = "aiff", text = "", fg = "#00afff" },
|
||||
{ name = "android", text = "", fg = "#34a853" },
|
||||
{ name = "ape", text = "", fg = "#00afff" },
|
||||
{ name = "apk", text = "", fg = "#34a853" },
|
||||
{ name = "apl", text = "⍝", fg = "#ffa500" },
|
||||
{ name = "apl", text = "", fg = "#24a148" },
|
||||
{ name = "app", text = "", fg = "#9f0500" },
|
||||
{ name = "applescript", text = "", fg = "#6d8085" },
|
||||
{ name = "asc", text = "", fg = "#576d7f" },
|
||||
{ name = "asm", text = "", fg = "#0091bd" },
|
||||
{ name = "ass", text = "", fg = "#ffb713" },
|
||||
{ name = "astro", text = "", fg = "#e23f67" },
|
||||
{ name = "avif", text = "", fg = "#a074c4" },
|
||||
{ name = "awk", text = "", fg = "#4d5a5e" },
|
||||
{ name = "azcli", text = "", fg = "#0078d4" },
|
||||
{ name = "bak", text = "", fg = "#6d8086" },
|
||||
|
|
@ -458,7 +480,7 @@ exts = [
|
|||
{ name = "blend", text = "", fg = "#ea7600" },
|
||||
{ name = "blp", text = "", fg = "#5796e2" },
|
||||
{ name = "bmp", text = "", fg = "#a074c4" },
|
||||
{ name = "bqn", text = "⎉", fg = "#2b7067" },
|
||||
{ name = "bqn", text = "", fg = "#24a148" },
|
||||
{ name = "brep", text = "", fg = "#839463" },
|
||||
{ name = "bz", text = "", fg = "#eca517" },
|
||||
{ name = "bz2", text = "", fg = "#eca517" },
|
||||
|
|
@ -468,7 +490,7 @@ exts = [
|
|||
{ name = "c++", text = "", fg = "#f34b7d" },
|
||||
{ name = "cache", text = "", fg = "#ffffff" },
|
||||
{ name = "cast", text = "", fg = "#fd971f" },
|
||||
{ name = "cbl", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cbl", text = "", fg = "#005ca5" },
|
||||
{ name = "cc", text = "", fg = "#f34b7d" },
|
||||
{ name = "ccm", text = "", fg = "#f34b7d" },
|
||||
{ name = "cfg", text = "", fg = "#6d8086" },
|
||||
|
|
@ -477,17 +499,18 @@ exts = [
|
|||
{ name = "cljc", text = "", fg = "#8dc149" },
|
||||
{ name = "cljd", text = "", fg = "#519aba" },
|
||||
{ name = "cljs", text = "", fg = "#519aba" },
|
||||
{ name = "cmake", text = "", fg = "#6d8086" },
|
||||
{ name = "cob", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cobol", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cmake", text = "", fg = "#dce3eb" },
|
||||
{ name = "cob", text = "", fg = "#005ca5" },
|
||||
{ name = "cobol", text = "", fg = "#005ca5" },
|
||||
{ name = "coffee", text = "", fg = "#cbcb41" },
|
||||
{ name = "conda", text = "", fg = "#43b02a" },
|
||||
{ name = "conf", text = "", fg = "#6d8086" },
|
||||
{ name = "config.ru", text = "", fg = "#701516" },
|
||||
{ name = "cow", text = "", fg = "#965824" },
|
||||
{ name = "cp", text = "", fg = "#519aba" },
|
||||
{ name = "cpp", text = "", fg = "#519aba" },
|
||||
{ name = "cppm", text = "", fg = "#519aba" },
|
||||
{ name = "cpy", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cpy", text = "", fg = "#005ca5" },
|
||||
{ name = "cr", text = "", fg = "#c8c8c8" },
|
||||
{ name = "crdownload", text = "", fg = "#44cda8" },
|
||||
{ name = "cs", text = "", fg = "#596706" },
|
||||
|
|
@ -503,7 +526,7 @@ exts = [
|
|||
{ name = "cuh", text = "", fg = "#a074c4" },
|
||||
{ name = "cxx", text = "", fg = "#519aba" },
|
||||
{ name = "cxxm", text = "", fg = "#519aba" },
|
||||
{ name = "d", text = "", fg = "#427819" },
|
||||
{ name = "d", text = "", fg = "#b03931" },
|
||||
{ name = "d.ts", text = "", fg = "#d59855" },
|
||||
{ name = "dart", text = "", fg = "#03589c" },
|
||||
{ name = "db", text = "", fg = "#dad8d8" },
|
||||
|
|
@ -559,6 +582,10 @@ exts = [
|
|||
{ name = "flc", text = "", fg = "#ececec" },
|
||||
{ name = "flf", text = "", fg = "#ececec" },
|
||||
{ name = "fnl", text = "", fg = "#fff3d7" },
|
||||
{ name = "fodg", text = "", fg = "#fffb57" },
|
||||
{ name = "fodp", text = "", fg = "#fe9c45" },
|
||||
{ name = "fods", text = "", fg = "#78fc4e" },
|
||||
{ name = "fodt", text = "", fg = "#2dcbfd" },
|
||||
{ name = "fs", text = "", fg = "#519aba" },
|
||||
{ name = "fsi", text = "", fg = "#519aba" },
|
||||
{ name = "fsscript", text = "", fg = "#519aba" },
|
||||
|
|
@ -573,6 +600,7 @@ exts = [
|
|||
{ name = "gnumakefile", text = "", fg = "#6d8086" },
|
||||
{ name = "go", text = "", fg = "#519aba" },
|
||||
{ name = "godot", text = "", fg = "#6d8086" },
|
||||
{ name = "gpr", text = "", fg = "#ff33ff" },
|
||||
{ name = "gql", text = "", fg = "#e535ab" },
|
||||
{ name = "gradle", text = "", fg = "#005f87" },
|
||||
{ name = "graphql", text = "", fg = "#e535ab" },
|
||||
|
|
@ -610,7 +638,7 @@ exts = [
|
|||
{ name = "info", text = "", fg = "#ffffcd" },
|
||||
{ name = "ini", text = "", fg = "#6d8086" },
|
||||
{ name = "ino", text = "", fg = "#56b6c2" },
|
||||
{ name = "ipynb", text = "", fg = "#51a0cf" },
|
||||
{ name = "ipynb", text = "", fg = "#f57d01" },
|
||||
{ name = "iso", text = "", fg = "#d0bec8" },
|
||||
{ name = "ixx", text = "", fg = "#519aba" },
|
||||
{ name = "java", text = "", fg = "#cc3e44" },
|
||||
|
|
@ -666,7 +694,7 @@ exts = [
|
|||
{ name = "magnet", text = "", fg = "#a51b16" },
|
||||
{ name = "makefile", text = "", fg = "#6d8086" },
|
||||
{ name = "markdown", text = "", fg = "#dddddd" },
|
||||
{ name = "material", text = "", fg = "#b83998" },
|
||||
{ name = "material", text = "", fg = "#b83998" },
|
||||
{ name = "md", text = "", fg = "#dddddd" },
|
||||
{ name = "md5", text = "", fg = "#8c86af" },
|
||||
{ name = "mdx", text = "", fg = "#519aba" },
|
||||
|
|
@ -677,7 +705,7 @@ exts = [
|
|||
{ name = "ml", text = "", fg = "#e37933" },
|
||||
{ name = "mli", text = "", fg = "#e37933" },
|
||||
{ name = "mm", text = "", fg = "#519aba" },
|
||||
{ name = "mo", text = "∞", fg = "#9772fb" },
|
||||
{ name = "mo", text = "", fg = "#9772fb" },
|
||||
{ name = "mobi", text = "", fg = "#eab16d" },
|
||||
{ name = "mojo", text = "", fg = "#ff4c1f" },
|
||||
{ name = "mov", text = "", fg = "#fd971f" },
|
||||
|
|
@ -690,11 +718,21 @@ exts = [
|
|||
{ name = "nfo", text = "", fg = "#ffffcd" },
|
||||
{ name = "nim", text = "", fg = "#f3d400" },
|
||||
{ name = "nix", text = "", fg = "#7ebae4" },
|
||||
{ name = "norg", text = "", fg = "#4878be" },
|
||||
{ name = "nswag", text = "", fg = "#85ea2d" },
|
||||
{ name = "nu", text = ">", fg = "#3aa675" },
|
||||
{ name = "nu", text = "", fg = "#3aa675" },
|
||||
{ name = "o", text = "", fg = "#9f0500" },
|
||||
{ name = "obj", text = "", fg = "#888888" },
|
||||
{ name = "odf", text = "", fg = "#ff5a96" },
|
||||
{ name = "odg", text = "", fg = "#fffb57" },
|
||||
{ name = "odin", text = "", fg = "#3882d2" },
|
||||
{ name = "odp", text = "", fg = "#fe9c45" },
|
||||
{ name = "ods", text = "", fg = "#78fc4e" },
|
||||
{ name = "odt", text = "", fg = "#2dcbfd" },
|
||||
{ name = "oga", text = "", fg = "#0075aa" },
|
||||
{ name = "ogg", text = "", fg = "#0075aa" },
|
||||
{ name = "ogv", text = "", fg = "#fd971f" },
|
||||
{ name = "ogx", text = "", fg = "#fd971f" },
|
||||
{ name = "opus", text = "", fg = "#0075aa" },
|
||||
{ name = "org", text = "", fg = "#77aa99" },
|
||||
{ name = "otf", text = "", fg = "#ececec" },
|
||||
|
|
@ -714,6 +752,7 @@ exts = [
|
|||
{ name = "pot", text = "", fg = "#2596be" },
|
||||
{ name = "pp", text = "", fg = "#ffa61a" },
|
||||
{ name = "ppt", text = "", fg = "#cb4a32" },
|
||||
{ name = "pptx", text = "", fg = "#cb4a32" },
|
||||
{ name = "prisma", text = "", fg = "#5a67d8" },
|
||||
{ name = "pro", text = "", fg = "#e4b854" },
|
||||
{ name = "ps1", text = "", fg = "#4273ca" },
|
||||
|
|
@ -736,8 +775,8 @@ exts = [
|
|||
{ name = "qrc", text = "", fg = "#40cd52" },
|
||||
{ name = "qss", text = "", fg = "#40cd52" },
|
||||
{ name = "query", text = "", fg = "#90a850" },
|
||||
{ name = "R", text = "", fg = "#2266ba" },
|
||||
{ name = "r", text = "", fg = "#2266ba" },
|
||||
{ name = "R", text = "", fg = "#2266ba" },
|
||||
{ name = "rake", text = "", fg = "#701516" },
|
||||
{ name = "rar", text = "", fg = "#eca517" },
|
||||
{ name = "razor", text = "", fg = "#512bd4" },
|
||||
|
|
@ -749,6 +788,7 @@ exts = [
|
|||
{ name = "rproj", text = "", fg = "#358a5b" },
|
||||
{ name = "rs", text = "", fg = "#dea584" },
|
||||
{ name = "rss", text = "", fg = "#fb9d3b" },
|
||||
{ name = "s", text = "", fg = "#0071c5" },
|
||||
{ name = "sass", text = "", fg = "#f55385" },
|
||||
{ name = "sbt", text = "", fg = "#cc3e44" },
|
||||
{ name = "sc", text = "", fg = "#cc3e44" },
|
||||
|
|
@ -762,21 +802,23 @@ exts = [
|
|||
{ name = "sha256", text = "", fg = "#8c86af" },
|
||||
{ name = "sha384", text = "", fg = "#8c86af" },
|
||||
{ name = "sha512", text = "", fg = "#8c86af" },
|
||||
{ name = "sig", text = "λ", fg = "#e37933" },
|
||||
{ name = "signature", text = "λ", fg = "#e37933" },
|
||||
{ name = "sig", text = "", fg = "#e37933" },
|
||||
{ name = "signature", text = "", fg = "#e37933" },
|
||||
{ name = "skp", text = "", fg = "#839463" },
|
||||
{ name = "sldasm", text = "", fg = "#839463" },
|
||||
{ name = "sldprt", text = "", fg = "#839463" },
|
||||
{ name = "slim", text = "", fg = "#e34c26" },
|
||||
{ name = "sln", text = "", fg = "#854cc7" },
|
||||
{ name = "slnx", text = "", fg = "#854cc7" },
|
||||
{ name = "slvs", text = "", fg = "#839463" },
|
||||
{ name = "sml", text = "λ", fg = "#e37933" },
|
||||
{ name = "sml", text = "", fg = "#e37933" },
|
||||
{ name = "so", text = "", fg = "#dcddd6" },
|
||||
{ name = "sol", text = "", fg = "#519aba" },
|
||||
{ name = "spec.js", text = "", fg = "#cbcb41" },
|
||||
{ name = "spec.jsx", text = "", fg = "#20c2e3" },
|
||||
{ name = "spec.ts", text = "", fg = "#519aba" },
|
||||
{ name = "spec.tsx", text = "", fg = "#1354bf" },
|
||||
{ name = "spx", text = "", fg = "#0075aa" },
|
||||
{ name = "sql", text = "", fg = "#dad8d8" },
|
||||
{ name = "sqlite", text = "", fg = "#dad8d8" },
|
||||
{ name = "sqlite3", text = "", fg = "#dad8d8" },
|
||||
|
|
@ -821,13 +863,15 @@ exts = [
|
|||
{ name = "twig", text = "", fg = "#8dc149" },
|
||||
{ name = "txt", text = "", fg = "#89e051" },
|
||||
{ name = "txz", text = "", fg = "#eca517" },
|
||||
{ name = "typ", text = "", fg = "#0dbcc0" },
|
||||
{ name = "typoscript", text = "", fg = "#ff8700" },
|
||||
{ name = "ui", text = "", fg = "#015bf0" },
|
||||
{ name = "v", text = "", fg = "#019833" },
|
||||
{ name = "vala", text = "", fg = "#7239b3" },
|
||||
{ name = "vala", text = "", fg = "#7b3db9" },
|
||||
{ name = "vh", text = "", fg = "#019833" },
|
||||
{ name = "vhd", text = "", fg = "#019833" },
|
||||
{ name = "vhdl", text = "", fg = "#019833" },
|
||||
{ name = "vi", text = "", fg = "#fec60a" },
|
||||
{ name = "vim", text = "", fg = "#019833" },
|
||||
{ name = "vsh", text = "", fg = "#5d87bf" },
|
||||
{ name = "vsix", text = "", fg = "#854cc7" },
|
||||
|
|
@ -877,9 +921,9 @@ conds = [
|
|||
{ if = "dummy", text = "" },
|
||||
|
||||
# Fallback
|
||||
{ if = "dir", text = "" },
|
||||
{ if = "exec", text = "" },
|
||||
{ if = "!dir", text = "" },
|
||||
{ if = "dir", text = "" },
|
||||
{ if = "exec", text = "" },
|
||||
{ if = "!dir", text = "" },
|
||||
]
|
||||
|
||||
# : }}}
|
||||
|
|
|
|||
|
|
@ -248,6 +248,8 @@ globs = []
|
|||
dirs = [
|
||||
{ name = ".config", text = "" },
|
||||
{ name = ".git", text = "" },
|
||||
{ name = ".github", text = "" },
|
||||
{ name = ".npm", text = "" },
|
||||
{ name = "Desktop", text = "" },
|
||||
{ name = "Development", text = "" },
|
||||
{ name = "Documents", text = "" },
|
||||
|
|
@ -263,6 +265,10 @@ files = [
|
|||
{ name = ".babelrc", text = "", fg = "#666620" },
|
||||
{ name = ".bash_profile", text = "", fg = "#447028" },
|
||||
{ name = ".bashrc", text = "", fg = "#447028" },
|
||||
{ name = ".clang-format", text = "", fg = "#526064" },
|
||||
{ name = ".clang-tidy", text = "", fg = "#526064" },
|
||||
{ name = ".codespellrc", text = "", fg = "#239140" },
|
||||
{ name = ".condarc", text = "", fg = "#2d751c" },
|
||||
{ name = ".dockerignore", text = "", fg = "#2e5f99" },
|
||||
{ name = ".ds_store", text = "", fg = "#41535b" },
|
||||
{ name = ".editorconfig", text = "", fg = "#333030" },
|
||||
|
|
@ -278,12 +284,15 @@ files = [
|
|||
{ name = ".gtkrc-2.0", text = "", fg = "#333333" },
|
||||
{ name = ".gvimrc", text = "", fg = "#017226" },
|
||||
{ name = ".justfile", text = "", fg = "#526064" },
|
||||
{ name = ".luacheckrc", text = "", fg = "#007abf" },
|
||||
{ name = ".luaurc", text = "", fg = "#007abf" },
|
||||
{ name = ".mailmap", text = "", fg = "#b83a1d" },
|
||||
{ name = ".nanorc", text = "", fg = "#440077" },
|
||||
{ name = ".npmignore", text = "", fg = "#ae1d38" },
|
||||
{ name = ".npmrc", text = "", fg = "#ae1d38" },
|
||||
{ name = ".nuxtrc", text = "", fg = "#00835f" },
|
||||
{ name = ".nvmrc", text = "", fg = "#3f6b34" },
|
||||
{ name = ".pre-commit-config.yaml", text = "", fg = "#7c5a12" },
|
||||
{ name = ".prettierignore", text = "", fg = "#3264b7" },
|
||||
{ name = ".prettierrc", text = "", fg = "#3264b7" },
|
||||
{ name = ".prettierrc.cjs", text = "", fg = "#3264b7" },
|
||||
|
|
@ -294,6 +303,7 @@ files = [
|
|||
{ name = ".prettierrc.toml", text = "", fg = "#3264b7" },
|
||||
{ name = ".prettierrc.yaml", text = "", fg = "#3264b7" },
|
||||
{ name = ".prettierrc.yml", text = "", fg = "#3264b7" },
|
||||
{ name = ".pylintrc", text = "", fg = "#526064" },
|
||||
{ name = ".settings.json", text = "", fg = "#643995" },
|
||||
{ name = ".SRCINFO", text = "", fg = "#0b6f9e" },
|
||||
{ name = ".vimrc", text = "", fg = "#017226" },
|
||||
|
|
@ -306,15 +316,17 @@ files = [
|
|||
{ name = ".zshrc", text = "", fg = "#447028" },
|
||||
{ name = "_gvimrc", text = "", fg = "#017226" },
|
||||
{ name = "_vimrc", text = "", fg = "#017226" },
|
||||
{ name = "avif", text = "", fg = "#6b4d83" },
|
||||
{ name = "AUTHORS", text = "", fg = "#6b4caa" },
|
||||
{ name = "AUTHORS.txt", text = "", fg = "#6b4caa" },
|
||||
{ name = "brewfile", text = "", fg = "#701516" },
|
||||
{ name = "bspwmrc", text = "", fg = "#2f2f2f" },
|
||||
{ name = "build", text = "", fg = "#447028" },
|
||||
{ name = "build.gradle", text = "", fg = "#005f87" },
|
||||
{ name = "build.zig.zon", text = "", fg = "#7b4d0e" },
|
||||
{ name = "bun.lockb", text = "", fg = "#4e4946" },
|
||||
{ name = "cantorrc", text = "", fg = "#1573b6" },
|
||||
{ name = "checkhealth", text = "", fg = "#3a5a7e" },
|
||||
{ name = "cmakelists.txt", text = "", fg = "#526064" },
|
||||
{ name = "cmakelists.txt", text = "", fg = "#2c2d2f" },
|
||||
{ name = "code_of_conduct", text = "", fg = "#ab104a" },
|
||||
{ name = "code_of_conduct.md", text = "", fg = "#ab104a" },
|
||||
{ name = "commit_editmsg", text = "", fg = "#b83a1d" },
|
||||
|
|
@ -326,6 +338,9 @@ files = [
|
|||
{ name = "containerfile", text = "", fg = "#2e5f99" },
|
||||
{ name = "copying", text = "", fg = "#666620" },
|
||||
{ name = "copying.lesser", text = "", fg = "#666620" },
|
||||
{ name = "Directory.Build.props", text = "", fg = "#007abf" },
|
||||
{ name = "Directory.Build.targets", text = "", fg = "#007abf" },
|
||||
{ name = "Directory.Packages.props", text = "", fg = "#007abf" },
|
||||
{ name = "docker-compose.yaml", text = "", fg = "#2e5f99" },
|
||||
{ name = "docker-compose.yml", text = "", fg = "#2e5f99" },
|
||||
{ name = "dockerfile", text = "", fg = "#2e5f99" },
|
||||
|
|
@ -338,7 +353,7 @@ files = [
|
|||
{ name = "fp-info-cache", text = "", fg = "#333333" },
|
||||
{ name = "fp-lib-table", text = "", fg = "#333333" },
|
||||
{ name = "FreeCAD.conf", text = "", fg = "#98262c" },
|
||||
{ name = "gemfile$", text = "", fg = "#701516" },
|
||||
{ name = "Gemfile", text = "", fg = "#701516" },
|
||||
{ name = "gnumakefile", text = "", fg = "#526064" },
|
||||
{ name = "go.mod", text = "", fg = "#36677c" },
|
||||
{ name = "go.sum", text = "", fg = "#36677c" },
|
||||
|
|
@ -364,6 +379,7 @@ files = [
|
|||
{ name = "i18n.config.ts", text = "", fg = "#515987" },
|
||||
{ name = "i3blocks.conf", text = "", fg = "#2e2f30" },
|
||||
{ name = "i3status.conf", text = "", fg = "#2e2f30" },
|
||||
{ name = "index.theme", text = "", fg = "#1e7b4a" },
|
||||
{ name = "ionic.config.json", text = "", fg = "#355fa5" },
|
||||
{ name = "justfile", text = "", fg = "#526064" },
|
||||
{ name = "kalgebrarc", text = "", fg = "#1573b6" },
|
||||
|
|
@ -399,6 +415,8 @@ files = [
|
|||
{ name = "py.typed", text = "", fg = "#805e02" },
|
||||
{ name = "QtProject.conf", text = "", fg = "#2b8937" },
|
||||
{ name = "rakefile", text = "", fg = "#701516" },
|
||||
{ name = "readme", text = "", fg = "#2f2f2f" },
|
||||
{ name = "readme.md", text = "", fg = "#2f2f2f" },
|
||||
{ name = "rmd", text = "", fg = "#36677c" },
|
||||
{ name = "robots.txt", text = "", fg = "#465470" },
|
||||
{ name = "security", text = "", fg = "#3f4143" },
|
||||
|
|
@ -414,8 +432,8 @@ files = [
|
|||
{ name = "tmux.conf.local", text = "", fg = "#0f8c13" },
|
||||
{ name = "tsconfig.json", text = "", fg = "#36677c" },
|
||||
{ name = "unlicense", text = "", fg = "#686020" },
|
||||
{ name = "vagrantfile$", text = "", fg = "#104abf" },
|
||||
{ name = "vercel.json", text = "▲", fg = "#333333" },
|
||||
{ name = "vagrantfile", text = "", fg = "#104abf" },
|
||||
{ name = "vercel.json", text = "", fg = "#333333" },
|
||||
{ name = "vlcrc", text = "", fg = "#9f5100" },
|
||||
{ name = "webpack", text = "", fg = "#36677c" },
|
||||
{ name = "weston.ini", text = "", fg = "#805e00" },
|
||||
|
|
@ -432,18 +450,22 @@ exts = [
|
|||
{ name = "7z", text = "", fg = "#76520c" },
|
||||
{ name = "a", text = "", fg = "#494a47" },
|
||||
{ name = "aac", text = "", fg = "#0075aa" },
|
||||
{ name = "adb", text = "", fg = "#118080" },
|
||||
{ name = "ads", text = "", fg = "#333333" },
|
||||
{ name = "ai", text = "", fg = "#666620" },
|
||||
{ name = "aif", text = "", fg = "#0075aa" },
|
||||
{ name = "aiff", text = "", fg = "#0075aa" },
|
||||
{ name = "android", text = "", fg = "#277e3e" },
|
||||
{ name = "ape", text = "", fg = "#0075aa" },
|
||||
{ name = "apk", text = "", fg = "#277e3e" },
|
||||
{ name = "apl", text = "⍝", fg = "#805200" },
|
||||
{ name = "apl", text = "", fg = "#1b7936" },
|
||||
{ name = "app", text = "", fg = "#9f0500" },
|
||||
{ name = "applescript", text = "", fg = "#526064" },
|
||||
{ name = "asc", text = "", fg = "#41525f" },
|
||||
{ name = "asm", text = "", fg = "#006d8e" },
|
||||
{ name = "ass", text = "", fg = "#805c0a" },
|
||||
{ name = "astro", text = "", fg = "#aa2f4d" },
|
||||
{ name = "avif", text = "", fg = "#6b4d83" },
|
||||
{ name = "awk", text = "", fg = "#3a4446" },
|
||||
{ name = "azcli", text = "", fg = "#005a9f" },
|
||||
{ name = "bak", text = "", fg = "#526064" },
|
||||
|
|
@ -458,7 +480,7 @@ exts = [
|
|||
{ name = "blend", text = "", fg = "#9c4f00" },
|
||||
{ name = "blp", text = "", fg = "#3a6497" },
|
||||
{ name = "bmp", text = "", fg = "#6b4d83" },
|
||||
{ name = "bqn", text = "⎉", fg = "#20544d" },
|
||||
{ name = "bqn", text = "", fg = "#1b7936" },
|
||||
{ name = "brep", text = "", fg = "#576342" },
|
||||
{ name = "bz", text = "", fg = "#76520c" },
|
||||
{ name = "bz2", text = "", fg = "#76520c" },
|
||||
|
|
@ -468,7 +490,7 @@ exts = [
|
|||
{ name = "c++", text = "", fg = "#a23253" },
|
||||
{ name = "cache", text = "", fg = "#333333" },
|
||||
{ name = "cast", text = "", fg = "#7e4c10" },
|
||||
{ name = "cbl", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cbl", text = "", fg = "#005ca5" },
|
||||
{ name = "cc", text = "", fg = "#a23253" },
|
||||
{ name = "ccm", text = "", fg = "#a23253" },
|
||||
{ name = "cfg", text = "", fg = "#526064" },
|
||||
|
|
@ -477,17 +499,18 @@ exts = [
|
|||
{ name = "cljc", text = "", fg = "#466024" },
|
||||
{ name = "cljd", text = "", fg = "#36677c" },
|
||||
{ name = "cljs", text = "", fg = "#36677c" },
|
||||
{ name = "cmake", text = "", fg = "#526064" },
|
||||
{ name = "cob", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cobol", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cmake", text = "", fg = "#2c2d2f" },
|
||||
{ name = "cob", text = "", fg = "#005ca5" },
|
||||
{ name = "cobol", text = "", fg = "#005ca5" },
|
||||
{ name = "coffee", text = "", fg = "#666620" },
|
||||
{ name = "conda", text = "", fg = "#2d751c" },
|
||||
{ name = "conf", text = "", fg = "#526064" },
|
||||
{ name = "config.ru", text = "", fg = "#701516" },
|
||||
{ name = "cow", text = "", fg = "#70421b" },
|
||||
{ name = "cp", text = "", fg = "#36677c" },
|
||||
{ name = "cpp", text = "", fg = "#36677c" },
|
||||
{ name = "cppm", text = "", fg = "#36677c" },
|
||||
{ name = "cpy", text = "⚙", fg = "#005ca5" },
|
||||
{ name = "cpy", text = "", fg = "#005ca5" },
|
||||
{ name = "cr", text = "", fg = "#434343" },
|
||||
{ name = "crdownload", text = "", fg = "#226654" },
|
||||
{ name = "cs", text = "", fg = "#434d04" },
|
||||
|
|
@ -503,7 +526,7 @@ exts = [
|
|||
{ name = "cuh", text = "", fg = "#6b4d83" },
|
||||
{ name = "cxx", text = "", fg = "#36677c" },
|
||||
{ name = "cxxm", text = "", fg = "#36677c" },
|
||||
{ name = "d", text = "", fg = "#325a13" },
|
||||
{ name = "d", text = "", fg = "#842b25" },
|
||||
{ name = "d.ts", text = "", fg = "#6a4c2a" },
|
||||
{ name = "dart", text = "", fg = "#03589c" },
|
||||
{ name = "db", text = "", fg = "#494848" },
|
||||
|
|
@ -559,6 +582,10 @@ exts = [
|
|||
{ name = "flc", text = "", fg = "#2f2f2f" },
|
||||
{ name = "flf", text = "", fg = "#2f2f2f" },
|
||||
{ name = "fnl", text = "", fg = "#33312b" },
|
||||
{ name = "fodg", text = "", fg = "#333211" },
|
||||
{ name = "fodp", text = "", fg = "#7f4e22" },
|
||||
{ name = "fods", text = "", fg = "#28541a" },
|
||||
{ name = "fodt", text = "", fg = "#16667e" },
|
||||
{ name = "fs", text = "", fg = "#36677c" },
|
||||
{ name = "fsi", text = "", fg = "#36677c" },
|
||||
{ name = "fsscript", text = "", fg = "#36677c" },
|
||||
|
|
@ -573,6 +600,7 @@ exts = [
|
|||
{ name = "gnumakefile", text = "", fg = "#526064" },
|
||||
{ name = "go", text = "", fg = "#36677c" },
|
||||
{ name = "godot", text = "", fg = "#526064" },
|
||||
{ name = "gpr", text = "", fg = "#aa22aa" },
|
||||
{ name = "gql", text = "", fg = "#ac2880" },
|
||||
{ name = "gradle", text = "", fg = "#005f87" },
|
||||
{ name = "graphql", text = "", fg = "#ac2880" },
|
||||
|
|
@ -610,7 +638,7 @@ exts = [
|
|||
{ name = "info", text = "", fg = "#333329" },
|
||||
{ name = "ini", text = "", fg = "#526064" },
|
||||
{ name = "ino", text = "", fg = "#397981" },
|
||||
{ name = "ipynb", text = "", fg = "#366b8a" },
|
||||
{ name = "ipynb", text = "", fg = "#a35301" },
|
||||
{ name = "iso", text = "", fg = "#453f43" },
|
||||
{ name = "ixx", text = "", fg = "#36677c" },
|
||||
{ name = "java", text = "", fg = "#992e33" },
|
||||
|
|
@ -666,7 +694,7 @@ exts = [
|
|||
{ name = "magnet", text = "", fg = "#a51b16" },
|
||||
{ name = "makefile", text = "", fg = "#526064" },
|
||||
{ name = "markdown", text = "", fg = "#4a4a4a" },
|
||||
{ name = "material", text = "", fg = "#8a2b72" },
|
||||
{ name = "material", text = "", fg = "#8a2b72" },
|
||||
{ name = "md", text = "", fg = "#4a4a4a" },
|
||||
{ name = "md5", text = "", fg = "#5d5975" },
|
||||
{ name = "mdx", text = "", fg = "#36677c" },
|
||||
|
|
@ -677,7 +705,7 @@ exts = [
|
|||
{ name = "ml", text = "", fg = "#975122" },
|
||||
{ name = "mli", text = "", fg = "#975122" },
|
||||
{ name = "mm", text = "", fg = "#36677c" },
|
||||
{ name = "mo", text = "∞", fg = "#654ca7" },
|
||||
{ name = "mo", text = "", fg = "#654ca7" },
|
||||
{ name = "mobi", text = "", fg = "#755836" },
|
||||
{ name = "mojo", text = "", fg = "#bf3917" },
|
||||
{ name = "mov", text = "", fg = "#7e4c10" },
|
||||
|
|
@ -690,11 +718,21 @@ exts = [
|
|||
{ name = "nfo", text = "", fg = "#333329" },
|
||||
{ name = "nim", text = "", fg = "#514700" },
|
||||
{ name = "nix", text = "", fg = "#3f5d72" },
|
||||
{ name = "norg", text = "", fg = "#365a8e" },
|
||||
{ name = "nswag", text = "", fg = "#427516" },
|
||||
{ name = "nu", text = ">", fg = "#276f4e" },
|
||||
{ name = "nu", text = "", fg = "#276f4e" },
|
||||
{ name = "o", text = "", fg = "#9f0500" },
|
||||
{ name = "obj", text = "", fg = "#5b5b5b" },
|
||||
{ name = "odf", text = "", fg = "#aa3c64" },
|
||||
{ name = "odg", text = "", fg = "#333211" },
|
||||
{ name = "odin", text = "", fg = "#2a629e" },
|
||||
{ name = "odp", text = "", fg = "#7f4e22" },
|
||||
{ name = "ods", text = "", fg = "#28541a" },
|
||||
{ name = "odt", text = "", fg = "#16667e" },
|
||||
{ name = "oga", text = "", fg = "#005880" },
|
||||
{ name = "ogg", text = "", fg = "#005880" },
|
||||
{ name = "ogv", text = "", fg = "#7e4c10" },
|
||||
{ name = "ogx", text = "", fg = "#7e4c10" },
|
||||
{ name = "opus", text = "", fg = "#005880" },
|
||||
{ name = "org", text = "", fg = "#4f7166" },
|
||||
{ name = "otf", text = "", fg = "#2f2f2f" },
|
||||
|
|
@ -714,6 +752,7 @@ exts = [
|
|||
{ name = "pot", text = "", fg = "#1c708e" },
|
||||
{ name = "pp", text = "", fg = "#80530d" },
|
||||
{ name = "ppt", text = "", fg = "#983826" },
|
||||
{ name = "pptx", text = "", fg = "#983826" },
|
||||
{ name = "prisma", text = "", fg = "#444da2" },
|
||||
{ name = "pro", text = "", fg = "#725c2a" },
|
||||
{ name = "ps1", text = "", fg = "#325698" },
|
||||
|
|
@ -736,8 +775,8 @@ exts = [
|
|||
{ name = "qrc", text = "", fg = "#2b8937" },
|
||||
{ name = "qss", text = "", fg = "#2b8937" },
|
||||
{ name = "query", text = "", fg = "#607035" },
|
||||
{ name = "R", text = "", fg = "#1a4c8c" },
|
||||
{ name = "r", text = "", fg = "#1a4c8c" },
|
||||
{ name = "R", text = "", fg = "#1a4c8c" },
|
||||
{ name = "rake", text = "", fg = "#701516" },
|
||||
{ name = "rar", text = "", fg = "#76520c" },
|
||||
{ name = "razor", text = "", fg = "#512bd4" },
|
||||
|
|
@ -749,6 +788,7 @@ exts = [
|
|||
{ name = "rproj", text = "", fg = "#286844" },
|
||||
{ name = "rs", text = "", fg = "#6f5242" },
|
||||
{ name = "rss", text = "", fg = "#7e4e1e" },
|
||||
{ name = "s", text = "", fg = "#005594" },
|
||||
{ name = "sass", text = "", fg = "#a33759" },
|
||||
{ name = "sbt", text = "", fg = "#992e33" },
|
||||
{ name = "sc", text = "", fg = "#992e33" },
|
||||
|
|
@ -762,21 +802,23 @@ exts = [
|
|||
{ name = "sha256", text = "", fg = "#5d5975" },
|
||||
{ name = "sha384", text = "", fg = "#5d5975" },
|
||||
{ name = "sha512", text = "", fg = "#5d5975" },
|
||||
{ name = "sig", text = "λ", fg = "#975122" },
|
||||
{ name = "signature", text = "λ", fg = "#975122" },
|
||||
{ name = "sig", text = "", fg = "#975122" },
|
||||
{ name = "signature", text = "", fg = "#975122" },
|
||||
{ name = "skp", text = "", fg = "#576342" },
|
||||
{ name = "sldasm", text = "", fg = "#576342" },
|
||||
{ name = "sldprt", text = "", fg = "#576342" },
|
||||
{ name = "slim", text = "", fg = "#aa391c" },
|
||||
{ name = "sln", text = "", fg = "#643995" },
|
||||
{ name = "slnx", text = "", fg = "#643995" },
|
||||
{ name = "slvs", text = "", fg = "#576342" },
|
||||
{ name = "sml", text = "λ", fg = "#975122" },
|
||||
{ name = "sml", text = "", fg = "#975122" },
|
||||
{ name = "so", text = "", fg = "#494a47" },
|
||||
{ name = "sol", text = "", fg = "#36677c" },
|
||||
{ name = "spec.js", text = "", fg = "#666620" },
|
||||
{ name = "spec.jsx", text = "", fg = "#158197" },
|
||||
{ name = "spec.ts", text = "", fg = "#36677c" },
|
||||
{ name = "spec.tsx", text = "", fg = "#1354bf" },
|
||||
{ name = "spx", text = "", fg = "#005880" },
|
||||
{ name = "sql", text = "", fg = "#494848" },
|
||||
{ name = "sqlite", text = "", fg = "#494848" },
|
||||
{ name = "sqlite3", text = "", fg = "#494848" },
|
||||
|
|
@ -821,13 +863,15 @@ exts = [
|
|||
{ name = "twig", text = "", fg = "#466024" },
|
||||
{ name = "txt", text = "", fg = "#447028" },
|
||||
{ name = "txz", text = "", fg = "#76520c" },
|
||||
{ name = "typ", text = "", fg = "#097d80" },
|
||||
{ name = "typoscript", text = "", fg = "#aa5a00" },
|
||||
{ name = "ui", text = "", fg = "#015bf0" },
|
||||
{ name = "v", text = "", fg = "#017226" },
|
||||
{ name = "vala", text = "", fg = "#562b86" },
|
||||
{ name = "vala", text = "", fg = "#5c2e8b" },
|
||||
{ name = "vh", text = "", fg = "#017226" },
|
||||
{ name = "vhd", text = "", fg = "#017226" },
|
||||
{ name = "vhdl", text = "", fg = "#017226" },
|
||||
{ name = "vi", text = "", fg = "#554203" },
|
||||
{ name = "vim", text = "", fg = "#017226" },
|
||||
{ name = "vsh", text = "", fg = "#3e5a7f" },
|
||||
{ name = "vsix", text = "", fg = "#643995" },
|
||||
|
|
@ -877,9 +921,9 @@ conds = [
|
|||
{ if = "dummy", text = "" },
|
||||
|
||||
# Fallback
|
||||
{ if = "dir", text = "" },
|
||||
{ if = "exec", text = "" },
|
||||
{ if = "!dir", text = "" },
|
||||
{ if = "dir", text = "" },
|
||||
{ if = "exec", text = "" },
|
||||
{ if = "!dir", text = "" },
|
||||
]
|
||||
|
||||
# : }}}
|
||||
|
|
|
|||
|
|
@ -21,13 +21,9 @@ impl FilesSorter {
|
|||
|
||||
let by_alphabetical = |a: &File, b: &File| {
|
||||
if self.sensitive {
|
||||
self.cmp(a.name(), b.name(), self.promote(a, b))
|
||||
self.cmp(a.urn().encoded_bytes(), b.urn().encoded_bytes(), self.promote(a, b))
|
||||
} else {
|
||||
self.cmp_insensitive(
|
||||
a.name().as_encoded_bytes(),
|
||||
b.name().as_encoded_bytes(),
|
||||
self.promote(a, b),
|
||||
)
|
||||
self.cmp_insensitive(a.urn().encoded_bytes(), b.urn().encoded_bytes(), self.promote(a, b))
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -80,12 +76,12 @@ impl FilesSorter {
|
|||
|
||||
let ordering = if self.translit {
|
||||
natsort(
|
||||
a.name().as_encoded_bytes().transliterate().as_bytes(),
|
||||
b.name().as_encoded_bytes().transliterate().as_bytes(),
|
||||
a.urn().encoded_bytes().transliterate().as_bytes(),
|
||||
b.urn().encoded_bytes().transliterate().as_bytes(),
|
||||
!self.sensitive,
|
||||
)
|
||||
} else {
|
||||
natsort(a.name().as_encoded_bytes(), b.name().as_encoded_bytes(), !self.sensitive)
|
||||
natsort(a.urn().encoded_bytes(), b.urn().encoded_bytes(), !self.sensitive)
|
||||
};
|
||||
|
||||
if self.reverse { ordering.reverse() } else { ordering }
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ function Entity:found()
|
|||
local found = self._file:found()
|
||||
if not found then
|
||||
return ""
|
||||
elseif found[1] >= 99 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return ui.Line {
|
||||
" ",
|
||||
ui.Span(string.format("[%d/%d]", found[1] + 1, found[2])):style(THEME.manager.find_position),
|
||||
}
|
||||
local s = string.format("[%d/%s]", found[1] + 1, found[2] >= 100 and "99+" or found[2])
|
||||
return ui.Line { " ", ui.Span(s):style(THEME.manager.find_position) }
|
||||
end
|
||||
|
||||
function Entity:symlink()
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ impl Loader {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
// TODO: init.lua
|
||||
let p = BOOT.plugin_dir.join(format!("{name}.yazi/init.lua"));
|
||||
let chunk =
|
||||
fs::read(&p).await.with_context(|| format!("Failed to load plugin from {p:?}"))?.into();
|
||||
|
|
|
|||
|
|
@ -32,20 +32,7 @@ impl TryFrom<CmdCow> for PluginOpt {
|
|||
Default::default()
|
||||
};
|
||||
|
||||
let mut mode = c.str("mode").map(Into::into).unwrap_or_default();
|
||||
if c.bool("sync") {
|
||||
mode = PluginMode::Sync;
|
||||
let s = "The `--sync` option for the `plugin` command has been deprecated in Yazi v0.4.
|
||||
|
||||
Please add `--- @sync entry` metadata at the head of your `{id}` plugin instead. See #1891 for details: https://github.com/sxyazi/yazi/pull/1891";
|
||||
crate::AppProxy::notify(crate::options::NotifyOpt {
|
||||
title: "Deprecated API".to_owned(),
|
||||
content: s.replace("{id}", &id),
|
||||
level: crate::options::NotifyLevel::Warn,
|
||||
timeout: std::time::Duration::from_secs(20),
|
||||
});
|
||||
}
|
||||
|
||||
let mode = c.str("mode").map(Into::into).unwrap_or_default();
|
||||
Ok(Self { id, args, mode, cb: c.take_any("callback") })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,18 +145,18 @@ mod tests {
|
|||
#[test]
|
||||
fn test_from() {
|
||||
let loc = Loc::from(Path::new("/"), "/".into());
|
||||
assert_eq!(loc.urn(), Urn::new(""));
|
||||
assert_eq!(loc.urn().as_os_str(), OsStr::new(""));
|
||||
assert_eq!(loc.name(), OsStr::new(""));
|
||||
assert_eq!(loc.base(), Path::new("/"));
|
||||
assert_eq!(loc.base().as_os_str(), OsStr::new("/"));
|
||||
|
||||
let loc = Loc::from(Path::new("/root/"), "/root/code/".into());
|
||||
assert_eq!(loc.urn(), Urn::new("code"));
|
||||
assert_eq!(loc.urn().as_os_str(), OsStr::new("code"));
|
||||
assert_eq!(loc.name(), OsStr::new("code"));
|
||||
assert_eq!(loc.base(), Path::new("/root"));
|
||||
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
||||
|
||||
let loc = Loc::from(Path::new("/root//"), "/root/code/foo//".into());
|
||||
assert_eq!(loc.urn(), Urn::new("code/foo"));
|
||||
assert_eq!(loc.urn().as_os_str(), OsStr::new("code/foo"));
|
||||
assert_eq!(loc.name(), OsStr::new("foo"));
|
||||
assert_eq!(loc.base(), Path::new("/root"));
|
||||
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ impl Urn {
|
|||
#[inline]
|
||||
pub fn name(&self) -> Option<&OsStr> { self.0.file_name() }
|
||||
|
||||
#[inline]
|
||||
pub fn encoded_bytes(&self) -> &[u8] { self.0.as_os_str().as_encoded_bytes() }
|
||||
|
||||
#[cfg(unix)]
|
||||
#[inline]
|
||||
pub fn is_hidden(&self) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue