-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Small colour/filtering related bug #2962
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingin-progressMark issue as being worked onMark issue as being worked on
Description
Describe the bug
A function's colour parameter is not used as intended.
See internal/color/colorize.go:
// Highlight colorize bytes at given indices.
func Highlight(bb []byte, ii []int, c int) []byte { // <----(!)
b := make([]byte, 0, len(bb))
for i, j := 0, 0; i < len(bb); i++ {
if j < len(ii) && ii[j] == i {
b = append(b, colorizeByte(bb[i], 209)...) // <----(!)
j++
} else {
b = append(b, bb[i])
}
}
return b
}The third parameter for colour c is not used but instead the colour value 209 is hardcoded.
To Reproduce
Just noticed the issue during code analysis as preparation for a potential enhancement.
Historical Documents
n/a
Expected behavior
The requested highlighting colour should be applied, not a fixed value.
Screenshots
n/a
Versions (please complete the following information):
Branch master 9984e3f
Additional context
n/a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingin-progressMark issue as being worked onMark issue as being worked on
