fix: empty text file on editor

pull/1353/head
Ramires Viana 2021-03-23 18:18:02 +00:00
parent e1a6f593e1
commit e9baf0c4b6
1 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,7 @@ func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
case strings.HasPrefix(mimetype, "image"): case strings.HasPrefix(mimetype, "image"):
i.Type = "image" i.Type = "image"
return nil 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" i.Type = "text"
if !modify { if !modify {