Re: [PATCH] Make words boundary for --color-words configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 2 May 2008, Ping Yin wrote:

> Previously --color-words only allow spaces as words boundary. However, 
> just space is not enough. For example, when i rename a function from foo 
> to bar, following example doesn't show as expected when using 
> --color-words.

Thanks for starting this.

However, as Junio pointed out, it is easier to specify word-characters, 
rather than non-word characters (think TAB), and...

> +static int iswordsboundary(char c)
> +{
> +	return isspace(c) || !!strchr(diff_words_boundary, c);
> +}

this will be called quite some times.  So it would make more sense to have 
an "unsigned char word_characters[256]" and set those entries to 1 that 
are to be interpreted as word characters.

This would allow you also to interpret "0-9A-Za-z" correctly.

Oh, and maybe having "::default" and "::alnum" suffixes interpreted, so 
that I can say "_::alnum" to have C identifiers interpreted as words?

Thanks,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux