L.SetGlobal("Reload", luar.New(L, LoadAll))
L.SetGlobal("ByteOffset", luar.New(L, ByteOffset))
L.SetGlobal("ToCharPos", luar.New(L, ToCharPos))
+ L.SetGlobal("NewViewType", luar.New(L, NewViewType))
// Used for asynchronous jobs
L.SetGlobal("JobStart", luar.New(L, JobStart))
scratch bool // The file cannot be saved
}
+// NewViewType creates a new ViewType - useful for plugins
+func NewViewType(kind int, readonly, scratch bool) ViewType {
+ return ViewType{kind, readonly, scratch}
+}
+
var (
vtDefault = ViewType{0, false, false}
vtHelp = ViewType{1, true, true}