comparison tests/test-grep.t @ 41739:8ab42ccb68fe

grep: give different labels to + and - symbols I find it more useful to give different colours to plus and minus, but it's difficult to do so if the default output uses the same label for both. The following augments the names of columns with some extra labels, akin to the diff.inserted and diff.deleted labels for the diff command. This is done by adding an extra label field to the columns tuples.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 15 Feb 2019 15:24:04 -0500
parents 5d383d9636d0
children ee77a6dd8fb8
comparison
equal deleted inserted replaced
41738:c70bdd222dcd 41739:8ab42ccb68fe
297 color:3:orange 297 color:3:orange
298 $ hg grep --all orange 298 $ hg grep --all orange
299 color:3:+:orange 299 color:3:+:orange
300 color:2:-:orange 300 color:2:-:orange
301 color:1:+:orange 301 color:1:+:orange
302 $ hg grep --diff orange --color=debug
303 [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.inserted grep.change|+][grep.sep|:][grep.match|orange]
304 [grep.filename|color][grep.sep|:][grep.rev|2][grep.sep|:][grep.deleted grep.change|-][grep.sep|:][grep.match|orange]
305 [grep.filename|color][grep.sep|:][grep.rev|1][grep.sep|:][grep.inserted grep.change|+][grep.sep|:][grep.match|orange]
302 306
303 $ hg grep --diff orange 307 $ hg grep --diff orange
304 color:3:+:orange 308 color:3:+:orange
305 color:2:-:orange 309 color:2:-:orange
306 color:1:+:orange 310 color:1:+:orange