aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-11-10 22:04:27 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-11-10 22:04:27 +0100
commitd0bf693ea5c1343495d627844c9e52f63cf0cca9 (patch)
tree9e7b470e16305e6247a2fedbe12bad7acde83388 /sam.c
parent4d245d0a8f6c3d729509eab4fb40656d6d4e13b8 (diff)
downloadvis-d0bf693ea5c1343495d627844c9e52f63cf0cca9.tar.gz
vis-d0bf693ea5c1343495d627844c9e52f63cf0cca9.tar.xz
vis: split `:set show <option>` into separate options
It was the only command option which needed `=` to assign a value to. This unifies the argument parsing logic and adds the possibility to specify a per-option help text. You might want to adapt your visrc.lua configuration accordingly.
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sam.c b/sam.c
index 883cfd9..5ebf71c 100644
--- a/sam.c
+++ b/sam.c
@@ -202,7 +202,9 @@ enum {
OPTION_TABWIDTH,
OPTION_THEME,
OPTION_SYNTAX,
- OPTION_SHOW,
+ OPTION_SHOW_SPACES,
+ OPTION_SHOW_TABS,
+ OPTION_SHOW_NEWLINES,
OPTION_NUMBER,
OPTION_NUMBER_RELATIVE,
OPTION_CURSOR_LINE,
@@ -236,10 +238,20 @@ static const OptionDef options[] = {
OPTION_TYPE_STRING, OPTION_FLAG_WINDOW|OPTION_FLAG_OPTIONAL,
"Syntax highlighting lexer to use filename without extension",
},
- [OPTION_SHOW] = {
- { "show" },
- OPTION_TYPE_STRING, OPTION_FLAG_WINDOW,
- "Show white space replacement symbols",
+ [OPTION_SHOW_SPACES] = {
+ { "show-spaces" },
+ OPTION_TYPE_BOOL, OPTION_FLAG_WINDOW,
+ "Display replacement symbol instead of a space",
+ },
+ [OPTION_SHOW_TABS] = {
+ { "show-tabs" },
+ OPTION_TYPE_BOOL, OPTION_FLAG_WINDOW,
+ "Display replacement symbol for tabs",
+ },
+ [OPTION_SHOW_NEWLINES] = {
+ { "show-newlines" },
+ OPTION_TYPE_BOOL, OPTION_FLAG_WINDOW,
+ "Display replacement symbol for newlines",
},
[OPTION_NUMBER] = {
{ "numbers", "nu" },