Move printedFull closer to its use, document

This commit is contained in:
Laurence Withers 2023-07-07 11:21:41 +01:00
parent 67f81d2728
commit 5694cc5194
2 changed files with 9 additions and 1 deletions

View File

@ -68,6 +68,15 @@ func (nptf *notPlainTextFlag) Type() string {
return "short|full|skip" // ???
}
var (
// printedFull is set by file() if it prints a full file's matches
// (i.e. a header line, then the match lines). It is cleared if we
// just printed a "Binary file <foo> matches" line. It lets us have a
// nice one-line separator between full files, but show the binary
// matches compactly.
printedFull bool
)
func file(path string, data []byte) {
var short string
isBinary, isMinified := notPlainText(data)

View File

@ -63,7 +63,6 @@ var (
ignoreCase bool
noColour bool
display *Display
printedFull bool
)
func init() {