diff options
author | Dmitry Sharshakov | 2021-08-29 11:06:36 +0000 |
---|---|---|
committer | Dmitry Sharshakov | 2021-08-29 11:06:36 +0000 |
commit | f53d8411cbda6119bcd34d5936fc23c1365bafef (patch) | |
tree | b8321f3229e4898fb109e4c2508d94263375d574 /helix-term/src/ui | |
parent | 98fda6b8f004549cdbccb4b5567b0388b90fdb37 (diff) |
Add extra annotations to completions
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 99fffbbd..1f20619d 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -719,9 +719,16 @@ impl EditorView { let noop = |_input: &str| Vec::new(); let completer = match field_type { - Some("filename") => super::completers::filename, - Some("directory") => super::completers::directory, - _ => noop, + Some(field_type) => { + if field_type.starts_with("filename") { + super::completers::filename + } else if field_type.starts_with("directory") { + super::completers::directory + } else { + noop + } + } + None => noop, }; Prompt::new( format!("{}: ", field_type.unwrap_or("arg")), |