Re: [PATCH v2 4/6] grep.c: display column number of first match
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 23, 2018, 01:12 UTC
- Message-ID
- <20180423011244.GB78148@syl.local>
- In-Reply-To
- <CAPig+cR0unM2uKcapHyAFrvMyPx4VgsW4wDswb_GNwE4EcYb8Q@mail.gmail.com>
On Sun, Apr 22, 2018 at 08:24:55PM -0400, Eric Sunshine wrote:
Show 15 quoted lines
> On Sun, Apr 22, 2018 at 4:47 PM, Taylor Blau <me@ttaylorr.com> wrote: > > Building upon our work in the previous commit to add members 'columnnum' > > and 'color_columno' to 'grep_opt', we teach show_line() how to respect > > those options. > > > > When requested, show_line() will display the column number of the first > > match on a non-context line. show_line() differentiates between context > > and non-context lines through the '&& cno' check. 'cno' will be equal to > > zero if and only if show_line() is invoked on a context line. It will be > > a non-zero value otherwise. > > This interpretation of 'cno' seems important enough to deserve an > in-code comment. (And, you may be able to drop some of the same > information from the commit message if it merely duplicates the > in-code comment.)
Thanks, I agree that the interpretation of 'cno' is subtle and should not require a 'git blame' to understand. I have adopted your proposed commit structure [1] and moved this description from the patch message into grep.c as a comment above the relevant conditional.
Thanks, Taylor