Don't automatically disable readonly option
Fix the regression after 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.
@@ -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
}
