patch 7.4.1027
Problem: No support for binary numbers.
Solution: Add "bin" to nrformats. (Jason Schulz)
diff --git a/src/testdir/test57.in b/src/testdir/test57.in
index 8d972e4..0bb95ad 100644
--- a/src/testdir/test57.in
+++ b/src/testdir/test57.in
@@ -30,6 +30,8 @@
:/^t25:/+1,/^t26/-1sort/\d\d/rn
:/^t26:/+1,/^t27/-1sort/\d\d/rx
:/^t27:/+1,/^t28/-1sort no
+:/^t28:/+1,/^t29/-1sort b
+:/^t29:/+1,/^t30/-1sort b
:/^t01:/,$wq! test.out
ENDTEST
@@ -494,7 +496,38 @@
b322b
b321
b321b
+t28: binary
-t28: done
+0b111000
+0b101100
+0b101001
+0b101001
+0b101000
+0b000000
+0b001000
+0b010000
+0b101000
+0b100000
+0b101010
+0b100010
+0b100100
+0b100010
+t29: binary with leading characters
+
+0b100010
+0b010000
+ 0b101001
+b0b101100
+0b100010
+ 0b100100
+a0b001000
+0b101000
+0b101000
+a0b101001
+ab0b100000
+0b101010
+0b000000
+b0b111000
+t30: done
diff --git a/src/testdir/test57.ok b/src/testdir/test57.ok
index aa3d373..2ac5e59 100644
--- a/src/testdir/test57.ok
+++ b/src/testdir/test57.ok
@@ -453,7 +453,38 @@
b322b
b321
b321b
+t28: binary
-t28: done
+0b000000
+0b001000
+0b010000
+0b100000
+0b100010
+0b100010
+0b100100
+0b101000
+0b101000
+0b101001
+0b101001
+0b101010
+0b101100
+0b111000
+t29: binary with leading characters
+
+0b000000
+a0b001000
+0b010000
+ab0b100000
+0b100010
+0b100010
+ 0b100100
+0b101000
+0b101000
+ 0b101001
+a0b101001
+0b101010
+b0b101100
+b0b111000
+t30: done
diff --git a/src/testdir/test58.in b/src/testdir/test58.in
index cef1cfa..b99ee45 100644
--- a/src/testdir/test58.in
+++ b/src/testdir/test58.in
@@ -104,6 +104,8 @@
:"
:" NOSLITSUGS
:call TestOne('8', '8')
+:" Numbers
+:call TestOne('9', '9')
:"
:" clean up for valgrind
:delfunc TestOne
@@ -636,4 +638,19 @@
badend
+Test Numbers
+
+9affstart
+9affend
+
+9dicstart
+1234
+foo
+bar
+9dicend
+
+9good: 0b1011 0777 1234 0x01ff
+badend
+
+
test output:
diff --git a/src/testdir/test58.ok b/src/testdir/test58.ok
index ce05c73..dc37f0f 100644
--- a/src/testdir/test58.ok
+++ b/src/testdir/test58.ok
@@ -281,3 +281,9 @@
['faabar', 'foo bar', 'bar']
barfoo
['bar foo', 'bar', 'foo']
+
+test 9-9
+# file: Xtest.latin1.spl
+bar
+foo
+-------
diff --git a/src/testdir/test_increment.in b/src/testdir/test_increment.in
index 2ae6b8a..753951d 100644
--- a/src/testdir/test_increment.in
+++ b/src/testdir/test_increment.in
@@ -286,6 +286,49 @@
1) Ctrl-V f3 <ctrl-a>
0x124456
+22) Block increment on 0b0
+Text:
+0b1
+0b1
+ Expected:
+ 1) Ctrl-A on visually block selected region (cursor at beginning):
+ 0b10
+ 0b10
+ 2) Ctrl-A on visually block selected region (cursor at end)
+ 0b10
+ 0b10
+
+23) block-wise increment on part of binary
+Text:
+0b1001
+
+ Expected:
+ 1) Ctrl-V 5l <ctrl-a>
+0b1011
+
+24) increment hexadecimal
+Text:
+0x0b1001
+
+ Expected:
+ 1) <ctrl-a>
+0x0b1002
+
+25) increment binary with nrformats including alpha
+Text:
+0b1001a
+
+ Expected:
+ 1) <ctrl-a>
+0b1010a
+
+26) increment binary with 64 bits
+Text:
+0b1111111111111111111111111111111111111111111111111111111111111110
+
+ Expected:
+ 1) <ctrl-a>
+0b1111111111111111111111111111111111111111111111111111111111111111
STARTTEST
@@ -415,6 +458,38 @@
:set nrformats&vim
f3
+:" Test 22
+:/^S22=/+,/^E22=/-y a
+:/^E22=/+put a
+kj$j:.+put a
+k$+
+
+:" Test 23
+:/^S23=/+,/^E23=/-y a
+:/^E23=/+put a
+:set nrformats&vim
+4l
+
+:" Test 24
+:/^S24=/+,/^E24=/-y a
+:/^E24=/+put a
+:set nrformats&vim
+$
+
+:" Test 25
+:set nrformats+=alpha
+:/^S25=/+,/^E25=/-y a
+:/^E25=/+put a
+k$
+:set nrformats&vim
+
+:" Test 26
+:set nrformats+=alpha
+:/^S26=/+,/^E26=/-y a
+:/^E26=/+put a
+k$
+:set nrformats&vim
+
:" Save the report
:/^# Test 1/,$w! test.out
:qa!
@@ -615,6 +690,45 @@
+# Test 22
+S22====
+0b1
+0b1
+E22====
+
+
+
+
+# Test 23
+S23====
+0b1001
+E23====
+
+
+
+
+# Test 24
+S24====
+0x0b1001
+E24====
+
+
+
+
+# Test 25
+S25====
+0b1001a
+E25====
+
+
+
+
+# Test 26
+S26====
+0b1111111111111111111111111111111111111111111111111111111111111110
+E26====
+
+
ENDTEST
diff --git a/src/testdir/test_increment.ok b/src/testdir/test_increment.ok
index 15d0e9b..4d8fbb0 100644
--- a/src/testdir/test_increment.ok
+++ b/src/testdir/test_increment.ok
@@ -288,6 +288,53 @@
0x124456
+# Test 22
+S22====
+0b1
+0b1
+E22====
+
+0b10
+0b10
+
+0b10
+0b10
+
+
+# Test 23
+S23====
+0b1001
+E23====
+
+0b1011
+
+
+
+# Test 24
+S24====
+0x0b1001
+E24====
+
+0x0b1002
+
+
+
+# Test 25
+S25====
+0b1001a
+E25====
+
+0b1010a
+
+
+
+# Test 26
+S26====
+0b1111111111111111111111111111111111111111111111111111111111111110
+E26====
+
+0b1111111111111111111111111111111111111111111111111111111111111111
+
ENDTEST