From 18308c41c3704dca32a5463c75bacd65be20e2a6 Mon Sep 17 00:00:00 2001 From: Joshua Reusch Date: Sat, 12 Oct 2024 16:00:05 +0200 Subject: [PATCH] docs --- src/string_width.gleam | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/string_width.gleam b/src/string_width.gleam index 2c0f8b1..48521d1 100644 --- a/src/string_width.gleam +++ b/src/string_width.gleam @@ -1,6 +1,6 @@ //// #### Measure //// [line](#line), [line_with](#line_with), -//// [dimensions](#dimensions), [dimensions_with](#dimensions_with) +//// [dimensions](#dimensions), [dimensions_with](#dimensions_with), //// [get_terminal_size](#get_terminal_size) //// //// #### Layout @@ -206,7 +206,7 @@ pub fn line(str: String) -> Int { /// ```gleam /// let options = /// new() -/// |> mode +/// |> mode_2027 /// /// line_with("👩‍👩‍👦‍👦", options) /// // --> 2 @@ -975,13 +975,13 @@ pub fn fold_with( /// /// ```gleam /// // truncate a string after 50 characters, but keep all ansi sequences. -/// use #(total, acc), chr, width <- fold_raw(input, new(), from: #(0, "")) +/// let options = new() +/// use #(total, acc), chr, width <- fold_raw(input, options, from: #(0, "")) /// case total >= 50 { -/// True -> case chr { -/// "\u{1b}" <> _ -> #(total, acc <> chr) -/// _ -> #(total, acc) +/// True -> case is_ansi_component(chr, options) { +/// True -> #(total, acc <> chr) +/// False -> #(total, acc) /// } -/// /// False -> #(total + width, acc <> chr) /// } /// ``` -- 2.51.2