update modal menu prompt

This commit is contained in:
Dustin Carlino 2018-12-17 20:21:55 -08:00
parent fdac85f7fb
commit 54c1f1ba73
2 changed files with 7 additions and 0 deletions

View File

@ -296,6 +296,7 @@ impl UserInput {
panic!("set_mode called on both {} and {}", existing_mode, mode);
}
menu.mark_all_inactive();
menu.change_prompt(prompt);
} else {
if let Some(ref m) = self.modal_state.modes.get(mode) {
let mut menu = Menu::new(

View File

@ -210,4 +210,10 @@ impl<T: Clone> Menu<T> {
*active = false;
}
}
// Assume that this doesn't vastly affect width.
pub fn change_prompt(&mut self, prompt: String) {
assert!(self.prompt.is_some());
self.prompt = Some(prompt);
}
}