Ping Yin <pkufranky@xxxxxxxxx> writes: > 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. > > ------------------ > - if (foo(arg)) > + if (bar(arg)) > ------------------ > > It shows as "if <r>(foo(arg))</r><g>(foo(arg))</g>". Actually, it's the > best to show as "if (<r>foo</r><g>bar</g>(arg))". Here "r" and "g" > represent "red" and "green" separately. > > This patch introduces a configuration diff.wordsboundary to make > --color-words treat both spaces and characters in diff.wordsboundary as > boundary characters. Just an idle thought. I suspect a more natural definition of word boundary is between a run of word characters and a run of non-word characters. IOW, instead of saying " " and "(these other)" characters are boundary, you would say if (foo(arg)) between f and space, open paren and f, second o and open paren, that open paren and a, ... are boundaries. If you go that route, you would make the definition of "what is the set of word characters" configurable. -- 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