aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/keymap.md2
-rw-r--r--helix-term/src/main.rs23
-rw-r--r--shell.nix6
3 files changed, 15 insertions, 16 deletions
diff --git a/book/src/keymap.md b/book/src/keymap.md
index 9c8c23d6..43e623a2 100644
--- a/book/src/keymap.md
+++ b/book/src/keymap.md
@@ -118,7 +118,7 @@ Jumps to various locations.
|-----|-----------|
| g | Go to the start of the file |
| e | Go to the end of the file |
-| e | Go to definition |
+| d | Go to definition |
| t | Go to type definition |
| r | Go to references |
| i | Go to implementation |
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs
index ac060bbe..e3304312 100644
--- a/helix-term/src/main.rs
+++ b/helix-term/src/main.rs
@@ -10,9 +10,9 @@ use application::Application;
use std::path::PathBuf;
-use anyhow::Error;
+use anyhow::{Context, Result};
-fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
+fn setup_logging(verbosity: u64) -> Result<()> {
let mut base_config = fern::Dispatch::new();
// Let's say we depend on something which whose "info" level messages are too
@@ -27,7 +27,7 @@ fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
_3_or_more => base_config.level(log::LevelFilter::Trace),
};
- let home = dirs_next::home_dir().expect("can't find the home directory");
+ let home = dirs_next::home_dir().context("can't find the home directory")?;
// Separate file config so we can include year, month and day in file logs
let file_config = fern::Dispatch::new()
@@ -51,7 +51,7 @@ pub struct Args {
files: Vec<PathBuf>,
}
-fn main() {
+fn main() -> Result<()> {
let help = format!(
"\
{} {}
@@ -89,7 +89,7 @@ FLAGS:
verbosity = 1;
}
- setup_logging(verbosity).expect("failed to initialize logging.");
+ setup_logging(verbosity).context("failed to initialize logging")?;
let args = Args {
files: pargs.finish().into_iter().map(|arg| arg.into()).collect(),
@@ -105,17 +105,16 @@ FLAGS:
.as_deref()
.unwrap_or(include_bytes!("../../languages.toml"));
- LOADER.get_or_init(|| {
- let config = toml::from_slice(toml).expect("Could not parse languages.toml");
- Loader::new(config)
- });
+ let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
+ LOADER.get_or_init(|| Loader::new(config));
- let runtime = tokio::runtime::Runtime::new().unwrap();
+ let runtime = tokio::runtime::Runtime::new().context("unable to start tokio runtime")?;
// TODO: use the thread local executor to spawn the application task separately from the work pool
+ let mut app = Application::new(args).context("unable to create new appliction")?;
runtime.block_on(async move {
- let mut app = Application::new(args).unwrap();
-
app.run().await;
});
+
+ Ok(())
}
diff --git a/shell.nix b/shell.nix
index b6274581..180e8957 100644
--- a/shell.nix
+++ b/shell.nix
@@ -12,7 +12,7 @@ pkgs.mkShell {
# https://github.com/rust-lang/rust/issues/55979
LD_LIBRARY_PATH="${stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH";
- # HELIX_RUNTIME=./runtime;
- HELIX_RUNTIME="/home/speed/src/helix/runtime";
+ shellHook = ''
+ export HELIX_RUNTIME=$PWD/runtime
+ '';
}
-