Set filetype to 'off' to disable completely

Ref #1427
This commit is contained in:
Zachary Yedidia
2020-01-02 19:00:42 -05:00
parent 2855ae204c
commit ddc8bf455e
4 changed files with 33 additions and 23 deletions

View File

@@ -540,6 +540,7 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
} else {
screen.Screen.EnableMouse()
}
// autosave option has been removed
// } else if option == "autosave" {
// if nativeValue.(float64) > 0 {
// config.SetAutoTime(int(nativeValue.(float64)))
@@ -554,9 +555,15 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
if option == pl.Name {
if nativeValue.(bool) && !pl.Loaded {
pl.Load()
pl.Call("init")
_, err := pl.Call("init")
if err != nil && err != config.ErrNoSuchFunction {
screen.TermMessage(err)
}
} else if !nativeValue.(bool) && pl.Loaded {
pl.Call("deinit")
_, err := pl.Call("deinit")
if err != nil && err != config.ErrNoSuchFunction {
screen.TermMessage(err)
}
}
}
}