Skip to content
  • René Scharfe's avatar
    column: use utf8_strnwidth() to strip out ANSI color escapes · a81e42d2
    René Scharfe authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Make use of utf8_strnwidth()'s feature to skip ANSI escape sequences
    instead of open-coding it.  This shortens the code and makes it more
    consistent.
    
    This changes the behavior, though: The old code skips all kinds of
    Control Sequence Introducer sequences, while utf8_strnwidth() only skips
    the Select Graphic Rendition kind, i.e. those ending with "m".  They are
    used for specifying color and font attributes like boldness.  The only
    other kind of escape sequence we print in Git is Erase in Line, ending
    with "K".  That's not used for columnar output, so this difference
    actually doesn't matter here.
    
    Signed-off-by: default avatarRené Scharfe <l.s.r@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a81e42d2