aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/readline.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/readline.rs b/src/readline.rs
index 2939ee1..f59cd22 100644
--- a/src/readline.rs
+++ b/src/readline.rs
@@ -7,6 +7,7 @@ use rustyline::error::ReadlineError;
7use rustyline::highlight::Highlighter; 7use rustyline::highlight::Highlighter;
8use rustyline::hint::{Hinter, HistoryHinter}; 8use rustyline::hint::{Hinter, HistoryHinter};
9use rustyline::{Context, Editor, Helper}; 9use rustyline::{Context, Editor, Helper};
10use rustyline::validate::Validator;
10 11
11use directories::ProjectDirs; 12use directories::ProjectDirs;
12 13
@@ -75,6 +76,7 @@ impl Highlighter for LineHighlighter {
75} 76}
76 77
77impl Highlighter for RLHelper { 78impl Highlighter for RLHelper {
79 fn highlight_char(&self, _: &str, _: usize) -> bool { true }
78 fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> { 80 fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> {
79 self.highlighter.highlight_hint(hint) 81 self.highlighter.highlight_hint(hint)
80 } 82 }
@@ -96,11 +98,14 @@ impl Completer for RLHelper {
96} 98}
97 99
98impl Hinter for RLHelper { 100impl Hinter for RLHelper {
99 fn hint(&self, line: &str, a: usize, b: &Context) -> Option<String> { 101 type Hint = String;
102 fn hint(&self, line: &str, a: usize, b: &Context) -> Option<Self::Hint> {
100 self.hinter.hint(line, a, b) 103 self.hinter.hint(line, a, b)
101 } 104 }
102} 105}
103 106
107impl Validator for RLHelper {}
108
104impl Helper for RLHelper {} 109impl Helper for RLHelper {}
105 110
106pub fn create_readline() -> Editor<RLHelper> { 111pub fn create_readline() -> Editor<RLHelper> {