Mercurial > vim
diff src/eval.c @ 18080:a6d218f99ff7 v8.1.2035
patch 8.1.2035: recognizing octal numbers is confusing
Commit: https://github.com/vim/vim/commit/60a8de28d11595f4df0419ece8afa7d6accc9fbd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 15 14:33:22 2019 +0200
patch 8.1.2035: recognizing octal numbers is confusing
Problem: Recognizing octal numbers is confusing.
Solution: Introduce scriptversion 4: do not use octal and allow for single
quote inside numbers.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 15 Sep 2019 14:45:04 +0200 |
parents | 46f95606b9ec |
children | 6c3a8312486d |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -2617,7 +2617,9 @@ eval7( else { // decimal, hex or octal number - vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0, TRUE); + vim_str2nr(*arg, NULL, &len, current_sctx.sc_version >= 4 + ? STR2NR_NO_OCT + STR2NR_QUOTE + : STR2NR_ALL, &n, NULL, 0, TRUE); if (len == 0) { semsg(_(e_invexpr2), *arg);