@@ -235,7 +235,14 @@ impl Renderer {
235235 .set_string(1, self.size.1 - 2, mode, self.text_color);
236236 }
237237
238− pub fn render_prompt(&mut self, prompt: &Prompt) {
238+ pub fn render_prompt(&mut self, view: &View, prompt: &Prompt) {
239+ // completion
240+ if prompt.completion.is_some() {
241+ self.surface.set_style(
242+ Rect::new(0, self.size.1 - 6, self.size.0, 4),
243+ view.theme.get("ui.statusline"),
244+ );
245+ }
239246 // render buffer text
240247 self.surface
241248 .set_string(1, self.size.1 - 1, &prompt.prompt, self.text_color);
@@ -309,10 +316,13 @@ impl Application {
309316
310317 if let Some(view) = &mut self.editor.view {
311318 self.terminal.render_view(view, viewport);
312− }
313−
314− if let Some(prompt) = &self.prompt {
315− self.terminal.render_prompt(prompt);
319+ if let Some(prompt) = &self.prompt {
320+ if prompt.should_close {
321+ self.prompt = None;
322+ } else {
323+ self.terminal.render_prompt(view, prompt);
324+ }
325+ }
316326 }
317327
318328 self.terminal.draw();
@@ -383,7 +393,23 @@ impl Application {
383393 {
384394 let prompt = Prompt::new(
385395 ":".to_owned(),
386− |_input: &str| None, // completion
396+ |_input: &str| {
397+ let placeholder_list = vec![
398+ String::from("aaa"),
399+ String::from("bbb"),
400+ String::from("ccc"),
401+ ];
402+ let mut matches = vec![];
403+ for command in placeholder_list {
404+ if command.contains(_input) {
405+ matches.push(command);
406+ }
407+ }
408+ if matches.len() != 0 {
409+ return Some(matches);
410+ }
411+ None
412+ }, // completion
387413 |editor: &mut Editor, input: &str| match input {
388414 "q" => editor.should_close = true,
389415 _ => (),