check null bytes instead to detect binaries
This commit is contained in:
parent
751dbe8a7c
commit
7fe72c188f
7
ui.go
7
ui.go
@ -443,11 +443,8 @@ func (ui *UI) loadFile(nav *Nav) {
|
|||||||
|
|
||||||
for i := 0; i < nav.height && buf.Scan(); i++ {
|
for i := 0; i < nav.height && buf.Scan(); i++ {
|
||||||
for _, r := range buf.Text() {
|
for _, r := range buf.Text() {
|
||||||
if unicode.IsSpace(r) {
|
if r == 0 {
|
||||||
continue
|
ui.regprev = []string{"[1mbinary[0m"}
|
||||||
}
|
|
||||||
if !unicode.IsPrint(r) && r != EscapeCode {
|
|
||||||
ui.regprev = []string{"binary"}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user