diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-19 22:43:33 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-19 22:48:18 +0200 |
| commit | aab8b6c44151cb086850ba9872251cfc452506b7 (patch) | |
| tree | 39b26281090995e54af9f97c26d2f14adf742d4c | |
| parent | 5e1c9480d734a22e6cfec0596e63e2e89fdb7d38 (diff) | |
| download | vis-aab8b6c44151cb086850ba9872251cfc452506b7.tar.gz vis-aab8b6c44151cb086850ba9872251cfc452506b7.tar.xz | |
vis: add an unsigned option type for :set command
| -rw-r--r-- | vis-cmds.c | 4 | ||||
| -rw-r--r-- | vis.h | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -42,6 +42,7 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor OPTION_TYPE_STRING, OPTION_TYPE_BOOL, OPTION_TYPE_NUMBER, + OPTION_TYPE_UNSIGNED, } type; bool optional; int index; @@ -134,12 +135,13 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor arg.b = !arg.b; break; case OPTION_TYPE_NUMBER: + case OPTION_TYPE_UNSIGNED: if (!argv[2]) { vis_info_show(vis, "Expecting number"); return false; } /* TODO: error checking? long type */ - arg.i = strtoul(argv[2], NULL, 10); + arg.u = strtoul(argv[2], NULL, 10); break; } @@ -26,6 +26,7 @@ typedef struct { typedef union { /* various types of arguments passed to key action functions */ bool b; int i; + size_t u; const char *s; const void *v; void (*w)(View*); |
