From e9baf0c4b688fab291cdc842ec464c7a7a816499 Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Tue, 23 Mar 2021 18:18:02 +0000 Subject: [PATCH] fix: empty text file on editor --- files/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/file.go b/files/file.go index c1451878..3892d991 100644 --- a/files/file.go +++ b/files/file.go @@ -170,7 +170,7 @@ func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error { case strings.HasPrefix(mimetype, "image"): i.Type = "image" return nil - case (strings.HasPrefix(mimetype, "text") || (len(buffer) > 0 && !isBinary(buffer))) && i.Size <= 10*1024*1024: // 10 MB + case (strings.HasPrefix(mimetype, "text") || !isBinary(buffer)) && i.Size <= 10*1024*1024: // 10 MB i.Type = "text" if !modify {