aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
authorDavid B. Lamkins <david@lamkins.net>2016-04-19 22:51:29 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-19 23:03:09 +0200
commit754b1cec7a39723b415ee76e797e587a7b5054dc (patch)
tree556d63ccefd7301719aec4f51a9b66b2964c98cc /vis-cmds.c
parentaab8b6c44151cb086850ba9872251cfc452506b7 (diff)
downloadvis-754b1cec7a39723b415ee76e797e587a7b5054dc.tar.gz
vis-754b1cec7a39723b415ee76e797e587a7b5054dc.tar.xz
vis: add :set horizon option
Can be used to specify the number of bytes before the visible area to consider for syntax highlighting. Defaults to 32K for now, whereas before it was 16K.
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 401d77d..7d3e0ab 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -59,6 +59,7 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor
OPTION_CURSOR_LINE,
OPTION_THEME,
OPTION_COLOR_COLUMN,
+ OPTION_HORIZON,
};
/* definitions have to be in the same order as the enum above */
@@ -73,6 +74,7 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor
[OPTION_CURSOR_LINE] = { { "cursorline", "cul" }, OPTION_TYPE_BOOL },
[OPTION_THEME] = { { "theme" }, OPTION_TYPE_STRING },
[OPTION_COLOR_COLUMN] = { { "colorcolumn", "cc" }, OPTION_TYPE_NUMBER },
+ [OPTION_HORIZON] = { { "horizon" }, OPTION_TYPE_UNSIGNED },
};
if (!vis->options) {
@@ -242,6 +244,9 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor
case OPTION_COLOR_COLUMN:
view_colorcolumn_set(win->view, arg.i);
break;
+ case OPTION_HORIZON:
+ view_horizon_set(win->view, arg.u);
+ break;
}
return true;