Make setting options global

This commit is contained in:
Zachary Yedidia
2016-08-17 20:00:38 -07:00
parent 7474fdc499
commit e4b6a931de
3 changed files with 56 additions and 47 deletions

View File

@@ -165,12 +165,14 @@ func NewTab(args []string) {
// Set sets an option
func Set(args []string) {
// Set an option and we have to set it for every view
for _, tab := range tabs {
for _, view := range tab.views {
SetOption(view, args)
}
if len(args) < 2 {
return
}
option := strings.TrimSpace(args[0])
value := strings.TrimSpace(args[1])
SetOption(option, value)
}
// Bind creates a new keybinding