Re: [PATCH 5/5] progress: break too long progress bar lines
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Mar 25, 2019, 11:12 UTC
- Message-ID
- <20190325111255.GK22459@szeder.dev>
- In-Reply-To
- <CACsJy8AYC24tbDhq6LJ5FgZEcSsOYTuw-G88eXdKzbT6iP3NNw@mail.gmail.com>
On Mon, Mar 25, 2019 at 06:02:13PM +0700, Duy Nguyen wrote:
Show 8 quoted lines
> > @@ -225,6 +241,8 @@ static struct progress *start_progress_delay(const char *title, uint64_t total, > > progress->throughput = NULL; > > progress->start_ns = getnanotime(); > > strbuf_init(&progress->counters_sb, 0); > > + progress->title_len = strlen(title); > > I think you need utf8_strwidth() so that the "cols < title_len" > comparison above works for multibyte encoding too.
Oh, indeed. I remember seeing the Chinese translation and wondering about it, but then completely forgot by the time I got around to it.
Show 11 quoted lines
> > + progress->split = 0; > > set_progress_signal(); > > return progress; > > } > > -- > > 2.21.0.539.g07239c3a71.dirty > > > > > -- > Duy