@@ -235,7 +235,14 @@ impl Renderer {
235 .set_string(1, self.size.1 - 2, mode, self.text_color);
235 .set_string(1, self.size.1 - 2, mode, self.text_color);
238− pub fn render_prompt(&mut self, prompt: &Prompt) {
238+ pub fn render_prompt(&mut self, view: &View, prompt: &Prompt) {
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"),
239 // render buffer text
246 // render buffer text
240 self.surface
247 self.surface
241 .set_string(1, self.size.1 - 1, &prompt.prompt, self.text_color);
248 .set_string(1, self.size.1 - 1, &prompt.prompt, self.text_color);
@@ -309,10 +316,13 @@ impl Application {
310 if let Some(view) = &mut self.editor.view {
317 if let Some(view) = &mut self.editor.view {
311 self.terminal.render_view(view, viewport);
318 self.terminal.render_view(view, viewport);
314− if let Some(prompt) = &self.prompt {
319+ if let Some(prompt) = &self.prompt {
320+ if prompt.should_close {
315− self.terminal.render_prompt(prompt);
323+ self.terminal.render_prompt(view, prompt);
318 self.terminal.draw();
328 self.terminal.draw();
@@ -383,7 +393,23 @@ impl Application {
384 let prompt = Prompt::new(
394 let prompt = Prompt::new(
385 ":".to_owned(),
395 ":".to_owned(),
397+ let placeholder_list = vec![
398+ String::from("aaa"),
399+ String::from("bbb"),
400+ String::from("ccc"),
402+ let mut matches = vec![];
403+ for command in placeholder_list {
404+ if command.contains(_input) {
405+ matches.push(command);
408+ if matches.len() != 0 {
409+ return Some(matches);
386− |_input: &str| None, // completion
412+ }, // completion
387 |editor: &mut Editor, input: &str| match input {
413 |editor: &mut Editor, input: &str| match input {
388 "q" => editor.should_close = true,
414 "q" => editor.should_close = true,