aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
authorPabloMansanet2021-06-17 11:08:05 +0000
committerGitHub2021-06-17 11:08:05 +0000
commitf7e00cf720f55ea82933ac6625b7511e9d38139e (patch)
treedc8278b34332eebea8b137d15cca9e5fb08b2b06 /helix-term/src/application.rs
parent47d2e3aefa5d31c19e7def624057a29c4bc7bc41 (diff)
Configurable keys 2 (Mapping keys to commands) (#268)
* Add convenience/clarity wrapper for Range initialization * Add keycode parse and display methods * Add remapping functions and tests * Implement key remapping * Add remapping book entry * Use raw string literal for toml * Add command constants * Make command functions private * Map directly to commands * Match key parsing/displaying to Kakoune * Formatting pass * Update documentation * Formatting * Fix example in the book * Refactor into single config file * Formatting * Refactor configuration and add keymap newtype wrappers * Address first batch of PR comments * Replace FromStr with custom deserialize
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 3d043441..f5cba365 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -1,7 +1,7 @@
use helix_lsp::lsp;
use helix_view::{document::Mode, Document, Editor, Theme, View};
-use crate::{args::Args, compositor::Compositor, ui};
+use crate::{args::Args, compositor::Compositor, config::Config, keymap::Keymaps, ui};
use log::{error, info};
@@ -40,13 +40,14 @@ pub struct Application {
}
impl Application {
- pub fn new(mut args: Args) -> Result<Self, Error> {
+ pub fn new(mut args: Args, config: Config) -> Result<Self, Error> {
use helix_view::editor::Action;
let mut compositor = Compositor::new()?;
let size = compositor.size();
let mut editor = Editor::new(size);
- compositor.push(Box::new(ui::EditorView::new()));
+ let mut editor_view = Box::new(ui::EditorView::new(config.keymaps));
+ compositor.push(editor_view);
if !args.files.is_empty() {
let first = &args.files[0]; // we know it's not empty