From 72b44fb3fcda8178e0ec9c0f6ce0b023a127fd85 Mon Sep 17 00:00:00 2001 From: Joscha Date: Fri, 17 Feb 2023 20:25:23 +0100 Subject: [PATCH] Add back optional Terminal::measuring_required --- src/terminal.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/terminal.rs b/src/terminal.rs index 0adf87d..52906af 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -135,13 +135,21 @@ impl Terminal { self.frame.widthdb.active } - /// Measure widths of newly encountered graphemes. + /// Whether any unmeasured graphemes were seen since the last call to + /// [`Self::measure_widths`]. + /// + /// Returns `true` whenever [`Self::measure_widths`] would return `true`. + pub fn measuring_required(&self) -> bool { + self.frame.widthdb.measuring_required() + } + + /// Measure widths of all unmeasured graphemes. /// /// If width measurements are disabled, this function does nothing. For more /// info, see [`Self::measuring`]. /// - /// Returns `true` if graphemes were measured and the screen must be - /// redrawn. Keep in mind that after redrawing the screen, new graphemes may + /// Returns `true` if any new graphemes were measured and the screen must be + /// redrawn. Keep in mind that after redrawing the screen, graphemes may /// have become visible that have not yet been measured. You should keep /// re-measuring and re-drawing until this function returns `false`. pub fn measure_widths(&mut self) -> io::Result {