aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-06-26 01:10:58 +0100
committerGitHub <noreply@github.com>2021-06-25 20:10:58 -0400
commitc1120ad0e1adf8b34ee10b63b2134fcb0d580fce (patch)
treee9b8ee4e144abaed3d33a02cbae9d3c607016236
parente680d7d6af4b48680693be9d984cce217e959e1f (diff)
downloadrneovim-c1120ad0e1adf8b34ee10b63b2134fcb0d580fce.tar.gz
rneovim-c1120ad0e1adf8b34ee10b63b2134fcb0d580fce.tar.bz2
rneovim-c1120ad0e1adf8b34ee10b63b2134fcb0d580fce.zip
fix(doc/usr_41): don't mention 0o prefix for octs (#14906)
v8.2.0886 isn't ported yet. Also remove mentions of Vim9 and legacy script for now. [skip ci]
-rw-r--r--runtime/doc/usr_41.txt13
1 files changed, 5 insertions, 8 deletions
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index f92cb3c509..a190bf2f27 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -99,8 +99,6 @@ and the value of the variable i. Since i is one, this will print:
Then there is the ":let i += 1" command. This does the same thing as
":let i = i + 1". This adds one to the variable i and assigns the new value
to the same variable.
-Note: this is how it works in legacy Vim script, which is what we discuss in
-this file.
The example was given to explain the commands, but would you really want to
make such a loop, it can be written much more compact: >
@@ -120,24 +118,23 @@ Numbers can be decimal, hexadecimal, octal or binary.
A hexadecimal number starts with "0x" or "0X". For example "0x1f" is decimal
31.
-An octal number starts with "0o", "0O" or a zero and another digit. "0o17" is
-decimal 15. Using just a zero prefix is not supported in Vim9 script.
+An octal number starts with a zero and another digit. "017" is decimal 15.
A binary number starts with "0b" or "0B". For example "0b101" is decimal 5.
A decimal number is just digits. Careful: don't put a zero before a decimal
-number, it will be interpreted as an octal number in legacy script!
+number, it will be interpreted as an octal number!
The ":echo" command always prints decimal numbers. Example: >
- :echo 0x7f 0o36
+ :echo 0x7f 036
< 127 30 ~
A number is made negative with a minus sign. This also works for hexadecimal,
octal and binary numbers. A minus sign is also used for subtraction. Compare
this with the previous example: >
- :echo 0x7f -0o36
+ :echo 0x7f -036
< 97 ~
White space in an expression is ignored. However, it's recommended to use it
@@ -145,7 +142,7 @@ for separating items, to make the expression easier to read. For example, to
avoid the confusion with a negative number above, put a space between the
minus sign and the following number: >
- :echo 0x7f - 0o36
+ :echo 0x7f - 036
==============================================================================
*41.2* Variables