|
@@ -141,7 +141,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri
|
|
n, _ := dataRc.Read(buf)
|
|
n, _ := dataRc.Read(buf)
|
|
buf = buf[:n]
|
|
buf = buf[:n]
|
|
|
|
|
|
- isTextFile := tool.IsTextFile(buf)
|
|
|
|
|
|
+ isTextFile := tool.IsTextFile(buf) && !tool.IsAnnexedFile(buf)
|
|
c.Data["IsTextFile"] = isTextFile
|
|
c.Data["IsTextFile"] = isTextFile
|
|
|
|
|
|
// Assume file is not editable first.
|
|
// Assume file is not editable first.
|
|
@@ -212,6 +212,8 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri
|
|
c.Data["IsVideoFile"] = true
|
|
c.Data["IsVideoFile"] = true
|
|
case tool.IsImageFile(buf):
|
|
case tool.IsImageFile(buf):
|
|
c.Data["IsImageFile"] = true
|
|
c.Data["IsImageFile"] = true
|
|
|
|
+ case tool.IsAnnexedFile(buf):
|
|
|
|
+ c.Data["IsAnnexedFile"] = true
|
|
}
|
|
}
|
|
|
|
|
|
if canEnableEditor {
|
|
if canEnableEditor {
|