diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-11-19 10:38:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-11-19 10:38:06 +0000 |
commit | 827b311c8172f3543f9c38dc1d7740bba1d9aeaa (patch) | |
tree | dd900064b22c06b7f2d608d475288ae5000b0569 /cfg.c | |
parent | c68efec6c0f1a6ecf4950e4ddada4430fdea4156 (diff) |
Use a utility function for common code to show errors in config file,
from Thomas Adam.
Diffstat (limited to 'cfg.c')
-rw-r--r-- | cfg.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -173,3 +173,25 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes) return (retval); } + +void +show_cfg_causes(struct session *s) +{ + struct window_pane *wp; + char *cause; + u_int i; + + if (s == NULL || ARRAY_EMPTY(&cfg_causes)) + return; + + wp = s->curw->window->active; + + window_pane_set_mode(wp, &window_copy_mode); + window_copy_init_for_output(wp); + for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) { + cause = ARRAY_ITEM(&cfg_causes, i); + window_copy_add(wp, "%s", cause); + free(cause); + } + ARRAY_FREE(&cfg_causes); +} |