[PATCH take 3 0/4] color-words improvements
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 14, 2009, 17:49 UTC
- Message-ID
- <alpine.DEB.1.00.0901141840100.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <7vprisj26i.fsf@gitster.siamese.dyndns.org>
This series is getting bigger and bigger, unfortunately, just what I tried to avoid.
But at least I am pretty comfortable with the readability of the result, and it adds tests -- finally.
Changes relative to the last round: color_fwrite_lines() had problems with empty lines, and find_word_boundary() was replaced by find_word_boundaries(), which finds not only the end of the next word, but the start, too.
The only "funny" thing I realized is that the lines which are output by emit_line() add a RESET at the end of the line, and I do not do that in color_fwrite_lines().
Can anybody think of undesired behavior as a consequence?
Johannes Schindelin (4):
Add color_fwrite_lines(), a function coloring each line individually
color-words: refactor word splitting and use ALLOC_GROW()
color-words: change algorithm to allow for 0-character word
boundaries
color-words: take an optional regular expression describing wordsDocumentation/diff-options.txt | 6 +- color.c | 28 ++++++ color.h | 1 + diff.c | 203 ++++++++++++++++++++++++++-------------- diff.h | 1 + t/t4034-diff-words.sh | 86 +++++++++++++++++ 6 files changed, 253 insertions(+), 72 deletions(-) create mode 100755 t/t4034-diff-words.sh