term: micro optimize flush_print: directly call grapheme_column_width

Saves an additional call through unicode segmentation
This commit is contained in:
Wez Furlong committed 2021-08-11 23:06:16 -07:00
1 parent d51f5f7670
commit 1e7c7e7059
1 file changed
+2 -2
+2 -2
View File
@@ -6,7 +6,7 @@ use log::{debug, error};
use num_traits::FromPrimitive;
use std::fmt::Write;
use std::ops::{Deref, DerefMut};
use termwiz::cell::{unicode_column_width, Cell, CellAttributes, SemanticType};
use termwiz::cell::{grapheme_column_width, Cell, CellAttributes, SemanticType};
use termwiz::escape::csi::EraseInDisplay;
use termwiz::escape::osc::{
ChangeColorPair, ColorOrQuery, FinalTermSemanticPrompt, ITermProprietary, Selection,
@@ -134,7 +134,7 @@ impl<'a> Performer<'a> {
// they occupy a cell so that we can re-emit them when we output them.
// If we didn't do this, then we'd effectively filter them out from
// the model, which seems like a lossy design choice.
let print_width = unicode_column_width(g).max(1);
let print_width = grapheme_column_width(g).max(1);
let is_last = graphemes.peek().is_none();
let wrappable = x + print_width >= width;