diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-10-17 22:41:18 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-11-08 13:37:23 +0100 |
| commit | 87c609e4c53202b4151c09bf479dc615eab4f84e (patch) | |
| tree | db882cca5dad2124edcda96925ae07a9aea07d5a /vis-cmds.c | |
| parent | c339bb3ae6646c3dbef8e73f41c1e797ed5ec99b (diff) | |
| download | vis-87c609e4c53202b4151c09bf479dc615eab4f84e.tar.gz vis-87c609e4c53202b4151c09bf479dc615eab4f84e.tar.xz | |
vis: implement :set cursorline
Diffstat (limited to 'vis-cmds.c')
| -rw-r--r-- | vis-cmds.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -158,6 +158,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char * OPTION_SHOW, OPTION_NUMBER, OPTION_NUMBER_RELATIVE, + OPTION_CURSOR_LINE, }; /* definitions have to be in the same order as the enum above */ @@ -169,6 +170,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char * [OPTION_SHOW] = { { "show" }, OPTION_TYPE_STRING }, [OPTION_NUMBER] = { { "numbers", "nu" }, OPTION_TYPE_BOOL }, [OPTION_NUMBER_RELATIVE] = { { "relativenumbers", "rnu" }, OPTION_TYPE_BOOL }, + [OPTION_CURSOR_LINE] = { { "cursorline", "cul" }, OPTION_TYPE_BOOL }, }; if (!vis->options) { @@ -313,6 +315,15 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char * view_options_set(vis->win->view, opt); break; } + case OPTION_CURSOR_LINE: { + enum UiOption opt = view_options_get(vis->win->view); + if (arg.b) + opt |= UI_OPTION_CURSOR_LINE; + else + opt &= ~UI_OPTION_CURSOR_LINE; + view_options_set(vis->win->view, opt); + break; + } } return true; |
