git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/4] utf8: add display_mode_esc_sequence_len_counted()

From
Dirk Gouders <dirk@gouders.net>
Date
Nov 19, 2026, 21:33 UTC
Message-ID
<ghld6o1p6x.fsf@gouders.net>
In-Reply-To
<CAHWeT-YX8FOacV7YypyZ-qmr3Q2T0TEF=_Qy2bVE7jcS0OWvNA@mail.gmail.com>
On Thu, Nov 19 2026, Andy Koppe wrote:
Show 18 quoted lines
> Andy Koppe wrote:
>> Dirk Gouders wrote:
>> > There is only one user in pretty.c that uses the wrapper.
>> > I can change it to use the _counted version and we could then drop the
>> > wrapper.  Junio's v1 already included such a change and I could steal it
>> > from there.
>> >
>> > Would that be OK?
>>
>> No objection from me. I would change the make_line_colors_self_contained()
>> function I'm proposing in [1] to the _counted variant anyway if the original
>> display_mode_esc_sequence_len() is going away, to avoid the performance issue
>> with the wrapper.
>>
>> [1] https://lore.kernel.org/git/e9f88b533dfbd10528c9151e2e87207419d0253d.1794905511.git.andy.koppe@gmail.com
>
> ps: I guess you might as well just drop the _counted suffix then, and
> basically just add the len parameter to display_mode_esc_sequence_len().

That was the plan. I just checked v1 and all this would actually mean to use Junio's v1 instead of v2.

Dirk
Previous: Andy KoppeNext: Dirk Gouders
Message 15 of 26 in “utf8: two minor fixes”
  1. 0/2 utf8: two minor fixesDirk Gouders, Nov 16, 2026
  2. 1/2 utf8: respect bounds in utf8_strnwidth()Dirk Gouders, Nov 16, 2026
  3. Junio C HamanoNov 17, 2026
  4. Dirk GoudersNov 17, 2026
  5. Junio C HamanoNov 17, 2026
  6. Dirk GoudersNov 17, 2026
  7. Junio C HamanoNov 17, 2026
  8. 2/2 utf8: fix comment for utf8_strnwidth()Dirk Gouders, Nov 16, 2026
  9. 0/4 utf8: bounds-related fixes and a doc fixDirk Gouders, Nov 18, 2026
  10. 1/4 utf8: add display_mode_esc_sequence_len_counted()Dirk Gouders, Nov 18, 2026
  11. Andy KoppeNov 19, 2026
  12. Dirk GoudersNov 19, 2026
  13. Andy KoppeNov 19, 2026
  14. Andy KoppeNov 19, 2026
  15. Dirk GoudersNov 19, 2026
  16. Dirk GoudersNov 19, 2026
  17. Dirk GoudersNov 19, 2026
  18. Junio C HamanoNov 19, 2026
  19. Dirk GoudersNov 19, 2026
  20. 2/4 utf8: fix comment for utf8_strnwidth()Dirk Gouders, Nov 18, 2026
  21. Andy KoppeNov 18, 2026
  22. Dirk GoudersNov 19, 2026
  23. 3/4 utf8: respect string boundaries after skipping ANSI escape sequencesDirk Gouders, Nov 18, 2026
  24. Junio C HamanoNov 18, 2026
  25. 4/4 utf8: respect boundaries in utf8_strnwidth()Dirk Gouders, Nov 18, 2026
  26. Junio C HamanoNov 18, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.