Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ l3ine = "l3ine"
4should = "4should"
wr5ap = "wr5ap"
ine = "ine"
worl = "worl"
9 changes: 9 additions & 0 deletions examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ fn main() -> reedline::Result<()> {
];
let completer = Box::new(DefaultCompleter::new_with_wordlen(commands.clone(), 2));

#[cfg(feature = "helix")]
let cursor_config = CursorConfig {
vi_insert: Some(SetCursorStyle::BlinkingBar),
vi_normal: Some(SetCursorStyle::SteadyBlock),
emacs: None,
..CursorConfig::default()
};

#[cfg(not(feature = "helix"))]
let cursor_config = CursorConfig {
vi_insert: Some(SetCursorStyle::BlinkingBar),
vi_normal: Some(SetCursorStyle::SteadyBlock),
Expand Down
9 changes: 5 additions & 4 deletions examples/helix.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Create a reedline object with the experimental Helix edit mode.
// Create a reedline object with the full experimental Helix edit mode.
// cargo run --example helix --features helix
//
// The current Helix example maps Ctrl-D to exit and uses the default prompt,
// which renders the active custom mode indicator as "(helix)".
// This example uses the public Helix mode exported by the crate, including
// Select mode and the extended normal-mode command set. The default prompt
// renders the active Helix mode indicator.

use reedline::{DefaultPrompt, Helix, Reedline, Signal};
use std::io;
Expand All @@ -11,7 +12,7 @@ fn main() -> io::Result<()> {
println!("Helix edit mode demo:\nAbort with Ctrl-C");

let prompt = DefaultPrompt::default();
let mut line_editor = Reedline::create().with_edit_mode(Box::new(Helix));
let mut line_editor = Reedline::create().with_edit_mode(Box::new(Helix::default()));

loop {
let sig = line_editor.read_line(&prompt)?;
Expand Down
Loading
Loading