1" Tests for using Ctrl-A/Ctrl-X on visual selections 2 3func SetUp() 4 new dummy 5 set nrformats&vim 6endfunc 7 8func TearDown() 9 bwipe! 10endfunc 11 12" 1) Ctrl-A on visually selected number 13" Text: 14" foobar-10 15" Expected: 16" 1) Ctrl-A on start of line: 17" foobar-9 18" 2) Ctrl-A on visually selected "-10": 19" foobar-9 20" 3) Ctrl-A on visually selected "10": 21" foobar-11 22" 4) Ctrl-X on visually selected "-10" 23" foobar-11 24" 5) Ctrl-X on visually selected "10" 25" foobar-9 26func Test_visual_increment_01() 27 call setline(1, repeat(["foobaar-10"], 5)) 28 29 call cursor(1, 1) 30 exec "norm! \<C-A>" 31 call assert_equal("foobaar-9", getline('.')) 32 call assert_equal([0, 1, 9, 0], getpos('.')) 33 34 call cursor(2, 1) 35 exec "norm! f-v$\<C-A>" 36 call assert_equal("foobaar-9", getline('.')) 37 call assert_equal([0, 2, 8, 0], getpos('.')) 38 39 call cursor(3, 1) 40 exec "norm! f1v$\<C-A>" 41 call assert_equal("foobaar-11", getline('.')) 42 call assert_equal([0, 3, 9, 0], getpos('.')) 43 44 call cursor(4, 1) 45 exec "norm! f-v$\<C-X>" 46 call assert_equal("foobaar-11", getline('.')) 47 call assert_equal([0, 4, 8, 0], getpos('.')) 48 49 call cursor(5, 1) 50 exec "norm! f1v$\<C-X>" 51 call assert_equal("foobaar-9", getline('.')) 52 call assert_equal([0, 5, 9, 0], getpos('.')) 53endfunc 54 55" 2) Ctrl-A on visually selected lines 56" Text: 57" 10 58" 20 59" 30 60" 40 61" 62" Expected: 63" 1) Ctrl-A on visually selected lines: 64" 11 65" 21 66" 31 67" 41 68" 69" 2) Ctrl-X on visually selected lines: 70" 9 71" 19 72" 29 73" 39 74func Test_visual_increment_02() 75 call setline(1, ["10", "20", "30", "40"]) 76 exec "norm! GV3k$\<C-A>" 77 call assert_equal(["11", "21", "31", "41"], getline(1, '$')) 78 call assert_equal([0, 1, 1, 0], getpos('.')) 79 80 call setline(1, ["10", "20", "30", "40"]) 81 exec "norm! GV3k$\<C-X>" 82 call assert_equal(["9", "19", "29", "39"], getline(1, '$')) 83 call assert_equal([0, 1, 1, 0], getpos('.')) 84endfunc 85 86" 3) g Ctrl-A on visually selected lines, with non-numbers in between 87" Text: 88" 10 89" 90" 20 91" 92" 30 93" 94" 40 95" 96" Expected: 97" 1) 2 g Ctrl-A on visually selected lines: 98" 12 99" 100" 24 101" 102" 36 103" 104" 48 105" 2) 2 g Ctrl-X on visually selected lines 106" 8 107" 108" 16 109" 110" 24 111" 112" 32 113func Test_visual_increment_03() 114 call setline(1, ["10", "", "20", "", "30", "", "40"]) 115 exec "norm! GV6k2g\<C-A>" 116 call assert_equal(["12", "", "24", "", "36", "", "48"], getline(1, '$')) 117 call assert_equal([0, 1, 1, 0], getpos('.')) 118 119 call setline(1, ["10", "", "20", "", "30", "", "40"]) 120 exec "norm! GV6k2g\<C-X>" 121 call assert_equal(["8", "", "16", "", "24", "", "32"], getline(1, '$')) 122 call assert_equal([0, 1, 1, 0], getpos('.')) 123endfunc 124 125" 4) Ctrl-A on non-number 126" Text: 127" foobar-10 128" Expected: 129" 1) visually select foobar: 130" foobar-10 131func Test_visual_increment_04() 132 call setline(1, ["foobar-10"]) 133 exec "norm! vf-\<C-A>" 134 call assert_equal(["foobar-10"], getline(1, '$')) 135 " NOTE: I think this is correct behavior... 136 call assert_equal([0, 1, 1, 0], getpos('.')) 137endfunc 138 139" 5) g<Ctrl-A> on letter 140" Test: 141" a 142" a 143" a 144" a 145" Expected: 146" 1) g Ctrl-A on visually selected lines 147" b 148" c 149" d 150" e 151func Test_visual_increment_05() 152 set nrformats+=alpha 153 call setline(1, repeat(["a"], 4)) 154 exec "norm! GV3kg\<C-A>" 155 call assert_equal(["b", "c", "d", "e"], getline(1, '$')) 156 call assert_equal([0, 1, 1, 0], getpos('.')) 157endfunc 158 159" 6) g<Ctrl-A> on letter 160" Test: 161" z 162" z 163" z 164" z 165" Expected: 166" 1) g Ctrl-X on visually selected lines 167" y 168" x 169" w 170" v 171func Test_visual_increment_06() 172 set nrformats+=alpha 173 call setline(1, repeat(["z"], 4)) 174 exec "norm! GV3kg\<C-X>" 175 call assert_equal(["y", "x", "w", "v"], getline(1, '$')) 176 call assert_equal([0, 1, 1, 0], getpos('.')) 177endfunc 178 179" 7) <Ctrl-A> on letter 180" Test: 181" 2 182" 1 183" 0 184" -1 185" -2 186" 187" Expected: 188" 1) Ctrl-A on visually selected lines 189" 3 190" 2 191" 1 192" 0 193" -1 194" 195" 2) Ctrl-X on visually selected lines 196" 1 197" 0 198" -1 199" -2 200" -3 201func Test_visual_increment_07() 202 call setline(1, ["2", "1", "0", "-1", "-2"]) 203 exec "norm! GV4k\<C-A>" 204 call assert_equal(["3", "2", "1", "0", "-1"], getline(1, '$')) 205 call assert_equal([0, 1, 1, 0], getpos('.')) 206 207 call setline(1, ["2", "1", "0", "-1", "-2"]) 208 exec "norm! GV4k\<C-X>" 209 call assert_equal(["1", "0", "-1", "-2", "-3"], getline(1, '$')) 210 call assert_equal([0, 1, 1, 0], getpos('.')) 211endfunc 212 213" 8) Block increment on 0x9 214" Text: 215" 0x9 216" 0x9 217" Expected: 218" 1) Ctrl-A on visually block selected region (cursor at beginning): 219" 0xa 220" 0xa 221" 2) Ctrl-A on visually block selected region (cursor at end) 222" 0xa 223" 0xa 224func Test_visual_increment_08() 225 call setline(1, repeat(["0x9"], 2)) 226 exec "norm! \<C-V>j$\<C-A>" 227 call assert_equal(["0xa", "0xa"], getline(1, '$')) 228 call assert_equal([0, 1, 1, 0], getpos('.')) 229 230 call setline(1, repeat(["0x9"], 2)) 231 exec "norm! gg$\<C-V>+\<C-A>" 232 call assert_equal(["0xa", "0xa"], getline(1, '$')) 233 call assert_equal([0, 1, 1, 0], getpos('.')) 234endfunc 235 236" 9) Increment and redo 237" Text: 238" 2 239" 2 240" 241" 3 242" 3 243" 244" Expected: 245" 1) 2 Ctrl-A on first 2 visually selected lines 246" 4 247" 4 248" 2) redo (.) on 3 249" 5 250" 5 251func Test_visual_increment_09() 252 call setline(1, ["2", "2", "", "3", "3", ""]) 253 exec "norm! ggVj2\<C-A>" 254 call assert_equal(["4", "4", "", "3", "3", ""], getline(1, '$')) 255 call assert_equal([0, 1, 1, 0], getpos('.')) 256 257 exec "norm! 3j." 258 call assert_equal(["4", "4", "", "5", "5", ""], getline(1, '$')) 259 call assert_equal([0, 4, 1, 0], getpos('.')) 260endfunc 261 262" 10) sequentially decrement 1 263" Text: 264" 1 265" 1 266" 1 267" 1 268" Expected: 269" 1) g Ctrl-X on visually selected lines 270" 0 271" -1 272" -2 273" -3 274func Test_visual_increment_10() 275 call setline(1, repeat(["1"], 4)) 276 exec "norm! GV3kg\<C-X>" 277 call assert_equal(["0", "-1", "-2", "-3"], getline(1, '$')) 278 call assert_equal([0, 1, 1, 0], getpos('.')) 279endfunc 280 281" 11) visually block selected indented lines 282" Text: 283" 1 284" 1 285" 1 286" 1 287" Expexted: 288" 1) g Ctrl-A on block selected indented lines 289" 2 290" 1 291" 3 292" 4 293func Test_visual_increment_11() 294 call setline(1, [" 1", "1", " 1", " 1"]) 295 exec "norm! f1\<C-V>3jg\<C-A>" 296 call assert_equal([" 2", "1", " 3", " 4"], getline(1, '$')) 297 call assert_equal([0, 1, 5, 0], getpos('.')) 298endfunc 299 300" 12) visually selected several columns 301" Text: 302" 0 0 303" 0 0 304" 0 0 305" Expected: 306" 1) 'v' select last zero and first zeroes 307" 0 1 308" 1 0 309" 1 0 310func Test_visual_increment_12() 311 call setline(1, repeat(["0 0"], 3)) 312 exec "norm! $v++\<C-A>" 313 call assert_equal(["0 1", "1 0", "1 0"], getline(1, '$')) 314 call assert_equal([0, 1, 3, 0], getpos('.')) 315endfunc 316 317" 13) visually selected part of columns 318" Text: 319" max: 100px 320" max: 200px 321" max: 300px 322" max: 400px 323" Expected: 324" 1) 'v' on first two numbers Ctrl-A 325" max: 110px 326" max: 220px 327" max: 330px 328" max: 400px 329" 2) 'v' on first two numbers Ctrl-X 330" max: 90px 331" max: 190px 332" max: 290px 333" max: 400px 334func Test_visual_increment_13() 335 call setline(1, ["max: 100px", "max: 200px", "max: 300px", "max: 400px"]) 336 exec "norm! f1\<C-V>l2j\<C-A>" 337 call assert_equal(["max: 110px", "max: 210px", "max: 310px", "max: 400px"], getline(1, '$')) 338 call assert_equal([0, 1, 6, 0], getpos('.')) 339 340 call setline(1, ["max: 100px", "max: 200px", "max: 300px", "max: 400px"]) 341 exec "norm! ggf1\<C-V>l2j\<C-X>" 342 call assert_equal(["max: 90px", "max: 190px", "max: 290px", "max: 400px"], getline(1, '$')) 343 call assert_equal([0, 1, 6, 0], getpos('.')) 344endfunc 345 346" 14) redo in block mode 347" Text: 348" 1 1 349" 1 1 350" Expected: 351" 1) Ctrl-a on first column, redo on second column 352" 2 2 353" 2 2 354func Test_visual_increment_14() 355 call setline(1, repeat(["1 1"], 2)) 356 exec "norm! G\<C-V>k\<C-A>w." 357 call assert_equal(["2 2", "2 2"], getline(1, '$')) 358 call assert_equal([0, 1, 3, 0], getpos('.')) 359endfunc 360 361" 15) block select single numbers 362" Text: 363" 101 364" Expected: 365" 1) Ctrl-a on visually selected zero 366" 111 367func Test_visual_increment_15() 368 call setline(1, ["101"]) 369 exec "norm! lv\<C-A>" 370 call assert_equal(["111"], getline(1, '$')) 371 call assert_equal([0, 1, 2, 0], getpos('.')) 372endfunc 373 374" 16) increment right aligned numbers 375" Text: 376" 1 377" 19 378" 119 379" Expected: 380" 1) Ctrl-a on line selected region 381" 2 382" 20 383" 120 384func Test_visual_increment_16() 385 call setline(1, [" 1", " 19", " 119"]) 386 exec "norm! VG\<C-A>" 387 call assert_equal([" 2", " 20", " 120"], getline(1, '$')) 388 call assert_equal([0, 1, 1, 0], getpos('.')) 389endfunc 390 391" 17) block-wise increment and redo 392" Text: 393" 100 394" 1 395" 396" 100 397" 1 398" 399" Expected: 400" 1) Ctrl-V j $ on first block, afterwards '.' on second 401" 101 402" 2 403" 404" 101 405" 2 406func Test_visual_increment_17() 407 call setline(1, [" 100", " 1", "", " 100", " 1"]) 408 exec "norm! \<C-V>j$\<C-A>2j." 409 call assert_equal([" 101", " 2", "", " 101", " 1"], getline(1, '$')) 410 call assert_equal([0, 3, 1, 0], getpos('.')) 411endfunc 412 413" 18) repeat of g<Ctrl-a> 414" Text: 415" 0 416" 0 417" 0 418" 0 419" 420" Expected: 421" 1) V 4j g<ctrl-a>, repeat twice afterwards with . 422" 3 423" 6 424" 9 425" 12 426func Test_visual_increment_18() 427 call setline(1, repeat(["0"], 4)) 428 exec "norm! GV3kg\<C-A>" 429 exec "norm! .." 430 call assert_equal(["3", "6", "9", "12"], getline(1, '$')) 431 call assert_equal([0, 1, 1, 0], getpos('.')) 432endfunc 433 434" 19) increment on number with nrformat including alpha 435" Text: 436" 1 437" 1a 438" 439" Expected: 440" 1) <Ctrl-V>j$ <ctrl-a> 441" 2 442" 2a 443func Test_visual_increment_19() 444 set nrformats+=alpha 445 call setline(1, ["1", "1a"]) 446 exec "norm! \<C-V>G$\<C-A>" 447 call assert_equal(["2", "2a"], getline(1, '$')) 448 call assert_equal([0, 1, 1, 0], getpos('.')) 449endfunc 450 451" 20) increment a single letter 452" Text: 453" a 454" 455" Expected: 456" 1) <Ctrl-a> and cursor is on a 457" b 458func Test_visual_increment_20() 459 set nrformats+=alpha 460 call setline(1, ["a"]) 461 exec "norm! \<C-A>" 462 call assert_equal(["b"], getline(1, '$')) 463 call assert_equal([0, 1, 1, 0], getpos('.')) 464endfunc 465 466" 21) block-wise increment on part of hexadecimal 467" Text: 468" 0x123456 469" 470" Expected: 471" 1) Ctrl-V f3 <ctrl-a> 472" 0x124456 473func Test_visual_increment_21() 474 call setline(1, ["0x123456"]) 475 exec "norm! \<C-V>f3\<C-A>" 476 call assert_equal(["0x124456"], getline(1, '$')) 477 call assert_equal([0, 1, 1, 0], getpos('.')) 478endfunc 479 480" 22) Block increment on 0b0 481" Text: 482" 0b1 483" 0b1 484" Expected: 485" 1) Ctrl-A on visually block selected region (cursor at beginning): 486" 0b10 487" 0b10 488" 2) Ctrl-A on visually block selected region (cursor at end) 489" 0b10 490" 0b10 491func Test_visual_increment_22() 492 call setline(1, repeat(["0b1"], 2)) 493 exec "norm! \<C-V>j$\<C-A>" 494 call assert_equal(repeat(["0b10"], 2), getline(1, '$')) 495 call assert_equal([0, 1, 1, 0], getpos('.')) 496 497 call setline(1, repeat(["0b1"], 2)) 498 exec "norm! $\<C-V>+\<C-A>" 499 call assert_equal(repeat(["0b10"], 2), getline(1, '$')) 500 call assert_equal([0, 1, 1, 0], getpos('.')) 501endfunc 502 503" 23) block-wise increment on part of binary 504" Text: 505" 0b1001 506" 507" Expected: 508" 1) Ctrl-V 5l <ctrl-a> 509" 0b1011 510func Test_visual_increment_23() 511 call setline(1, ["0b1001"]) 512 exec "norm! \<C-V>4l\<C-A>" 513 call assert_equal(["0b1011"], getline(1, '$')) 514 call assert_equal([0, 1, 1, 0], getpos('.')) 515endfunc 516 517" 24) increment hexadecimal 518" Text: 519" 0x0b1001 520" 521" Expected: 522" 1) <ctrl-a> 523" 0x0b1002 524func Test_visual_increment_24() 525 call setline(1, ["0x0b1001"]) 526 exec "norm! \<C-V>$\<C-A>" 527 call assert_equal(["0x0b1002"], getline(1, '$')) 528 call assert_equal([0, 1, 1, 0], getpos('.')) 529endfunc 530 531" 25) increment binary with nrformats including alpha 532" Text: 533" 0b1001a 534" 535" Expected: 536" 1) <ctrl-a> 537" 0b1010a 538func Test_visual_increment_25() 539 set nrformats+=alpha 540 call setline(1, ["0b1001a"]) 541 exec "norm! \<C-V>$\<C-A>" 542 call assert_equal(["0b1010a"], getline(1, '$')) 543 call assert_equal([0, 1, 1, 0], getpos('.')) 544endfunc 545 546" 26) increment binary with 32 bits 547" Text: 548" 0b11111111111111111111111111111110 549" 550" Expected: 551" 1) <ctrl-a> 552" 0b11111111111111111111111111111111 553func Test_visual_increment_26() 554 set nrformats+=alpha 555 call setline(1, ["0b11111111111111111111111111111110"]) 556 exec "norm! \<C-V>$\<C-A>" 557 call assert_equal(["0b11111111111111111111111111111111"], getline(1, '$')) 558 call assert_equal([0, 1, 1, 0], getpos('.')) 559 set nrformats-=alpha 560endfunc 561 562" 27) increment with 'rightreft', if supported 563func Test_visual_increment_27() 564 if exists('+rightleft') 565 set rightleft 566 call setline(1, ["1234 56"]) 567 568 exec "norm! $\<C-A>" 569 call assert_equal(["1234 57"], getline(1, '$')) 570 call assert_equal([0, 1, 7, 0], getpos('.')) 571 572 exec "norm! \<C-A>" 573 call assert_equal(["1234 58"], getline(1, '$')) 574 call assert_equal([0, 1, 7, 0], getpos('.')) 575 set norightleft 576 endif 577endfunc 578 579" Tab code and linewise-visual inc/dec 580func Test_visual_increment_28() 581 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 582 exec "norm! Vj\<C-A>" 583 call assert_equal(["x\<TAB>11", "\<TAB>0"], getline(1, '$')) 584 call assert_equal([0, 1, 1, 0], getpos('.')) 585 586 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 587 exec "norm! ggVj\<C-X>" 588 call assert_equal(["x\<TAB>9", "\<TAB>-2"], getline(1, '$')) 589 call assert_equal([0, 1, 1, 0], getpos('.')) 590endfunc 591 592" Tab code and linewise-visual inc/dec with 'nrformats'+=alpha 593func Test_visual_increment_29() 594 set nrformats+=alpha 595 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 596 exec "norm! Vj\<C-A>" 597 call assert_equal(["y\<TAB>10", "\<TAB>0"], getline(1, '$')) 598 call assert_equal([0, 1, 1, 0], getpos('.')) 599 600 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 601 exec "norm! ggVj\<C-X>" 602 call assert_equal(["w\<TAB>10", "\<TAB>-2"], getline(1, '$')) 603 call assert_equal([0, 1, 1, 0], getpos('.')) 604endfunc 605 606" Tab code and character-visual inc/dec 607func Test_visual_increment_30() 608 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 609 exec "norm! f1vjf1\<C-A>" 610 call assert_equal(["x\<TAB>11", "\<TAB>0"], getline(1, '$')) 611 call assert_equal([0, 1, 3, 0], getpos('.')) 612 613 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 614 exec "norm! ggf1vjf1\<C-X>" 615 call assert_equal(["x\<TAB>9", "\<TAB>-2"], getline(1, '$')) 616 call assert_equal([0, 1, 3, 0], getpos('.')) 617endfunc 618 619" Tab code and blockwise-visual inc/dec 620func Test_visual_increment_31() 621 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 622 exec "norm! f1\<C-V>jl\<C-A>" 623 call assert_equal(["x\<TAB>11", "\<TAB>0"], getline(1, '$')) 624 call assert_equal([0, 1, 3, 0], getpos('.')) 625 626 call setline(1, ["x\<TAB>10", "\<TAB>-1"]) 627 exec "norm! ggf1\<C-V>jl\<C-X>" 628 call assert_equal(["x\<TAB>9", "\<TAB>-2"], getline(1, '$')) 629 call assert_equal([0, 1, 3, 0], getpos('.')) 630endfunc 631 632" Tab code and blockwise-visual decrement with 'linebreak' and 'showbreak' 633func Test_visual_increment_32() 634 28vnew dummy_31 635 set linebreak showbreak=+ 636 call setline(1, ["x\<TAB>\<TAB>\<TAB>10", "\<TAB>\<TAB>\<TAB>\<TAB>-1"]) 637 exec "norm! ggf0\<C-V>jg_\<C-X>" 638 call assert_equal(["x\<TAB>\<TAB>\<TAB>1-1", "\<TAB>\<TAB>\<TAB>\<TAB>-2"], getline(1, '$')) 639 call assert_equal([0, 1, 6, 0], getpos('.')) 640 bwipe! 641endfunc 642 643" Tab code and blockwise-visual increment with $ 644func Test_visual_increment_33() 645 call setline(1, ["\<TAB>123", "456"]) 646 exec "norm! gg0\<C-V>j$\<C-A>" 647 call assert_equal(["\<TAB>124", "457"], getline(1, '$')) 648 call assert_equal([0, 1, 1, 0], getpos('.')) 649endfunc 650 651" Tab code and blockwise-visual increment and redo 652func Test_visual_increment_34() 653 call setline(1, ["\<TAB>123", " 456789"]) 654 exec "norm! gg0\<C-V>j\<C-A>" 655 call assert_equal(["\<TAB>123", " 457789"], getline(1, '$')) 656 call assert_equal([0, 1, 1, 0], getpos('.')) 657 658 exec "norm! .." 659 call assert_equal(["\<TAB>123", " 459789"], getline(1, '$')) 660 call assert_equal([0, 1, 1, 0], getpos('.')) 661endfunc 662 663" Tab code, spaces and character-visual increment and redo 664func Test_visual_increment_35() 665 call setline(1, ["\<TAB>123", " 123", "\<TAB>123", "\<TAB>123"]) 666 exec "norm! ggvjf3\<C-A>..." 667 call assert_equal(["\<TAB>127", " 127", "\<TAB>123", "\<TAB>123"], getline(1, '$')) 668 call assert_equal([0, 1, 2, 0], getpos('.')) 669endfunc 670 671" Tab code, spaces and blockwise-visual increment and redo 672func Test_visual_increment_36() 673 call setline(1, [" 123", "\<TAB>456789"]) 674 exec "norm! G0\<C-V>kl\<C-A>" 675 call assert_equal([" 123", "\<TAB>556789"], getline(1, '$')) 676 call assert_equal([0, 1, 1, 0], getpos('.')) 677 678 exec "norm! ..." 679 call assert_equal([" 123", "\<TAB>856789"], getline(1, '$')) 680 call assert_equal([0, 1, 1, 0], getpos('.')) 681endfunc 682 683" block-wise increment and dot-repeat 684" Text: 685" 1 23 686" 4 56 687" 688" Expected: 689" 1) f2 Ctrl-V jl <ctrl-a>, repeat twice afterwards with . 690" 1 26 691" 4 59 692" 693" Try with and without indent. 694func Test_visual_increment_37() 695 call setline(1, [" 1 23", " 4 56"]) 696 exec "norm! ggf2\<C-V>jl\<C-A>.." 697 call assert_equal([" 1 26", " 4 59"], getline(1, 2)) 698 699 call setline(1, ["1 23", "4 56"]) 700 exec "norm! ggf2\<C-V>jl\<C-A>.." 701 call assert_equal(["1 26", "4 59"], getline(1, 2)) 702endfunc 703 704" Check redo after the normal mode increment 705func Test_visual_increment_38() 706 exec "norm! i10\<ESC>5\<C-A>." 707 call assert_equal(["20"], getline(1, '$')) 708 call assert_equal([0, 1, 2, 0], getpos('.')) 709endfunc 710 711" Test what patch 7.3.414 fixed. Ctrl-A on "000" drops the leading zeros. 712func Test_normal_increment_01() 713 call setline(1, "000") 714 exec "norm! gg0\<C-A>" 715 call assert_equal("001", getline(1)) 716 717 call setline(1, "000") 718 exec "norm! gg$\<C-A>" 719 call assert_equal("001", getline(1)) 720 721 call setline(1, "001") 722 exec "norm! gg0\<C-A>" 723 call assert_equal("002", getline(1)) 724 725 call setline(1, "001") 726 exec "norm! gg$\<C-A>" 727 call assert_equal("002", getline(1)) 728endfunc 729 730" vim: tabstop=2 shiftwidth=2 expandtab 731