From: Junio C Hamano Date: Wed, 18 Nov 2026 21:49:08 GMT Subject: Re: [PATCH v2 3/4] utf8: respect string boundaries after skipping ANSI escape sequences Message-ID: In-Reply-To: <20261118-master-v2-3-3f2aaec15d31@gouders.net> Dirk Gouders writes: > - while (skip_ansi && > - (skip = display_mode_esc_sequence_len_counted(string, > - orig + len - string)) != 0) > - string += skip; > + if (skip_ansi ) { Drop excess SP after the variable. > + while ((skip = display_mode_esc_sequence_len_counted(string, > + orig + len - string)) != 0) > + string += skip; Overlong line. You can (and are encouraged to) omit comparison with zero "!= 0" to lose 5 columns but it still is overly long. if (skip_ansi) { while ((skip = display_mode_esc_sequence_len_counted( string, orig + len - string))) string += skip; or something, perhaps. > + if (string >= orig + len) > + break; > + } > > glyph_width = utf8_width(&string, NULL); > if (glyph_width > 0)