terminal/cells: rename write_string{to_grid,}

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/312/head
Manos Pitsidianakis 7 months ago
parent e0adcdfe15
commit 7645ff1b87
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -79,7 +79,7 @@ impl ContactManager {
fn initialize(&mut self, context: &Context) { fn initialize(&mut self, context: &Context) {
let (width, _) = self.content.size(); let (width, _) = self.content.size();
let (x, _) = self.content.write_string_to_grid( let (x, _) = self.content.write_string(
"Last edited: ", "Last edited: ",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -87,7 +87,7 @@ impl ContactManager {
((0, 0), (width - 1, 0)), ((0, 0), (width - 1, 0)),
None, None,
); );
let (x, y) = self.content.write_string_to_grid( let (x, y) = self.content.write_string(
&self.card.last_edited(), &self.card.last_edited(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -99,7 +99,7 @@ impl ContactManager {
if self.card.external_resource() { if self.card.external_resource() {
self.mode = ViewMode::ReadOnly; self.mode = ViewMode::ReadOnly;
_ = self.content.resize(self.content.size().0, 2, None); _ = self.content.resize(self.content.size().0, 2, None);
self.content.write_string_to_grid( self.content.write_string(
"This contact's origin is external and cannot be edited within meli.", "This contact's origin is external and cannot be edited within meli.",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,

@ -161,7 +161,7 @@ impl ContactList {
for (idx, c) in book_values.iter().enumerate() { for (idx, c) in book_values.iter().enumerate() {
self.id_positions.push(*c.id()); self.id_positions.push(*c.id());
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
c.name(), c.name(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -170,7 +170,7 @@ impl ContactList {
None, None,
); );
self.data_columns.columns[1].write_string_to_grid( self.data_columns.columns[1].write_string(
c.email(), c.email(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -179,7 +179,7 @@ impl ContactList {
None, None,
); );
self.data_columns.columns[2].write_string_to_grid( self.data_columns.columns[2].write_string(
c.url(), c.url(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -188,7 +188,7 @@ impl ContactList {
None, None,
); );
self.data_columns.columns[3].write_string_to_grid( self.data_columns.columns[3].write_string(
if c.external_resource() { if c.external_resource() {
"external" "external"
} else { } else {
@ -206,7 +206,7 @@ impl ContactList {
let message = "Address book is empty.".to_string(); let message = "Address book is empty.".to_string();
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), self.length, None, context); CellBuffer::new_with_context(message.len(), self.length, None, context);
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&message, &message,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -277,7 +277,7 @@ impl ContactList {
if a.name.grapheme_len() + s.len() > width + 1 { if a.name.grapheme_len() + s.len() > width + 1 {
/* Print account name */ /* Print account name */
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&a.name, &a.name,
account_attrs.fg, account_attrs.fg,
account_attrs.bg, account_attrs.bg,
@ -285,7 +285,7 @@ impl ContactList {
area, area,
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&s, &s,
account_attrs.fg, account_attrs.fg,
account_attrs.bg, account_attrs.bg,
@ -299,7 +299,7 @@ impl ContactList {
), ),
None, None,
); );
grid.write_string_to_grid( grid.write_string(
"…", "…",
account_attrs.fg, account_attrs.fg,
account_attrs.bg, account_attrs.bg,
@ -323,7 +323,7 @@ impl ContactList {
} else { } else {
/* Print account name */ /* Print account name */
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&a.name, &a.name,
account_attrs.fg, account_attrs.fg,
account_attrs.bg, account_attrs.bg,
@ -331,7 +331,7 @@ impl ContactList {
area, area,
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&s, &s,
account_attrs.fg, account_attrs.fg,
account_attrs.bg, account_attrs.bg,
@ -485,7 +485,7 @@ impl ContactList {
continue; continue;
} }
let (column_width, column_height) = self.data_columns.columns[i].size(); let (column_width, column_height) = self.data_columns.columns[i].size();
grid.write_string_to_grid( grid.write_string(
match i { match i {
0 => "NAME", 0 => "NAME",
1 => "E-MAIL", 1 => "E-MAIL",

@ -170,7 +170,7 @@ impl JobManager {
CellBuffer::new_with_context(self.min_width[4], self.length, None, context); CellBuffer::new_with_context(self.min_width[4], self.length, None, context);
for (idx, e) in self.entries.values().enumerate() { for (idx, e) in self.entries.values().enumerate() {
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&e.id.to_string(), &e.id.to_string(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -179,7 +179,7 @@ impl JobManager {
None, None,
); );
self.data_columns.columns[1].write_string_to_grid( self.data_columns.columns[1].write_string(
&e.desc, &e.desc,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -188,7 +188,7 @@ impl JobManager {
None, None,
); );
self.data_columns.columns[2].write_string_to_grid( self.data_columns.columns[2].write_string(
&datetime::timestamp_to_string(e.started, Some(RFC3339_DATETIME_AND_SPACE), true), &datetime::timestamp_to_string(e.started, Some(RFC3339_DATETIME_AND_SPACE), true),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -197,7 +197,7 @@ impl JobManager {
None, None,
); );
self.data_columns.columns[3].write_string_to_grid( self.data_columns.columns[3].write_string(
&if let Some(t) = e.finished { &if let Some(t) = e.finished {
Cow::Owned(datetime::timestamp_to_string( Cow::Owned(datetime::timestamp_to_string(
t, t,
@ -214,7 +214,7 @@ impl JobManager {
None, None,
); );
self.data_columns.columns[4].write_string_to_grid( self.data_columns.columns[4].write_string(
&if e.finished.is_some() { &if e.finished.is_some() {
Cow::Owned(format!("{:?}", e.succeeded)) Cow::Owned(format!("{:?}", e.succeeded))
} else { } else {
@ -232,7 +232,7 @@ impl JobManager {
let message = "No jobs.".to_string(); let message = "No jobs.".to_string();
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), self.length, None, context); CellBuffer::new_with_context(message.len(), self.length, None, context);
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&message, &message,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -393,7 +393,7 @@ impl Component for JobManager {
let mut x_offset = 0; let mut x_offset = 0;
let (upper_left, bottom_right) = area; let (upper_left, bottom_right) = area;
for (i, (h, w)) in Self::HEADERS.iter().zip(self.min_width).enumerate() { for (i, (h, w)) in Self::HEADERS.iter().zip(self.min_width).enumerate() {
grid.write_string_to_grid( grid.write_string(
h, h,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -409,7 +409,7 @@ impl Component for JobManager {
(false, Asc) => DataColumns::<5>::ARROW_UP, (false, Asc) => DataColumns::<5>::ARROW_UP,
(false, Desc) => DataColumns::<5>::ARROW_DOWN, (false, Desc) => DataColumns::<5>::ARROW_DOWN,
}; };
grid.write_string_to_grid( grid.write_string(
arrow, arrow,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,

@ -691,7 +691,7 @@ To: {}
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "); .join(", ");
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"☑ sign with {}", "☑ sign with {}",
if self.gpg_state.sign_keys.is_empty() { if self.gpg_state.sign_keys.is_empty() {
@ -711,7 +711,7 @@ To: {}
None, None,
); );
} else { } else {
grid.write_string_to_grid( grid.write_string(
"☐ don't sign", "☐ don't sign",
theme_default.fg, theme_default.fg,
if self.cursor == Cursor::Sign { if self.cursor == Cursor::Sign {
@ -734,7 +734,7 @@ To: {}
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "); .join(", ");
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"{}{}", "{}{}",
if self.gpg_state.encrypt_keys.is_empty() { if self.gpg_state.encrypt_keys.is_empty() {
@ -759,7 +759,7 @@ To: {}
None, None,
); );
} else { } else {
grid.write_string_to_grid( grid.write_string(
"☐ don't encrypt", "☐ don't encrypt",
theme_default.fg, theme_default.fg,
if self.cursor == Cursor::Encrypt { if self.cursor == Cursor::Encrypt {
@ -773,7 +773,7 @@ To: {}
); );
} }
if attachments_no == 0 { if attachments_no == 0 {
grid.write_string_to_grid( grid.write_string(
"no attachments", "no attachments",
theme_default.fg, theme_default.fg,
if self.cursor == Cursor::Attachments { if self.cursor == Cursor::Attachments {
@ -786,7 +786,7 @@ To: {}
None, None,
); );
} else { } else {
grid.write_string_to_grid( grid.write_string(
&format!("{} attachments ", attachments_no), &format!("{} attachments ", attachments_no),
theme_default.fg, theme_default.fg,
if self.cursor == Cursor::Attachments { if self.cursor == Cursor::Attachments {
@ -800,7 +800,7 @@ To: {}
); );
for (i, a) in self.draft.attachments().iter().enumerate() { for (i, a) in self.draft.attachments().iter().enumerate() {
if let Some(name) = a.content_type().name() { if let Some(name) = a.content_type().name() {
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"[{}] \"{}\", {} {}", "[{}] \"{}\", {} {}",
i, i,
@ -815,7 +815,7 @@ To: {}
None, None,
); );
} else { } else {
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"[{}] {} {}", "[{}] {} {}",
i, i,
@ -944,7 +944,7 @@ impl Component for Composer {
), ),
); );
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
if self.reply_context.is_some() { if self.reply_context.is_some() {
"COMPOSING REPLY" "COMPOSING REPLY"
} else { } else {
@ -1055,7 +1055,7 @@ impl Component for Composer {
.iter() .iter()
.enumerate() .enumerate()
{ {
grid.write_string_to_grid( grid.write_string(
l, l,
theme_default.fg, theme_default.fg,
theme_default.bg, theme_default.bg,

@ -125,7 +125,7 @@ impl Component for EditAttachmentsRefMut<'_, '_> {
let theme_default = crate::conf::value(context, "theme_default"); let theme_default = crate::conf::value(context, "theme_default");
grid.clear_area(area, theme_default); grid.clear_area(area, theme_default);
if attachments_no == 0 { if attachments_no == 0 {
grid.write_string_to_grid( grid.write_string(
"no attachments", "no attachments",
theme_default.fg, theme_default.fg,
theme_default.bg, theme_default.bg,
@ -134,7 +134,7 @@ impl Component for EditAttachmentsRefMut<'_, '_> {
None, None,
); );
} else { } else {
grid.write_string_to_grid( grid.write_string(
&format!("{} attachments ", attachments_no), &format!("{} attachments ", attachments_no),
theme_default.fg, theme_default.fg,
theme_default.bg, theme_default.bg,
@ -153,7 +153,7 @@ impl Component for EditAttachmentsRefMut<'_, '_> {
theme_default.bg theme_default.bg
}; };
if let Some(name) = a.content_type().name() { if let Some(name) = a.content_type().name() {
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"[{}] \"{}\", {} {}", "[{}] \"{}\", {} {}",
i, i,
@ -168,7 +168,7 @@ impl Component for EditAttachmentsRefMut<'_, '_> {
None, None,
); );
} else { } else {
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"[{}] {} {}", "[{}] {} {}",
i, i,

@ -89,7 +89,7 @@ impl Component for KeySelection {
} => progress_spinner.draw(grid, center_area(area, (2, 2)), context), } => progress_spinner.draw(grid, center_area(area, (2, 2)), context),
KeySelection::Error { ref err, .. } => { KeySelection::Error { ref err, .. } => {
let theme_default = crate::conf::value(context, "theme_default"); let theme_default = crate::conf::value(context, "theme_default");
grid.write_string_to_grid( grid.write_string(
&err.to_string(), &err.to_string(),
theme_default.fg, theme_default.fg,
theme_default.bg, theme_default.bg,

@ -2653,7 +2653,7 @@ impl Listing {
}; };
/* Print account name first */ /* Print account name first */
self.menu_content.write_string_to_grid( self.menu_content.write_string(
&self.accounts[aidx].name, &self.accounts[aidx].name,
account_attrs.fg, account_attrs.fg,
account_attrs.bg, account_attrs.bg,
@ -2663,7 +2663,7 @@ impl Listing {
); );
if lines.is_empty() { if lines.is_empty() {
self.menu_content.write_string_to_grid( self.menu_content.write_string(
"offline", "offline",
crate::conf::value(context, "error_message").fg, crate::conf::value(context, "error_message").fg,
account_attrs.bg, account_attrs.bg,
@ -2804,7 +2804,7 @@ impl Listing {
.map(|s| s.as_str()) .map(|s| s.as_str())
.unwrap_or(" "); .unwrap_or(" ");
let (x, _) = self.menu_content.write_string_to_grid( let (x, _) = self.menu_content.write_string(
&if *account_settings!( &if *account_settings!(
context[self.accounts[aidx].hash] context[self.accounts[aidx].hash]
.listing .listing
@ -2846,7 +2846,7 @@ impl Listing {
} }
} }
} }
let (x, _) = self.menu_content.write_string_to_grid( let (x, _) = self.menu_content.write_string(
&branches, &branches,
att.fg, att.fg,
att.bg, att.bg,
@ -2854,7 +2854,7 @@ impl Listing {
((x, y), bottom_right), ((x, y), bottom_right),
None, None,
); );
let (x, _) = self.menu_content.write_string_to_grid( let (x, _) = self.menu_content.write_string(
context.accounts[self.accounts[aidx].index].mailbox_entries[&l.mailbox_idx].name(), context.accounts[self.accounts[aidx].index].mailbox_entries[&l.mailbox_idx].name(),
att.fg, att.fg,
att.bg, att.bg,
@ -2875,7 +2875,7 @@ impl Listing {
(None, Some(coll)) => format!(" ({}) v", coll), (None, Some(coll)) => format!(" ({}) v", coll),
}; };
let (x, _) = self.menu_content.write_string_to_grid( let (x, _) = self.menu_content.write_string(
&count_string, &count_string,
unread_count_att.fg, unread_count_att.fg,
unread_count_att.bg, unread_count_att.bg,

@ -289,7 +289,7 @@ impl MailListingTrait for CompactListing {
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), 1, None, context); CellBuffer::new_with_context(message.len(), 1, None, context);
self.length = 0; self.length = 0;
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
message.as_str(), message.as_str(),
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -582,7 +582,7 @@ impl MailListingTrait for CompactListing {
let message: String = account[&self.cursor_pos.1].status(); let message: String = account[&self.cursor_pos.1].status();
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), self.length + 1, None, context); CellBuffer::new_with_context(message.len(), self.length + 1, None, context);
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&message, &message,
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -1233,7 +1233,7 @@ impl CompactListing {
columns[2].size().0, columns[2].size().0,
columns[3].size().0, columns[3].size().0,
); );
let (x, _) = columns[0].write_string_to_grid( let (x, _) = columns[0].write_string(
&idx.to_string(), &idx.to_string(),
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1244,7 +1244,7 @@ impl CompactListing {
for c in columns[0].row_iter(x..min_width.0, idx) { for c in columns[0].row_iter(x..min_width.0, idx) {
columns[0][c].set_bg(row_attr.bg).set_ch(' '); columns[0][c].set_bg(row_attr.bg).set_ch(' ');
} }
let (x, _) = columns[1].write_string_to_grid( let (x, _) = columns[1].write_string(
&strings.date, &strings.date,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1255,7 +1255,7 @@ impl CompactListing {
for c in columns[1].row_iter(x..min_width.1, idx) { for c in columns[1].row_iter(x..min_width.1, idx) {
columns[1][c].set_bg(row_attr.bg).set_ch(' '); columns[1][c].set_bg(row_attr.bg).set_ch(' ');
} }
let (x, _) = columns[2].write_string_to_grid( let (x, _) = columns[2].write_string(
&strings.from, &strings.from,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1266,7 +1266,7 @@ impl CompactListing {
for c in columns[2].row_iter(x..min_width.2, idx) { for c in columns[2].row_iter(x..min_width.2, idx) {
columns[2][c].set_bg(row_attr.bg).set_ch(' '); columns[2][c].set_bg(row_attr.bg).set_ch(' ');
} }
let (x, _) = columns[3].write_string_to_grid( let (x, _) = columns[3].write_string(
&strings.flag, &strings.flag,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1274,7 +1274,7 @@ impl CompactListing {
((0, idx), (min_width.3, idx)), ((0, idx), (min_width.3, idx)),
None, None,
); );
let (x, _) = columns[3].write_string_to_grid( let (x, _) = columns[3].write_string(
&strings.subject, &strings.subject,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1289,7 +1289,7 @@ impl CompactListing {
let mut x = x + 1; let mut x = x + 1;
for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) { for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) {
let color = color.unwrap_or(self.color_cache.tag_default.bg); let color = color.unwrap_or(self.color_cache.tag_default.bg);
let (_x, _) = columns[3].write_string_to_grid( let (_x, _) = columns[3].write_string(
t, t,
self.color_cache.tag_default.fg, self.color_cache.tag_default.fg,
color, color,
@ -1362,7 +1362,7 @@ impl CompactListing {
panic!(); panic!();
} }
let row_attr = self.rows.row_attr_cache[&idx]; let row_attr = self.rows.row_attr_cache[&idx];
let (x, _) = self.data_columns.columns[0].write_string_to_grid( let (x, _) = self.data_columns.columns[0].write_string(
&idx.to_string(), &idx.to_string(),
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1375,7 +1375,7 @@ impl CompactListing {
.set_bg(row_attr.bg) .set_bg(row_attr.bg)
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
let (x, _) = self.data_columns.columns[1].write_string_to_grid( let (x, _) = self.data_columns.columns[1].write_string(
&strings.date, &strings.date,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1388,7 +1388,7 @@ impl CompactListing {
.set_bg(row_attr.bg) .set_bg(row_attr.bg)
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
let (x, _) = self.data_columns.columns[2].write_string_to_grid( let (x, _) = self.data_columns.columns[2].write_string(
&strings.from, &strings.from,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1410,7 +1410,7 @@ impl CompactListing {
.set_bg(row_attr.bg) .set_bg(row_attr.bg)
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
let (x, _) = self.data_columns.columns[3].write_string_to_grid( let (x, _) = self.data_columns.columns[3].write_string(
&strings.flag, &strings.flag,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1418,7 +1418,7 @@ impl CompactListing {
((0, idx), (min_width.3, idx)), ((0, idx), (min_width.3, idx)),
None, None,
); );
let (x, _) = self.data_columns.columns[3].write_string_to_grid( let (x, _) = self.data_columns.columns[3].write_string(
&strings.subject, &strings.subject,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1439,7 +1439,7 @@ impl CompactListing {
let mut x = x + 1; let mut x = x + 1;
for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) { for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) {
let color = color.unwrap_or(self.color_cache.tag_default.bg); let color = color.unwrap_or(self.color_cache.tag_default.bg);
let (_x, _) = self.data_columns.columns[3].write_string_to_grid( let (_x, _) = self.data_columns.columns[3].write_string(
t, t,
self.color_cache.tag_default.fg, self.color_cache.tag_default.fg,
color, color,
@ -1534,7 +1534,7 @@ impl Component for CompactListing {
let mut area = area; let mut area = area;
if !self.filter_term.is_empty() { if !self.filter_term.is_empty() {
let (upper_left, bottom_right) = area; let (upper_left, bottom_right) = area;
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&format!( &format!(
"{} results for `{}` (Press ESC to exit)", "{} results for `{}` (Press ESC to exit)",
self.filtered_selection.len(), self.filtered_selection.len(),

@ -465,7 +465,7 @@ impl ListingTrait for ConversationsListing {
if let Err(message) = self.error.as_ref() { if let Err(message) = self.error.as_ref() {
grid.clear_area(area, self.color_cache.theme_default); grid.clear_area(area, self.color_cache.theme_default);
grid.write_string_to_grid( grid.write_string(
message, message,
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -904,7 +904,7 @@ impl ConversationsListing {
self.rows.is_thread_selected(*thread_hash) self.rows.is_thread_selected(*thread_hash)
); );
/* draw flags */ /* draw flags */
let (x, _) = grid.write_string_to_grid( let (x, _) = grid.write_string(
&strings.flag, &strings.flag,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -923,7 +923,7 @@ impl ConversationsListing {
self.rows.is_thread_selected(*thread_hash) self.rows.is_thread_selected(*thread_hash)
); );
/* draw subject */ /* draw subject */
let (mut x, subject_overflowed) = grid.write_string_to_grid( let (mut x, subject_overflowed) = grid.write_string(
&strings.subject, &strings.subject,
subject_attr.fg, subject_attr.fg,
subject_attr.bg, subject_attr.bg,
@ -937,7 +937,7 @@ impl ConversationsListing {
break; break;
}; };
let color = color.unwrap_or(self.color_cache.tag_default.bg); let color = color.unwrap_or(self.color_cache.tag_default.bg);
let (_x, _y) = grid.write_string_to_grid( let (_x, _y) = grid.write_string(
t, t,
self.color_cache.tag_default.fg, self.color_cache.tag_default.fg,
color, color,
@ -981,7 +981,7 @@ impl ConversationsListing {
return; return;
} }
/* Next line, draw date */ /* Next line, draw date */
let (x, _) = grid.write_string_to_grid( let (x, _) = grid.write_string(
&strings.date, &strings.date,
date_attr.fg, date_attr.fg,
date_attr.bg, date_attr.bg,
@ -1003,7 +1003,7 @@ impl ConversationsListing {
self.rows.is_thread_selected(*thread_hash) self.rows.is_thread_selected(*thread_hash)
); );
/* draw from */ /* draw from */
let (x, _) = grid.write_string_to_grid( let (x, _) = grid.write_string(
&strings.from, &strings.from,
from_attr.fg, from_attr.fg,
from_attr.bg, from_attr.bg,
@ -1042,7 +1042,7 @@ impl Component for ConversationsListing {
let mut area = area; let mut area = area;
if !self.filter_term.is_empty() { if !self.filter_term.is_empty() {
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&format!( &format!(
"{} results for `{}` (Press ESC to exit)", "{} results for `{}` (Press ESC to exit)",
self.filtered_selection.len(), self.filtered_selection.len(),

@ -141,7 +141,7 @@ impl Component for OfflineListing {
let error_message = conf::value(context, "error_message"); let error_message = conf::value(context, "error_message");
grid.clear_area(area, theme_default); grid.clear_area(area, theme_default);
if let Err(err) = context.is_online(self.cursor_pos.0) { if let Err(err) = context.is_online(self.cursor_pos.0) {
let (x, _) = grid.write_string_to_grid( let (x, _) = grid.write_string(
"offline: ", "offline: ",
error_message.fg, error_message.fg,
error_message.bg, error_message.bg,
@ -150,7 +150,7 @@ impl Component for OfflineListing {
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&err.to_string(), &err.to_string(),
error_message.fg, error_message.fg,
error_message.bg, error_message.bg,
@ -159,7 +159,7 @@ impl Component for OfflineListing {
Some(get_x(upper_left!(area))), Some(get_x(upper_left!(area))),
); );
if let Some(msg) = self.messages.last() { if let Some(msg) = self.messages.last() {
grid.write_string_to_grid( grid.write_string(
msg, msg,
text_unfocused.fg, text_unfocused.fg,
text_unfocused.bg, text_unfocused.bg,
@ -169,7 +169,7 @@ impl Component for OfflineListing {
); );
} }
for (i, msg) in self.messages.iter().rev().skip(1).enumerate() { for (i, msg) in self.messages.iter().rev().skip(1).enumerate() {
grid.write_string_to_grid( grid.write_string(
msg, msg,
text_unfocused.fg, text_unfocused.fg,
text_unfocused.bg, text_unfocused.bg,
@ -179,7 +179,7 @@ impl Component for OfflineListing {
); );
} }
} else { } else {
let (_, mut y) = grid.write_string_to_grid( let (_, mut y) = grid.write_string(
"loading...", "loading...",
conf::value(context, "highlight").fg, conf::value(context, "highlight").fg,
conf::value(context, "highlight").bg, conf::value(context, "highlight").bg,
@ -193,7 +193,7 @@ impl Component for OfflineListing {
.collect(); .collect();
jobs.sort_by_key(|(j, _)| *j); jobs.sort_by_key(|(j, _)| *j);
for (job_id, j) in jobs { for (job_id, j) in jobs {
grid.write_string_to_grid( grid.write_string(
&format!("{}: {:?}", job_id, j), &format!("{}: {:?}", job_id, j),
text_unfocused.fg, text_unfocused.fg,
text_unfocused.bg, text_unfocused.bg,

@ -232,7 +232,7 @@ impl MailListingTrait for PlainListing {
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), 1, None, context); CellBuffer::new_with_context(message.len(), 1, None, context);
self.length = 0; self.length = 0;
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
message.as_str(), message.as_str(),
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -917,7 +917,7 @@ impl PlainListing {
let row_attr = self.rows.row_attr_cache[&idx]; let row_attr = self.rows.row_attr_cache[&idx];
let (x, _) = columns[0].write_string_to_grid( let (x, _) = columns[0].write_string(
&idx.to_string(), &idx.to_string(),
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -928,7 +928,7 @@ impl PlainListing {
for c in columns[0].row_iter(x..min_width.0, idx) { for c in columns[0].row_iter(x..min_width.0, idx) {
columns[0][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs); columns[0][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs);
} }
let (x, _) = columns[1].write_string_to_grid( let (x, _) = columns[1].write_string(
&strings.date, &strings.date,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -939,7 +939,7 @@ impl PlainListing {
for c in columns[1].row_iter(x..min_width.1, idx) { for c in columns[1].row_iter(x..min_width.1, idx) {
columns[1][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs); columns[1][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs);
} }
let (x, _) = columns[2].write_string_to_grid( let (x, _) = columns[2].write_string(
&strings.from, &strings.from,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -950,7 +950,7 @@ impl PlainListing {
for c in columns[2].row_iter(x..min_width.2, idx) { for c in columns[2].row_iter(x..min_width.2, idx) {
columns[2][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs); columns[2][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs);
} }
let (x, _) = columns[3].write_string_to_grid( let (x, _) = columns[3].write_string(
&strings.flag, &strings.flag,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -958,7 +958,7 @@ impl PlainListing {
((0, idx), (min_width.3, idx)), ((0, idx), (min_width.3, idx)),
None, None,
); );
let (x, _) = columns[3].write_string_to_grid( let (x, _) = columns[3].write_string(
&strings.subject, &strings.subject,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -970,7 +970,7 @@ impl PlainListing {
let mut x = x + 1; let mut x = x + 1;
for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) { for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) {
let color = color.unwrap_or(self.color_cache.tag_default.bg); let color = color.unwrap_or(self.color_cache.tag_default.bg);
let (_x, _) = columns[3].write_string_to_grid( let (_x, _) = columns[3].write_string(
t, t,
self.color_cache.tag_default.fg, self.color_cache.tag_default.fg,
color, color,
@ -1002,7 +1002,7 @@ impl PlainListing {
let message: String = account[&self.cursor_pos.1].status(); let message: String = account[&self.cursor_pos.1].status();
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), self.length + 1, None, context); CellBuffer::new_with_context(message.len(), self.length + 1, None, context);
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&message, &message,
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -1056,7 +1056,7 @@ impl PlainListing {
columns[2].clear_area(((0, idx), (min_width.2, idx)), row_attr); columns[2].clear_area(((0, idx), (min_width.2, idx)), row_attr);
columns[3].clear_area(((0, idx), (min_width.3, idx)), row_attr); columns[3].clear_area(((0, idx), (min_width.3, idx)), row_attr);
let (x, _) = columns[0].write_string_to_grid( let (x, _) = columns[0].write_string(
&idx.to_string(), &idx.to_string(),
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1067,7 +1067,7 @@ impl PlainListing {
for c in columns[0].row_iter(x..min_width.0, idx) { for c in columns[0].row_iter(x..min_width.0, idx) {
columns[0][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs); columns[0][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs);
} }
let (x, _) = columns[1].write_string_to_grid( let (x, _) = columns[1].write_string(
&strings.date, &strings.date,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1078,7 +1078,7 @@ impl PlainListing {
for c in columns[1].row_iter(x..min_width.1, idx) { for c in columns[1].row_iter(x..min_width.1, idx) {
columns[1][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs); columns[1][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs);
} }
let (x, _) = columns[2].write_string_to_grid( let (x, _) = columns[2].write_string(
&strings.from, &strings.from,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1089,7 +1089,7 @@ impl PlainListing {
for c in columns[2].row_iter(x..min_width.2, idx) { for c in columns[2].row_iter(x..min_width.2, idx) {
columns[2][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs); columns[2][c].set_bg(row_attr.bg).set_attrs(row_attr.attrs);
} }
let (x, _) = columns[3].write_string_to_grid( let (x, _) = columns[3].write_string(
&strings.flag, &strings.flag,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1097,7 +1097,7 @@ impl PlainListing {
((0, idx), (min_width.3, idx)), ((0, idx), (min_width.3, idx)),
None, None,
); );
let (x, _) = columns[3].write_string_to_grid( let (x, _) = columns[3].write_string(
&strings.subject, &strings.subject,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1109,7 +1109,7 @@ impl PlainListing {
let mut x = x + 1; let mut x = x + 1;
for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) { for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) {
let color = color.unwrap_or(self.color_cache.tag_default.bg); let color = color.unwrap_or(self.color_cache.tag_default.bg);
let (_x, _) = columns[3].write_string_to_grid( let (_x, _) = columns[3].write_string(
t, t,
self.color_cache.tag_default.fg, self.color_cache.tag_default.fg,
color, color,
@ -1155,7 +1155,7 @@ impl Component for PlainListing {
let mut area = area; let mut area = area;
if !self.filter_term.is_empty() { if !self.filter_term.is_empty() {
let (upper_left, bottom_right) = area; let (upper_left, bottom_right) = area;
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&format!( &format!(
"{} results for `{}` (Press ESC to exit)", "{} results for `{}` (Press ESC to exit)",
self.filtered_selection.len(), self.filtered_selection.len(),

@ -218,7 +218,7 @@ impl MailListingTrait for ThreadListing {
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), 1, None, context); CellBuffer::new_with_context(message.len(), 1, None, context);
self.length = 0; self.length = 0;
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
message.as_str(), message.as_str(),
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -258,7 +258,7 @@ impl MailListingTrait for ThreadListing {
let message: String = account[&self.cursor_pos.1].status(); let message: String = account[&self.cursor_pos.1].status();
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), 1, None, context); CellBuffer::new_with_context(message.len(), 1, None, context);
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
message.as_str(), message.as_str(),
self.color_cache.theme_default.fg, self.color_cache.theme_default.fg,
self.color_cache.theme_default.bg, self.color_cache.theme_default.bg,
@ -947,7 +947,7 @@ impl ThreadListing {
self.rows.selection[env_hash] self.rows.selection[env_hash]
); );
if !*account_settings!(context[self.cursor_pos.0].listing.relative_list_indices) { if !*account_settings!(context[self.cursor_pos.0].listing.relative_list_indices) {
let (x, _) = self.data_columns.columns[0].write_string_to_grid( let (x, _) = self.data_columns.columns[0].write_string(
&idx.to_string(), &idx.to_string(),
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -961,7 +961,7 @@ impl ThreadListing {
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
} }
let (x, _) = self.data_columns.columns[1].write_string_to_grid( let (x, _) = self.data_columns.columns[1].write_string(
&strings.date, &strings.date,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -974,7 +974,7 @@ impl ThreadListing {
.set_bg(row_attr.bg) .set_bg(row_attr.bg)
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
let (x, _) = self.data_columns.columns[2].write_string_to_grid( let (x, _) = self.data_columns.columns[2].write_string(
&strings.from, &strings.from,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -996,7 +996,7 @@ impl ThreadListing {
.set_bg(row_attr.bg) .set_bg(row_attr.bg)
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
let (x, _) = self.data_columns.columns[3].write_string_to_grid( let (x, _) = self.data_columns.columns[3].write_string(
&strings.flag, &strings.flag,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1009,7 +1009,7 @@ impl ThreadListing {
.set_bg(row_attr.bg) .set_bg(row_attr.bg)
.set_attrs(row_attr.attrs); .set_attrs(row_attr.attrs);
} }
let (x, _) = self.data_columns.columns[4].write_string_to_grid( let (x, _) = self.data_columns.columns[4].write_string(
&strings.subject, &strings.subject,
row_attr.fg, row_attr.fg,
row_attr.bg, row_attr.bg,
@ -1030,7 +1030,7 @@ impl ThreadListing {
let mut x = x + 1; let mut x = x + 1;
for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) { for (t, &color) in strings.tags.split_whitespace().zip(strings.tags.1.iter()) {
let color = color.unwrap_or(self.color_cache.tag_default.bg); let color = color.unwrap_or(self.color_cache.tag_default.bg);
let (_x, _) = self.data_columns.columns[4].write_string_to_grid( let (_x, _) = self.data_columns.columns[4].write_string(
t, t,
self.color_cache.tag_default.fg, self.color_cache.tag_default.fg,
color, color,
@ -1133,7 +1133,7 @@ impl ThreadListing {
), ),
row_attr, row_attr,
); );
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&if self.new_cursor_pos.2.saturating_sub(top_idx) == i { &if self.new_cursor_pos.2.saturating_sub(top_idx) == i {
self.new_cursor_pos.2.to_string() self.new_cursor_pos.2.to_string()
} else { } else {
@ -1148,7 +1148,7 @@ impl ThreadListing {
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&if self.new_cursor_pos.2.saturating_sub(top_idx) == i { &if self.new_cursor_pos.2.saturating_sub(top_idx) == i {
self.new_cursor_pos.2.to_string() self.new_cursor_pos.2.to_string()
} else { } else {

@ -70,7 +70,7 @@ impl Component for AccountStatus {
self.dirty = false; self.dirty = false;
let (mut width, _) = self.content.size(); let (mut width, _) = self.content.size();
let a = &context.accounts[self.account_pos]; let a = &context.accounts[self.account_pos];
let (_x, _y) = self.content.write_string_to_grid( let (_x, _y) = self.content.write_string(
"Account ", "Account ",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -78,7 +78,7 @@ impl Component for AccountStatus {
((1, 0), (width - 1, 0)), ((1, 0), (width - 1, 0)),
None, None,
); );
let (_x, _y) = self.content.write_string_to_grid( let (_x, _y) = self.content.write_string(
a.name(), a.name(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -89,7 +89,7 @@ impl Component for AccountStatus {
width = self.content.size().0; width = self.content.size().0;
let mut line = 2; let mut line = 2;
self.content.write_string_to_grid( self.content.write_string(
"In-progress jobs:", "In-progress jobs:",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -102,7 +102,7 @@ impl Component for AccountStatus {
for (job_id, req) in a.active_jobs.iter() { for (job_id, req) in a.active_jobs.iter() {
width = self.content.size().0; width = self.content.size().0;
use crate::accounts::JobRequest; use crate::accounts::JobRequest;
let (x, y) = self.content.write_string_to_grid( let (x, y) = self.content.write_string(
&format!("{} {}", req, job_id), &format!("{} {}", req, job_id),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -116,7 +116,7 @@ impl Component for AccountStatus {
| JobRequest::Refresh { mailbox_hash, .. } | JobRequest::Refresh { mailbox_hash, .. }
| JobRequest::Fetch { mailbox_hash, .. } = req | JobRequest::Fetch { mailbox_hash, .. } = req
{ {
self.content.write_string_to_grid( self.content.write_string(
a.mailbox_entries[mailbox_hash].name(), a.mailbox_entries[mailbox_hash].name(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -132,7 +132,7 @@ impl Component for AccountStatus {
line += 2; line += 2;
width = self.content.size().0; width = self.content.size().0;
let (_x, _y) = self.content.write_string_to_grid( let (_x, _y) = self.content.write_string(
"Tag support: ", "Tag support: ",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -141,7 +141,7 @@ impl Component for AccountStatus {
None, None,
); );
width = self.content.size().0; width = self.content.size().0;
self.content.write_string_to_grid( self.content.write_string(
if a.backend_capabilities.supports_tags { if a.backend_capabilities.supports_tags {
"yes" "yes"
} else { } else {
@ -155,7 +155,7 @@ impl Component for AccountStatus {
); );
width = self.content.size().0; width = self.content.size().0;
line += 1; line += 1;
let (_x, _y) = self.content.write_string_to_grid( let (_x, _y) = self.content.write_string(
"Search backend: ", "Search backend: ",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -164,7 +164,7 @@ impl Component for AccountStatus {
None, None,
); );
width = self.content.size().0; width = self.content.size().0;
self.content.write_string_to_grid( self.content.write_string(
&match ( &match (
a.settings.conf.search_backend(), a.settings.conf.search_backend(),
a.backend_capabilities.supports_search, a.backend_capabilities.supports_search,
@ -193,7 +193,7 @@ impl Component for AccountStatus {
width = self.content.size().0; width = self.content.size().0;
line += 1; line += 1;
self.content.write_string_to_grid( self.content.write_string(
"Special Mailboxes:", "Special Mailboxes:",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -209,7 +209,7 @@ impl Component for AccountStatus {
{ {
width = self.content.size().0; width = self.content.size().0;
line += 1; line += 1;
self.content.write_string_to_grid( self.content.write_string(
&format!("{}: {}", f.path(), f.special_usage()), &format!("{}: {}", f.path(), f.special_usage()),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -220,7 +220,7 @@ impl Component for AccountStatus {
} }
line += 2; line += 2;
width = self.content.size().0; width = self.content.size().0;
self.content.write_string_to_grid( self.content.write_string(
"Subscribed mailboxes:", "Subscribed mailboxes:",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -233,7 +233,7 @@ impl Component for AccountStatus {
width = self.content.size().0; width = self.content.size().0;
let f: &Mailbox = &a[&mailbox_node.hash].ref_mailbox; let f: &Mailbox = &a[&mailbox_node.hash].ref_mailbox;
if f.is_subscribed() { if f.is_subscribed() {
self.content.write_string_to_grid( self.content.write_string(
f.path(), f.path(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -248,7 +248,7 @@ impl Component for AccountStatus {
line += 1; line += 1;
width = self.content.size().0; width = self.content.size().0;
if let Some(ref extensions) = a.backend_capabilities.extensions { if let Some(ref extensions) = a.backend_capabilities.extensions {
self.content.write_string_to_grid( self.content.write_string(
"Server Extensions:", "Server Extensions:",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -265,7 +265,7 @@ impl Component for AccountStatus {
.unwrap_or(0), .unwrap_or(0),
); );
width = self.content.size().0; width = self.content.size().0;
self.content.write_string_to_grid( self.content.write_string(
"meli support:", "meli support:",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -276,7 +276,7 @@ impl Component for AccountStatus {
line += 1; line += 1;
for (name, status) in extensions.iter() { for (name, status) in extensions.iter() {
width = self.content.size().0; width = self.content.size().0;
self.content.write_string_to_grid( self.content.write_string(
name.trim_at_boundary(30), name.trim_at_boundary(30),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -298,7 +298,7 @@ impl Component for AccountStatus {
("enabled", Color::Green) ("enabled", Color::Green)
} }
}; };
self.content.write_string_to_grid( self.content.write_string(
status, status,
color, color,
self.theme_default.bg, self.theme_default.bg,
@ -312,7 +312,7 @@ impl Component for AccountStatus {
| MailBackendExtensionStatus::Supported { comment } | MailBackendExtensionStatus::Supported { comment }
| MailBackendExtensionStatus::Enabled { comment } => { | MailBackendExtensionStatus::Enabled { comment } => {
if let Some(s) = comment { if let Some(s) = comment {
let (x, y) = self.content.write_string_to_grid( let (x, y) = self.content.write_string(
" (", " (",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -320,7 +320,7 @@ impl Component for AccountStatus {
((x, y), (width - 1, y)), ((x, y), (width - 1, y)),
None, None,
); );
let (x, y) = self.content.write_string_to_grid( let (x, y) = self.content.write_string(
s, s,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -328,7 +328,7 @@ impl Component for AccountStatus {
((x, y), (width - 1, y)), ((x, y), (width - 1, y)),
None, None,
); );
self.content.write_string_to_grid( self.content.write_string(
")", ")",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -343,7 +343,7 @@ impl Component for AccountStatus {
} }
} }
/* self.content may have been resized with write_string_to_grid() calls above /* self.content may have been resized with write_string() calls above
* since it has growable set */ * since it has growable set */
let (width, height) = self.content.size(); let (width, height) = self.content.size();
let (cols, rows) = (width!(area), height!(area)); let (cols, rows) = (width!(area), height!(area));

@ -743,7 +743,7 @@ impl Component for EnvelopeView {
if sticky || skip_header_ctr == 0 { if sticky || skip_header_ctr == 0 {
if y <= get_y(bottom_right) { if y <= get_y(bottom_right) {
let (_x, _y) = let (_x, _y) =
grid.write_string_to_grid( grid.write_string(
&format!("{}:", $header), &format!("{}:", $header),
headers_names.fg, headers_names.fg,
headers_names.bg, headers_names.bg,
@ -759,7 +759,7 @@ impl Component for EnvelopeView {
} }
let (_x, _y) = let (_x, _y) =
grid.write_string_to_grid( grid.write_string(
&$string, &$string,
headers.fg, headers.fg,
headers.bg, headers.bg,
@ -878,7 +878,7 @@ impl Component for EnvelopeView {
(set_y(upper_left, y), set_y(bottom_right, y)), (set_y(upper_left, y), set_y(bottom_right, y)),
headers_area, headers_area,
); );
let (_x, _) = grid.write_string_to_grid( let (_x, _) = grid.write_string(
"List-ID: ", "List-ID: ",
headers_names.fg, headers_names.fg,
headers_names.bg, headers_names.bg,
@ -886,7 +886,7 @@ impl Component for EnvelopeView {
(set_y(upper_left, y), bottom_right), (set_y(upper_left, y), bottom_right),
None, None,
); );
let (_x, _y) = grid.write_string_to_grid( let (_x, _y) = grid.write_string(
id, id,
headers.fg, headers.fg,
headers.bg, headers.bg,
@ -904,7 +904,7 @@ impl Component for EnvelopeView {
} }
if sticky || skip_header_ctr == 0 { if sticky || skip_header_ctr == 0 {
if archive.is_some() || post.is_some() || unsubscribe.is_some() { if archive.is_some() || post.is_some() || unsubscribe.is_some() {
let (_x, _y) = grid.write_string_to_grid( let (_x, _y) = grid.write_string(
" Available actions: [ ", " Available actions: [ ",
headers_names.fg, headers_names.fg,
headers_names.bg, headers_names.bg,
@ -916,7 +916,7 @@ impl Component for EnvelopeView {
y = _y; y = _y;
} }
if archive.is_some() { if archive.is_some() {
let (_x, _y) = grid.write_string_to_grid( let (_x, _y) = grid.write_string(
"list-archive, ", "list-archive, ",
headers.fg, headers.fg,
headers.bg, headers.bg,
@ -928,7 +928,7 @@ impl Component for EnvelopeView {
y = _y; y = _y;
} }
if post.is_some() { if post.is_some() {
let (_x, _y) = grid.write_string_to_grid( let (_x, _y) = grid.write_string(
"list-post, ", "list-post, ",
headers.fg, headers.fg,
headers.bg, headers.bg,
@ -940,7 +940,7 @@ impl Component for EnvelopeView {
y = _y; y = _y;
} }
if unsubscribe.is_some() { if unsubscribe.is_some() {
let (_x, _y) = grid.write_string_to_grid( let (_x, _y) = grid.write_string(
"list-unsubscribe, ", "list-unsubscribe, ",
headers.fg, headers.fg,
headers.bg, headers.bg,
@ -1237,7 +1237,7 @@ impl Component for EnvelopeView {
} else { } else {
let s = self.cmd_buf.to_string(); let s = self.cmd_buf.to_string();
grid.write_string_to_grid( grid.write_string(
&s, &s,
self.view_settings.theme_default.fg, self.view_settings.theme_default.fg,
self.view_settings.theme_default.bg, self.view_settings.theme_default.bg,

@ -377,7 +377,7 @@ impl ThreadView {
set_and_join_box(&mut content, index, BoxBoundary::Horizontal); set_and_join_box(&mut content, index, BoxBoundary::Horizontal);
} }
} }
content.write_string_to_grid( content.write_string(
&e.heading, &e.heading,
if e.seen { if e.seen {
theme_default.fg theme_default.fg
@ -443,7 +443,7 @@ impl ThreadView {
set_and_join_box(&mut content, index, BoxBoundary::Horizontal); set_and_join_box(&mut content, index, BoxBoundary::Horizontal);
} }
} }
content.write_string_to_grid( content.write_string(
&e.heading, &e.heading,
if e.seen { if e.seen {
theme_default.fg theme_default.fg
@ -751,7 +751,7 @@ impl ThreadView {
}); });
let envelope: EnvelopeRef = account.collection.get_env(i); let envelope: EnvelopeRef = account.collection.get_env(i);
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&envelope.subject(), &envelope.subject(),
crate::conf::value(context, "highlight").fg, crate::conf::value(context, "highlight").fg,
theme_default.bg, theme_default.bg,
@ -863,7 +863,7 @@ impl ThreadView {
}); });
let envelope: EnvelopeRef = account.collection.get_env(i); let envelope: EnvelopeRef = account.collection.get_env(i);
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&envelope.subject(), &envelope.subject(),
theme_default.fg, theme_default.fg,
theme_default.bg, theme_default.bg,

@ -130,7 +130,7 @@ impl MailboxManager {
CellBuffer::new_with_context(min_width.3, self.length, None, context); CellBuffer::new_with_context(min_width.3, self.length, None, context);
for (idx, e) in self.entries.values().enumerate() { for (idx, e) in self.entries.values().enumerate() {
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
e.name(), e.name(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -139,7 +139,7 @@ impl MailboxManager {
None, None,
); );
self.data_columns.columns[1].write_string_to_grid( self.data_columns.columns[1].write_string(
e.ref_mailbox.path(), e.ref_mailbox.path(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -149,7 +149,7 @@ impl MailboxManager {
); );
let (_unseen, total) = e.ref_mailbox.count().ok().unwrap_or((0, 0)); let (_unseen, total) = e.ref_mailbox.count().ok().unwrap_or((0, 0));
self.data_columns.columns[2].write_string_to_grid( self.data_columns.columns[2].write_string(
&total.to_string(), &total.to_string(),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -158,7 +158,7 @@ impl MailboxManager {
None, None,
); );
self.data_columns.columns[3].write_string_to_grid( self.data_columns.columns[3].write_string(
if e.ref_mailbox.is_subscribed() { if e.ref_mailbox.is_subscribed() {
"yes" "yes"
} else { } else {
@ -176,7 +176,7 @@ impl MailboxManager {
let message = "No mailboxes.".to_string(); let message = "No mailboxes.".to_string();
self.data_columns.columns[0] = self.data_columns.columns[0] =
CellBuffer::new_with_context(message.len(), self.length, None, context); CellBuffer::new_with_context(message.len(), self.length, None, context);
self.data_columns.columns[0].write_string_to_grid( self.data_columns.columns[0].write_string(
&message, &message,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,

@ -709,7 +709,7 @@ impl State {
.chain(Some(String::new())) .chain(Some(String::new()))
.chain(Some(datetime::timestamp_to_string(*timestamp, None, false))) .chain(Some(datetime::timestamp_to_string(*timestamp, None, false)))
{ {
self.screen.overlay_grid.write_string_to_grid( self.screen.overlay_grid.write_string(
&line, &line,
noto_colors.fg, noto_colors.fg,
noto_colors.bg, noto_colors.bg,
@ -721,7 +721,7 @@ impl State {
} }
if self.display_messages.len() > 1 { if self.display_messages.len() > 1 {
self.screen.overlay_grid.write_string_to_grid( self.screen.overlay_grid.write_string(
&if self.display_messages_pos == 0 { &if self.display_messages_pos == 0 {
format!( format!(
"Next: {}", "Next: {}",

@ -437,7 +437,7 @@ impl CellBuffer {
/// Write an `&str` to a `CellBuffer` in a specified `Area` with the passed /// Write an `&str` to a `CellBuffer` in a specified `Area` with the passed
/// colors. /// colors.
pub fn write_string_to_grid( pub fn write_string(
&mut self, &mut self,
s: &str, s: &str,
fg_color: Color, fg_color: Color,
@ -1847,7 +1847,7 @@ mod tests {
); );
let width = buf.size().0; let width = buf.size().0;
for (i, l) in lines.iter().enumerate() { for (i, l) in lines.iter().enumerate() {
buf.write_string_to_grid( buf.write_string(
l, l,
Color::Default, Color::Default,
Color::Default, Color::Default,

@ -131,7 +131,7 @@ impl StatusBar {
if !context.settings.terminal.use_color() { if !context.settings.terminal.use_color() {
attribute.attrs |= Attr::REVERSE; attribute.attrs |= Attr::REVERSE;
} }
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
&self.status, &self.status,
attribute.fg, attribute.fg,
attribute.bg, attribute.bg,
@ -174,7 +174,7 @@ impl StatusBar {
total_lines = *total_lines, total_lines = *total_lines,
has_more_lines = if *has_more_lines { "(+)" } else { "" } has_more_lines = if *has_more_lines { "(+)" } else { "" }
); );
grid.write_string_to_grid( grid.write_string(
&s, &s,
attribute.fg, attribute.fg,
attribute.bg, attribute.bg,
@ -236,7 +236,7 @@ impl StatusBar {
fn draw_command_bar(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { fn draw_command_bar(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) {
grid.clear_area(area, crate::conf::value(context, "theme_default")); grid.clear_area(area, crate::conf::value(context, "theme_default"));
let command_bar = crate::conf::value(context, "status.command_bar"); let command_bar = crate::conf::value(context, "status.command_bar");
let (_, y) = grid.write_string_to_grid( let (_, y) = grid.write_string(
self.ex_buffer.as_str(), self.ex_buffer.as_str(),
command_bar.fg, command_bar.fg,
command_bar.bg, command_bar.bg,
@ -429,7 +429,7 @@ impl Component for StatusBar {
.take(hist_height) .take(hist_height)
.enumerate() .enumerate()
{ {
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
s.as_str(), s.as_str(),
history_hints.fg, history_hints.fg,
history_hints.bg, history_hints.bg,
@ -443,7 +443,7 @@ impl Component for StatusBar {
), ),
Some(get_x(upper_left!(hist_area))), Some(get_x(upper_left!(hist_area))),
); );
grid.write_string_to_grid( grid.write_string(
&s.description, &s.description,
history_hints.fg, history_hints.fg,
history_hints.bg, history_hints.bg,
@ -465,7 +465,7 @@ impl Component for StatusBar {
), ),
history_hints, history_hints,
); );
grid.write_string_to_grid( grid.write_string(
&s.as_str()[self.ex_buffer.as_str().len()..], &s.as_str()[self.ex_buffer.as_str().len()..],
history_hints.fg, history_hints.fg,
history_hints.bg, history_hints.bg,
@ -865,7 +865,7 @@ impl Tabbed {
} else { } else {
tab_unfocused_attribute tab_unfocused_attribute
}; };
let (x_, _y_) = grid.write_string_to_grid( let (x_, _y_) = grid.write_string(
&format!(" {} ", c), &format!(" {} ", c),
fg, fg,
bg, bg,
@ -1007,7 +1007,7 @@ impl Component for Tabbed {
context.dirty_areas.push_back(dialog_area); context.dirty_areas.push_back(dialog_area);
grid.clear_area(dialog_area, self.theme_default); grid.clear_area(dialog_area, self.theme_default);
let inner_area = create_box(grid, dialog_area); let inner_area = create_box(grid, dialog_area);
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
"shortcuts", "shortcuts",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -1018,7 +1018,7 @@ impl Component for Tabbed {
), ),
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"Press {} to close", "Press {} to close",
children_maps[Shortcuts::GENERAL]["toggle_help"] children_maps[Shortcuts::GENERAL]["toggle_help"]
@ -1126,7 +1126,7 @@ impl Component for Tabbed {
self.help_content = self.help_content =
CellBuffer::new_with_context(max_width, max_length + 2, None, context); CellBuffer::new_with_context(max_width, max_length + 2, None, context);
self.help_content.set_growable(true); self.help_content.set_growable(true);
self.help_content.write_string_to_grid( self.help_content.write_string(
"use COMMAND \"search\" to find shortcuts", "use COMMAND \"search\" to find shortcuts",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -1136,7 +1136,7 @@ impl Component for Tabbed {
); );
let mut idx = 2; let mut idx = 2;
for (desc, shortcuts) in children_maps.iter() { for (desc, shortcuts) in children_maps.iter() {
self.help_content.write_string_to_grid( self.help_content.write_string(
desc, desc,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -1146,7 +1146,7 @@ impl Component for Tabbed {
); );
idx += 2; idx += 2;
for (k, v) in shortcuts { for (k, v) in shortcuts {
let (x, y) = self.help_content.write_string_to_grid( let (x, y) = self.help_content.write_string(
&format!( &format!(
"{: >width$}", "{: >width$}",
format!("{}", v), format!("{}", v),
@ -1158,7 +1158,7 @@ impl Component for Tabbed {
((2, 2 + idx), (max_width.saturating_sub(2), max_length - 1)), ((2, 2 + idx), (max_width.saturating_sub(2), max_length - 1)),
None, None,
); );
self.help_content.write_string_to_grid( self.help_content.write_string(
k, k,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -1183,7 +1183,7 @@ impl Component for Tabbed {
context.dirty_areas.push_back(dialog_area); context.dirty_areas.push_back(dialog_area);
grid.clear_area(dialog_area, self.theme_default); grid.clear_area(dialog_area, self.theme_default);
let inner_area = create_box(grid, dialog_area); let inner_area = create_box(grid, dialog_area);
let (x, y) = grid.write_string_to_grid( let (x, y) = grid.write_string(
"shortcuts", "shortcuts",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -1194,7 +1194,7 @@ impl Component for Tabbed {
), ),
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&format!( &format!(
"Press {} to close", "Press {} to close",
self.help_curr_views[Shortcuts::GENERAL]["toggle_help"] self.help_curr_views[Shortcuts::GENERAL]["toggle_help"]
@ -1279,7 +1279,7 @@ impl Component for Tabbed {
/* In this case we will be scrolling, so show the user how to do it */ /* In this case we will be scrolling, so show the user how to do it */
if height.wrapping_div(rows + 1) > 0 || width.wrapping_div(cols + 1) > 0 { if height.wrapping_div(rows + 1) > 0 || width.wrapping_div(cols + 1) > 0 {
self.help_content.write_string_to_grid( self.help_content.write_string(
"Use Up, Down, Left, Right to scroll.", "Use Up, Down, Left, Right to scroll.",
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,

@ -135,7 +135,7 @@ impl<T: 'static + PartialEq + std::fmt::Debug + Clone + Sync + Send> Component f
* cursor */ * cursor */
self.entries[c].1 = !self.entries[c].1; self.entries[c].1 = !self.entries[c].1;
if self.entries[c].1 { if self.entries[c].1 {
self.content.write_string_to_grid( self.content.write_string(
"x", "x",
highlighted_attrs.fg, highlighted_attrs.fg,
highlighted_attrs.bg, highlighted_attrs.bg,
@ -144,7 +144,7 @@ impl<T: 'static + PartialEq + std::fmt::Debug + Clone + Sync + Send> Component f
None, None,
); );
} else { } else {
self.content.write_string_to_grid( self.content.write_string(
" ", " ",
highlighted_attrs.fg, highlighted_attrs.fg,
highlighted_attrs.bg, highlighted_attrs.bg,
@ -460,7 +460,7 @@ impl Component for UIConfirmationDialog {
* cursor */ * cursor */
self.entries[c].1 = !self.entries[c].1; self.entries[c].1 = !self.entries[c].1;
if self.entries[c].1 { if self.entries[c].1 {
self.content.write_string_to_grid( self.content.write_string(
"x", "x",
highlighted_attrs.fg, highlighted_attrs.fg,
highlighted_attrs.bg, highlighted_attrs.bg,
@ -469,7 +469,7 @@ impl Component for UIConfirmationDialog {
None, None,
); );
} else { } else {
self.content.write_string_to_grid( self.content.write_string(
" ", " ",
highlighted_attrs.fg, highlighted_attrs.fg,
highlighted_attrs.bg, highlighted_attrs.bg,
@ -815,7 +815,7 @@ impl<T: PartialEq + std::fmt::Debug + Clone + Sync + Send, F: 'static + Sync + S
let mut content = CellBuffer::new_with_context(width, height, None, context); let mut content = CellBuffer::new_with_context(width, height, None, context);
if self.single_only { if self.single_only {
for (i, e) in self.entry_titles.iter().enumerate() { for (i, e) in self.entry_titles.iter().enumerate() {
content.write_string_to_grid( content.write_string(
e, e,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -826,7 +826,7 @@ impl<T: PartialEq + std::fmt::Debug + Clone + Sync + Send, F: 'static + Sync + S
} }
} else { } else {
for (i, e) in self.entry_titles.iter().enumerate() { for (i, e) in self.entry_titles.iter().enumerate() {
content.write_string_to_grid( content.write_string(
&format!("[ ] {}", e), &format!("[ ] {}", e),
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -835,7 +835,7 @@ impl<T: PartialEq + std::fmt::Debug + Clone + Sync + Send, F: 'static + Sync + S
None, None,
); );
} }
content.write_string_to_grid( content.write_string(
OK_CANCEL, OK_CANCEL,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -887,7 +887,7 @@ impl<T: PartialEq + std::fmt::Debug + Clone + Sync + Send, F: 'static + Sync + S
let inner_area = create_box(grid, dialog_area); let inner_area = create_box(grid, dialog_area);
grid.clear_area(inner_area, self.theme_default); grid.clear_area(inner_area, self.theme_default);
grid.write_string_to_grid( grid.write_string(
&self.title, &self.title,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,
@ -899,7 +899,7 @@ impl<T: PartialEq + std::fmt::Debug + Clone + Sync + Send, F: 'static + Sync + S
None, None,
); );
grid.write_string_to_grid( grid.write_string(
&navigate_help_string, &navigate_help_string,
self.theme_default.fg, self.theme_default.fg,
self.theme_default.bg, self.theme_default.bg,

@ -353,7 +353,7 @@ impl Pager {
.skip(self.cursor.1) .skip(self.cursor.1)
.take(height!(area)) .take(height!(area))
{ {
grid.write_string_to_grid( grid.write_string(
l, l,
self.colors.fg, self.colors.fg,
self.colors.bg, self.colors.bg,
@ -635,7 +635,7 @@ impl Component for Pager {
if !context.settings.terminal.use_color() { if !context.settings.terminal.use_color() {
attribute.attrs |= Attr::REVERSE; attribute.attrs |= Attr::REVERSE;
} }
let (_, y) = grid.write_string_to_grid( let (_, y) = grid.write_string(
&status_message, &status_message,
attribute.fg, attribute.fg,
attribute.bg, attribute.bg,

@ -171,7 +171,7 @@ impl Component for TextField {
* +++ * +++
* skip offset * skip offset
*/ */
grid.write_string_to_grid( grid.write_string(
if width < self.inner.grapheme_pos() { if width < self.inner.grapheme_pos() {
str.trim_left_at_boundary( str.trim_left_at_boundary(
width width

@ -118,7 +118,7 @@ impl Component for Field {
text_field.draw(grid, area, context); text_field.draw(grid, area, context);
} }
Self::Choice(_, _, _) => { Self::Choice(_, _, _) => {
grid.write_string_to_grid( grid.write_string(
str, str,
theme_attr.fg, theme_attr.fg,
theme_attr.bg, theme_attr.bg,
@ -365,7 +365,7 @@ impl<T: 'static + std::fmt::Debug + Copy + Default + Send + Sync> Component for
for (i, k) in self.layout.iter().enumerate().rev() { for (i, k) in self.layout.iter().enumerate().rev() {
let v = self.fields.get_mut(k).unwrap(); let v = self.fields.get_mut(k).unwrap();
/* Write field label */ /* Write field label */
grid.write_string_to_grid( grid.write_string(
k.as_ref(), k.as_ref(),
label_attrs.fg, label_attrs.fg,
label_attrs.bg, label_attrs.bg,
@ -651,7 +651,7 @@ where
let mut len = 0; let mut len = 0;
for (i, k) in self.layout.iter().enumerate() { for (i, k) in self.layout.iter().enumerate() {
let cur_len = k.len(); let cur_len = k.len();
grid.write_string_to_grid( grid.write_string(
k.as_ref(), k.as_ref(),
theme_default.fg, theme_default.fg,
if i == self.cursor && self.focus { if i == self.cursor && self.focus {
@ -875,7 +875,7 @@ impl AutoComplete {
); );
let width = content.cols(); let width = content.cols();
for (i, e) in entries.iter().enumerate() { for (i, e) in entries.iter().enumerate() {
let (x, _) = content.write_string_to_grid( let (x, _) = content.write_string(
&e.entry, &e.entry,
Color::Byte(23), Color::Byte(23),
Color::Byte(7), Color::Byte(7),
@ -883,7 +883,7 @@ impl AutoComplete {
((0, i), (width - 1, i)), ((0, i), (width - 1, i)),
None, None,
); );
content.write_string_to_grid( content.write_string(
&e.description, &e.description,
Color::Byte(23), Color::Byte(23),
Color::Byte(7), Color::Byte(7),
@ -891,7 +891,7 @@ impl AutoComplete {
((x + 2, i), (width - 1, i)), ((x + 2, i), (width - 1, i)),
None, None,
); );
content.write_string_to_grid( content.write_string(
"▒", "▒",
Color::Byte(23), Color::Byte(23),
Color::Byte(7), Color::Byte(7),
@ -1239,7 +1239,7 @@ impl Component for ProgressSpinner {
if self.dirty { if self.dirty {
grid.clear_area(area, self.theme_attr); grid.clear_area(area, self.theme_attr);
if self.active { if self.active {
grid.write_string_to_grid( grid.write_string(
match self.kind.as_ref() { match self.kind.as_ref() {
Ok(kind) => (Self::KINDS[*kind].1)[self.stage], Ok(kind) => (Self::KINDS[*kind].1)[self.stage],
Err(custom) => custom[self.stage].as_ref(), Err(custom) => custom[self.stage].as_ref(),

@ -179,7 +179,7 @@ impl Component for EmbedContainer {
.iter() .iter()
.enumerate() .enumerate()
{ {
grid.write_string_to_grid( grid.write_string(
l, l,
theme_default.fg, theme_default.fg,
theme_default.bg, theme_default.bg,

Loading…
Cancel
Save