diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-19 19:39:23 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-19 19:39:23 +0300 |
commit | 06862c1484fbfbe18c2323066437d79b0cb465b1 (patch) | |
tree | 0db294dcc87bf8502d81d7a237e8d3e2dc8c2fd1 | |
parent | 9026fb866e6e77221a5c248de431df144125407e (diff) |
ui: prevent some unnecessary redraws
-rw-r--r-- | ui/src/components/mail/listing.rs | 1 | ||||
-rw-r--r-- | ui/src/components/utilities.rs | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ui/src/components/mail/listing.rs b/ui/src/components/mail/listing.rs index 94e73174..bdd0b1de 100644 --- a/ui/src/components/mail/listing.rs +++ b/ui/src/components/mail/listing.rs @@ -123,6 +123,7 @@ impl Component for Listing { grid[(mid, i)].set_bg(Color::Default); } } + self.dirty = false; context .dirty_areas .push_back(((mid, get_y(upper_left)), (mid, get_y(bottom_right)))); diff --git a/ui/src/components/utilities.rs b/ui/src/components/utilities.rs index 5d22d4b3..05226520 100644 --- a/ui/src/components/utilities.rs +++ b/ui/src/components/utilities.rs @@ -699,7 +699,6 @@ impl Component for StatusBar { ); /* don't autocomplete for less than 3 characters */ if self.ex_buffer.as_str().split_graphemes().len() <= 2 { - self.container.set_dirty(); return; } let suggestions: Vec<String> = self @@ -713,8 +712,10 @@ impl Component for StatusBar { } }) .collect(); - if suggestions.is_empty() { - /* redraw self.container because we might have got ridden of an autocomplete + if suggestions.is_empty() && !self.auto_complete.suggestions().is_empty() { + self.auto_complete.set_suggestions(suggestions); + self.auto_complete.set_cursor(0); + /* redraw self.container because we have got ridden of an autocomplete * box, and it must be drawn over */ self.container.set_dirty(); return; |