Re: [RFC/PATCH] graph API: Added logic for colored edges.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 31, 2009, 10:13 UTC
- Message-ID
- <alpine.DEB.1.00.0903311210000.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <20090330141322.GA6221@linux.vnet>
Hi,
On Mon, 30 Mar 2009, Allan Caffee wrote:
Show 8 quoted lines
> +static void strbuf_write_column(struct strbuf *sb, const struct column *c,
> + const char *s)
> +{
> + /*
> + * TODO: I get the creeping suspicion that this isn't the
> + * right flag to be checking since --no-color doesn't turn
> + * this off.
> + */Heh, of course I forgot to remove this with my to-be-squashed-in patch...
Show 6 quoted lines
> + if (diff_use_color_default) > + strbuf_addstr(sb, c->color); > + strbuf_addstr(sb, s); > + if (diff_use_color_default) > + strbuf_addstr(sb, GIT_COLOR_RESET); > +}
How about this function instead?
static void strbuf_add_column(struct strbuf *sb,
const struct column *column, const char *fmt, ...)
{
va_list ap; va_start(ap, fmt);
if (column->color)
strbuf_addstr(sb, column->color);
strbuf_vaddf(sb, fmt, ap);
if (column->color)
strbuf_addstr(sb, GIT_COLOR_RESET);
va_end(ap);
}Hmm?
Ciao, Dscho