Make mode_translations optional in colorschemes

This commit is contained in:
Kim Silkebækken 2013-01-16 08:47:49 +01:00
parent b7ff63ccc0
commit 884bbd3f29
3 changed files with 3 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class Colorscheme(object):
}
# Create mode-specific highlighting for this group
for mode, translations in colorscheme['mode_translations'].items():
for mode, translations in colorscheme.get('mode_translations', {}).items():
if not mode in self.modes_groups:
self.modes_groups[mode] = {}
if group_name in translations.get('groups', {}):

View File

@ -58,6 +58,5 @@
"branch": { "fg": "gray9", "bg": "gray4" },
"cwd": { "fg": "gray10", "bg": "gray4" },
"hostname": { "fg": "brightyellow", "bg": "mediumorange" }
},
"mode_translations": { }
}
}

View File

@ -24,6 +24,5 @@
"system_load_bad": { "fg": "yellow", "bg": "darkestblue" },
"system_load_ugly": { "fg": "red", "bg": "darkestblue" },
"uptime": { "fg": "brightblue", "bg": "darkestblue" }
},
"mode_translations": { }
}
}