diff options
| -rw-r--r-- | sam.c | 30 | ||||
| -rw-r--r-- | vis-cmds.c | 3 | ||||
| -rw-r--r-- | vis.h | 1 |
3 files changed, 24 insertions, 10 deletions
@@ -332,24 +332,32 @@ static const OptionDef options[] = { VIS_HELP("Number of spaces to display (and insert if `expandtab` is enabled) for a tab") }, [OPTION_SHOW_SPACES] = { - { "showspaces" }, - VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW, + { "showspaces", "show-spaces" }, + VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW|VIS_OPTION_DEPRECATED, VIS_HELP("Display replacement symbol instead of a space") + NULL, + "show-spaces" }, [OPTION_SHOW_TABS] = { - { "showtabs" }, - VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW, + { "showtabs", "show-tabs" }, + VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW|VIS_OPTION_DEPRECATED, VIS_HELP("Display replacement symbol for tabs") + NULL, + "show-tabs" }, [OPTION_SHOW_NEWLINES] = { - { "shownewlines" }, - VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW, + { "shownewlines", "show-newlines" }, + VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW|VIS_OPTION_DEPRECATED, VIS_HELP("Display replacement symbol for newlines") + NULL, + "show-newlines" }, [OPTION_SHOW_EOF] = { - { "showeof" }, - VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW, + { "showeof", "show-eof" }, + VIS_OPTION_TYPE_BOOL|VIS_OPTION_NEED_WINDOW|VIS_OPTION_DEPRECATED, VIS_HELP("Display replacement symbol for lines after the end of the file") + NULL, + "show-eof" }, [OPTION_NUMBER] = { { "numbers", "nu" }, @@ -382,9 +390,11 @@ static const OptionDef options[] = { VIS_HELP("How to load existing files 'auto', 'read' or 'mmap'") }, [OPTION_CHANGE_256COLORS] = { - { "change256colors" }, - VIS_OPTION_TYPE_BOOL, + { "change256colors", "change-256colors" }, + VIS_OPTION_TYPE_BOOL|VIS_OPTION_DEPRECATED, VIS_HELP("Change 256 color palette to support 24bit colors") + NULL, + "change-256colors" }, [OPTION_LAYOUT] = { { "layout" }, @@ -185,6 +185,9 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Select return false; } + if (opt->flags & VIS_OPTION_DEPRECATED && strcmp(opt->context, name) == 0) + vis_info_show(vis, "%s is deprecated and will be removed in the next release", name); + if (!win && (opt->flags & VIS_OPTION_NEED_WINDOW)) { vis_info_show(vis, "Need active window for `:set %s'", name); return false; @@ -857,6 +857,7 @@ enum VisOption { VIS_OPTION_TYPE_NUMBER = 1 << 2, VIS_OPTION_VALUE_OPTIONAL = 1 << 3, VIS_OPTION_NEED_WINDOW = 1 << 4, + VIS_OPTION_DEPRECATED = 1 << 5, }; /** |
