summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-02 17:56:35 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-02 17:56:35 +0100
commit887c1fea4a114e7170091942d0446c8882701b5b (patch)
tree23173526918b54763e5eed1b26a7bdad3ac7884a /src/option.c
parentacf92d27c94811e3bd6b84cfd54246e91d44c355 (diff)
downloadvim-git-887c1fea4a114e7170091942d0446c8882701b5b.tar.gz
patch 7.4.1027v7.4.1027
Problem: No support for binary numbers. Solution: Add "bin" to nrformats. (Jason Schulz)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index aca0f315f..357321144 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1940,7 +1940,7 @@ static struct vimoption
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"nrformats", "nf", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
(char_u *)&p_nf, PV_NF,
- {(char_u *)"octal,hex", (char_u *)0L}
+ {(char_u *)"bin,octal,hex", (char_u *)0L}
SCRIPTID_INIT},
{"number", "nu", P_BOOL|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_NU,
@@ -3031,7 +3031,7 @@ static struct vimoption
static char *(p_ambw_values[]) = {"single", "double", NULL};
#endif
static char *(p_bg_values[]) = {"light", "dark", NULL};
-static char *(p_nf_values[]) = {"octal", "hex", "alpha", NULL};
+static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", NULL};
static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL};
#ifdef FEAT_CRYPT
static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL};
@@ -4579,7 +4579,8 @@ do_set(arg, opt_flags)
{
/* Allow negative (for 'undolevels'), octal and
* hex numbers. */
- vim_str2nr(arg, NULL, &i, TRUE, TRUE, &value, NULL, 0);
+ vim_str2nr(arg, NULL, &i, STR2NR_ALL,
+ &value, NULL, 0);
if (arg[i] != NUL && !vim_iswhite(arg[i]))
{
errmsg = e_invarg;