Skip to content

Commit

Permalink
Removed the matching bracket validator from editors
Browse files Browse the repository at this point in the history
Bumed version to 1.0.1.
  • Loading branch information
Christian Stolz committed Oct 7, 2024
1 parent 775f2a1 commit 436301b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rusty-buddy"
version = "1.0.0"
version = "1.0.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
12 changes: 2 additions & 10 deletions src/cli/editor/filename_input_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ use crate::cli::style::configure_mad_skin;
use rustyline::completion::FilenameCompleter;
use rustyline::error::ReadlineError;
use rustyline::highlight::{Highlighter, MatchingBracketHighlighter};
use rustyline::hint::HistoryHinter;
use rustyline::validate::MatchingBracketValidator;
use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyEvent};
use rustyline::{Completer, Helper, Hinter, Validator};
use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyEvent, Validator};
use rustyline::{Completer, Helper, Hinter};

#[derive(Helper, Completer, Hinter, Validator)]
struct MyHelper {
#[rustyline(Completer)]
completer: FilenameCompleter,
highlighter: MatchingBracketHighlighter,
#[rustyline(Validator)]
validator: MatchingBracketValidator,
#[rustyline(Hinter)]
hinter: HistoryHinter,
colored_prompt: String,
}

Expand Down Expand Up @@ -56,9 +50,7 @@ pub fn get_filename_input(prompt: &str) -> Result<String, Box<dyn std::error::Er
let h = MyHelper {
completer: FilenameCompleter::new(),
highlighter: MatchingBracketHighlighter::new(),
hinter: HistoryHinter::new(),
colored_prompt: "".to_owned(),
validator: MatchingBracketValidator::new(),
};
let mut rl = Editor::with_config(config)?;
rl.set_helper(Some(h));
Expand Down
4 changes: 0 additions & 4 deletions src/cli/editor/multiline_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use rustyline::{
highlight::{Highlighter, MatchingBracketHighlighter},
hint::HistoryHinter,
history::DefaultHistory,
validate::MatchingBracketValidator,
Completer, Editor, Helper, Hinter, Validator,
};
use std::borrow::Cow;
Expand All @@ -17,8 +16,6 @@ struct MyHelper {
#[rustyline(Completer)]
completer: SlashCommandCompleter,
highlighter: MatchingBracketHighlighter,
#[rustyline(Validator)]
validator: MatchingBracketValidator,
#[rustyline(Hinter)]
hinter: HistoryHinter,
colored_prompt: String,
Expand Down Expand Up @@ -61,7 +58,6 @@ pub fn get_multiline_input(
highlighter: MatchingBracketHighlighter::new(),
hinter: HistoryHinter::new(),
colored_prompt: "".to_owned(),
validator: MatchingBracketValidator::new(),
};
rl.set_helper(Some(h));

Expand Down

0 comments on commit 436301b

Please sign in to comment.