New package: helix-22.03
This commit is contained in:
parent
faf4e6e199
commit
41d213902c
3 changed files with 138 additions and 0 deletions
2
srcpkgs/helix/files/hx
Normal file
2
srcpkgs/helix/files/hx
Normal file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
HELIX_RUNTIME=/usr/lib/helix/runtime exec /usr/lib/helix/hx "$@"
|
|
@ -0,0 +1,104 @@
|
|||
From f2dd3d446914ec0953cd7e056d430fc3b959e75d Mon Sep 17 00:00:00 2001
|
||||
From: Marcin Puc <tranzystorek.io@protonmail.com>
|
||||
Date: Wed, 30 Mar 2022 02:08:30 +0200
|
||||
Subject: [PATCH] Avoid using the format ident Rust feature (#1881)
|
||||
|
||||
---
|
||||
helix-loader/src/grammar.rs | 14 +++++++++-----
|
||||
helix-term/src/commands/typed.rs | 4 ++--
|
||||
helix-term/src/health.rs | 9 +++++----
|
||||
3 files changed, 16 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs
|
||||
index 299a06bf..f0c5ea28 100644
|
||||
--- a/helix-loader/src/grammar.rs
|
||||
+++ b/helix-loader/src/grammar.rs
|
||||
@@ -63,12 +63,12 @@ pub fn get_language(name: &str) -> Result<Language> {
|
||||
library_path.set_extension(DYLIB_EXTENSION);
|
||||
|
||||
let library = unsafe { Library::new(&library_path) }
|
||||
- .with_context(|| format!("Error opening dynamic library {library_path:?}"))?;
|
||||
+ .with_context(|| format!("Error opening dynamic library {:?}", library_path))?;
|
||||
let language_fn_name = format!("tree_sitter_{}", name.replace('-', "_"));
|
||||
let language = unsafe {
|
||||
let language_fn: Symbol<unsafe extern "C" fn() -> Language> = library
|
||||
.get(language_fn_name.as_bytes())
|
||||
- .with_context(|| format!("Failed to load symbol {language_fn_name}"))?;
|
||||
+ .with_context(|| format!("Failed to load symbol {}", language_fn_name))?;
|
||||
language_fn()
|
||||
};
|
||||
std::mem::forget(library);
|
||||
@@ -133,7 +133,7 @@ where
|
||||
// TODO: print all failures instead of the first one found.
|
||||
rx.iter()
|
||||
.find(|result| result.is_err())
|
||||
- .map(|err| err.with_context(|| format!("Failed to {action} some grammar(s)")))
|
||||
+ .map(|err| err.with_context(|| format!("Failed to {} some grammar(s)", action)))
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
|
||||
@@ -238,12 +238,16 @@ fn build_grammar(grammar: GrammarConfiguration) -> Result<()> {
|
||||
};
|
||||
|
||||
let grammar_dir_entries = grammar_dir.read_dir().with_context(|| {
|
||||
- format!("Failed to read directory {grammar_dir:?}. Did you use 'hx --grammar fetch'?")
|
||||
+ format!(
|
||||
+ "Failed to read directory {:?}. Did you use 'hx --grammar fetch'?",
|
||||
+ grammar_dir
|
||||
+ )
|
||||
})?;
|
||||
|
||||
if grammar_dir_entries.count() == 0 {
|
||||
return Err(anyhow!(
|
||||
- "Directory {grammar_dir:?} is empty. Did you use 'hx --grammar fetch'?"
|
||||
+ "Directory {:?} is empty. Did you use 'hx --grammar fetch'?",
|
||||
+ grammar_dir
|
||||
));
|
||||
};
|
||||
|
||||
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
|
||||
index 8b7f481b..c921f85b 100644
|
||||
--- a/helix-term/src/commands/typed.rs
|
||||
+++ b/helix-term/src/commands/typed.rs
|
||||
@@ -891,8 +891,8 @@ fn setting(
|
||||
}
|
||||
let (key, arg) = (&args[0].to_lowercase(), &args[1]);
|
||||
|
||||
- let key_error = || anyhow::anyhow!("Unknown key `{key}`");
|
||||
- let field_error = |_| anyhow::anyhow!("Could not parse field `{arg}`");
|
||||
+ let key_error = || anyhow::anyhow!("Unknown key `{}`", key);
|
||||
+ let field_error = |_| anyhow::anyhow!("Could not parse field `{}`", arg);
|
||||
|
||||
let mut config = serde_json::to_value(&cx.editor.config().clone()).unwrap();
|
||||
let pointer = format!("/{}", key.replace('.', "/"));
|
||||
diff --git a/helix-term/src/health.rs b/helix-term/src/health.rs
|
||||
index f13d35f0..2a02e118 100644
|
||||
--- a/helix-term/src/health.rs
|
||||
+++ b/helix-term/src/health.rs
|
||||
@@ -89,10 +89,11 @@ pub fn languages_all() {
|
||||
|
||||
let column = |item: &str, color: Color| {
|
||||
let data = format!(
|
||||
- "{:column_width$}",
|
||||
+ "{:width$}",
|
||||
item.get(..column_width - 2)
|
||||
- .map(|s| format!("{s}…"))
|
||||
- .unwrap_or_else(|| item.to_string())
|
||||
+ .map(|s| format!("{}…", s))
|
||||
+ .unwrap_or_else(|| item.to_string()),
|
||||
+ width = column_width,
|
||||
)
|
||||
.stylize()
|
||||
.with(color);
|
||||
@@ -158,7 +159,7 @@ pub fn language(lang_str: String) {
|
||||
{
|
||||
Some(l) => l,
|
||||
None => {
|
||||
- let msg = format!("Language '{lang_str}' not found");
|
||||
+ let msg = format!("Language '{}' not found", lang_str);
|
||||
println!("{}", msg.red());
|
||||
let suggestions: Vec<&str> = syn_loader_conf
|
||||
.language
|
||||
--
|
||||
2.35.1
|
||||
|
32
srcpkgs/helix/template
Normal file
32
srcpkgs/helix/template
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Template file for 'helix'
|
||||
pkgname=helix
|
||||
version=22.03
|
||||
revision=1
|
||||
build_style=cargo
|
||||
make_install_args="--path helix-term"
|
||||
hostmakedepends="git"
|
||||
short_desc="Post-modern modal text editor"
|
||||
maintainer="Marcin Puc <tranzystorek.io@protonmail.com>"
|
||||
license="MPL-2.0"
|
||||
homepage="https://helix-editor.com/"
|
||||
changelog="https://github.com/helix-editor/helix/blob/master/CHANGELOG.md"
|
||||
distfiles="https://github.com/helix-editor/helix/archive/${version}.tar.gz"
|
||||
checksum=a21f4d7b6390930a89b59567909ad7c613a1eeeafc813167ff7bc3be603997f4
|
||||
conflicts="hex>=0"
|
||||
|
||||
# skip problematic doctests on i686
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
i686*) make_check_args="-- --skip src/";;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
post_install() {
|
||||
rm runtime/grammars/.gitkeep
|
||||
rm runtime/themes/README.md
|
||||
rm -rf runtime/grammars/sources
|
||||
|
||||
vmkdir usr/lib/helix
|
||||
mv ${DESTDIR}/usr/bin/hx ${DESTDIR}/usr/lib/helix/
|
||||
vcopy runtime usr/lib/helix
|
||||
vbin ${FILESDIR}/hx
|
||||
}
|
Loading…
Reference in a new issue