aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-10-17 23:44:12 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-11-08 13:37:23 +0100
commit55d22938311853415506860342511297827d00c1 (patch)
tree836df047a0be4c0e431519e0a62e162412174181 /vis-cmds.c
parent87c609e4c53202b4151c09bf479dc615eab4f84e (diff)
downloadvis-55d22938311853415506860342511297827d00c1.tar.gz
vis-55d22938311853415506860342511297827d00c1.tar.xz
vis: implement :set theme
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 8ec7653..09edd58 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -159,6 +159,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char *
OPTION_NUMBER,
OPTION_NUMBER_RELATIVE,
OPTION_CURSOR_LINE,
+ OPTION_THEME,
};
/* definitions have to be in the same order as the enum above */
@@ -171,6 +172,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char *
[OPTION_NUMBER] = { { "numbers", "nu" }, OPTION_TYPE_BOOL },
[OPTION_NUMBER_RELATIVE] = { { "relativenumbers", "rnu" }, OPTION_TYPE_BOOL },
[OPTION_CURSOR_LINE] = { { "cursorline", "cul" }, OPTION_TYPE_BOOL },
+ [OPTION_THEME] = { { "theme" }, OPTION_TYPE_STRING },
};
if (!vis->options) {
@@ -215,6 +217,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char *
vis_info_show(vis, "Expecting string option value");
return false;
}
+ arg.s = argv[2];
break;
case OPTION_TYPE_BOOL:
if (!argv[2]) {
@@ -324,6 +327,12 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char *
view_options_set(vis->win->view, opt);
break;
}
+ case OPTION_THEME:
+ if (!vis_theme_load(vis, arg.s)) {
+ vis_info_show(vis, "Failed to load theme: `%s'", arg.s);
+ return false;
+ }
+ break;
}
return true;