aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.h
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-06-03 01:55:18 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-11 15:36:03 +0100
commit90a4cf92d21b730fea7099fb3e12a9ef791a1a57 (patch)
treec342ec4595fd613430bff9e7a6924c7ee3291c71 /src/nvim/charset.h
parent10018958d860780c3766f4e785710201c07f3684 (diff)
downloadrneovim-90a4cf92d21b730fea7099fb3e12a9ef791a1a57.tar.gz
rneovim-90a4cf92d21b730fea7099fb3e12a9ef791a1a57.tar.bz2
rneovim-90a4cf92d21b730fea7099fb3e12a9ef791a1a57.zip
vim-patch:8.2.0886: cannot use octal numbers in scriptversion 4
Problem: Cannot use octal numbers in scriptversion 4. Solution: Add the "0o" notation. (Ken Takata, closes vim/vim#5304) https://github.com/vim/vim/commit/c17e66c5c0acd5038f1eb3d7b3049b64bb6ea30b :scriptversion is N/A. Cherry-pick latest str2nr() doc changes from v8.1.2035. Cherry-pick various mentions of the 0o prefix from: - v8.2.2324 - https://github.com/vim/vim/commit/2346a6378483c9871016f9fc821ec5cbea638f13 - https://github.com/vim/vim/commit/11e3c5ba820325b69cb56f70e13c21d7b8808d33 - https://github.com/vim/vim/commit/82be4849eed0b8fbee45bc8da99b685ec89af59a Patch used ascii_isbdigit() by mistake, which was fixed in v8.2.2309. Make STR2NR_OOCT work the same as STR2NR_OCT when forcing. In Vim, STR2NR_FORCE | STR2NR_OOCT isn't handled, and doesn't actually force anything. Rather than abort(), make it work as STR2NR_OCT. This means STR2NR_FORCE | STR2NR_OCT works the same as STR2NR_FORCE | STR2NR_OOCT and STR2NR_FORCE | STR2NR_OCT | STR2NR_OOCT.
Diffstat (limited to 'src/nvim/charset.h')
-rw-r--r--src/nvim/charset.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/charset.h b/src/nvim/charset.h
index b5f1f8506b..2fef4d78a2 100644
--- a/src/nvim/charset.h
+++ b/src/nvim/charset.h
@@ -23,14 +23,19 @@ typedef enum {
STR2NR_BIN = (1 << 0), ///< Allow binary numbers.
STR2NR_OCT = (1 << 1), ///< Allow octal numbers.
STR2NR_HEX = (1 << 2), ///< Allow hexadecimal numbers.
+ STR2NR_OOCT = (1 << 3), ///< Octal with prefix "0o": 0o777
/// Force one of the above variants.
///
/// STR2NR_FORCE|STR2NR_DEC is actually not different from supplying zero
/// as flags, but still present for completeness.
+ ///
+ /// STR2NR_FORCE|STR2NR_OCT|STR2NR_OOCT is the same as STR2NR_FORCE|STR2NR_OCT
+ /// or STR2NR_FORCE|STR2NR_OOCT.
STR2NR_FORCE = (1 << 7),
/// Recognize all formats vim_str2nr() can recognize.
- STR2NR_ALL = STR2NR_BIN | STR2NR_OCT | STR2NR_HEX,
- STR2NR_NO_OCT = STR2NR_BIN | STR2NR_HEX, ///< Disallow octal numbers.
+ STR2NR_ALL = STR2NR_BIN | STR2NR_OCT | STR2NR_HEX | STR2NR_OOCT,
+ /// Disallow octals numbers without the 0o prefix.
+ STR2NR_NO_OCT = STR2NR_BIN | STR2NR_HEX | STR2NR_OOCT,
STR2NR_QUOTE = (1 << 4), ///< Ignore embedded single quotes.
} ChStr2NrFlags;