aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hrastnik2020-10-19 18:08:47 +0000
committerJan Hrastnik2020-10-19 18:08:47 +0000
commitf3ddb8631f1e551fb3713c8eb20a0fdb2db2295d (patch)
treed8c74efd12a9d26a86f8e3304eefe32c9a3683a4
parent06502e5a2e18eeb0e6c4828b6cda0d4ba81cdbab (diff)
wip completion
-rw-r--r--helix-term/src/application.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 8972f082..4e6123ae 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -238,10 +238,28 @@ impl Renderer {
pub fn render_prompt(&mut self, view: &View, prompt: &Prompt) {
// completion
if prompt.completion.is_some() {
+ let completion = prompt.completion.clone().unwrap();
+ // TODO: find out better way of clearing individual lines of the screen
+ for i in (3..7) {
+ self.surface.set_string(
+ 0,
+ self.size.1 - i,
+ " ".repeat(self.size.0 as usize),
+ self.text_color,
+ );
+ }
self.surface.set_style(
Rect::new(0, self.size.1 - 6, self.size.0, 4),
view.theme.get("ui.statusline"),
);
+ for i in (0..completion.len()) {
+ self.surface.set_string(
+ 1,
+ self.size.1 - 6 + i as u16,
+ &completion[i],
+ self.text_color,
+ )
+ }
}
// render buffer text
self.surface
@@ -395,6 +413,7 @@ impl Application {
":".to_owned(),
|_input: &str| {
let placeholder_list = vec![
+ String::from("q"),
String::from("aaa"),
String::from("bbb"),
String::from("ccc"),