Don't automatically disable readonly option (#1957)

Fix the regression after 3b34a02: setting readonly option to true
in onBufferOpen lua callback doesn't work, since it is automatically
reset to false if write permission is not denied.
This commit is contained in:
Dmitry Maluka
2020-12-23 21:21:20 +01:00
committed by GitHub
parent e4f7f80862
commit 57a3927f02

View File

@@ -239,7 +239,9 @@ func NewBufferFromFileAtLoc(path string, btype BufType, cursorLoc Loc) (*Buffer,
buf = NewBuffer(file, util.FSize(file), filename, cursorLoc, btype)
}
buf.SetOptionNative("readonly", readonly)
if readonly {
buf.SetOptionNative("readonly", true)
}
return buf, nil
}