Fix stat error detection

Fixes #1955
This commit is contained in:
Zachary Yedidia
2020-12-20 13:05:10 -05:00
parent 6b7c04b421
commit 299ba2fe97

View File

@@ -218,7 +218,7 @@ func NewBufferFromFileAtLoc(path string, btype BufType, cursorLoc Loc) (*Buffer,
file, err := os.Open(filename)
fileInfo, serr := os.Stat(filename)
if serr != nil {
if serr != nil && !os.IsNotExist(serr) {
return nil, serr
}