|
587 | 587 | end
|
588 | 588 | end
|
589 | 589 | end
|
| 590 | + |
| 591 | +describe "Handles far away opening parens" do |
| 592 | + before { vim.feedkeys '\<ESC>ggdGifrom foo import (' } |
| 593 | + |
| 594 | + it "indents by one level" do |
| 595 | + vim.feedkeys '\<CR>' |
| 596 | + proposed_indent.should == shiftwidth |
| 597 | + end |
| 598 | + |
| 599 | + it "indents by one level for 10 lines" do |
| 600 | + vim.command('set paste | exe "norm 9o" | set nopaste') |
| 601 | + vim.feedkeys '\<Esc>o' |
| 602 | + indent.should == shiftwidth |
| 603 | + end |
| 604 | + |
| 605 | + it "indents by one level for 50 lines" do |
| 606 | + vim.command('set paste | exe "norm 49o" | set nopaste') |
| 607 | + vim.feedkeys '\<Esc>o' |
| 608 | + indent.should == shiftwidth |
| 609 | + end |
| 610 | +end |
| 611 | + |
| 612 | +describe "Handles far away opening square brackets" do |
| 613 | + before { vim.feedkeys '\<ESC>ggdGibar = [' } |
| 614 | + |
| 615 | + it "indents by one level" do |
| 616 | + vim.feedkeys '\<CR>' |
| 617 | + proposed_indent.should == shiftwidth |
| 618 | + end |
| 619 | + |
| 620 | + it "indents by one level for 10 lines" do |
| 621 | + vim.command('set paste | exe "norm 9o" | set nopaste') |
| 622 | + vim.feedkeys '\<Esc>o' |
| 623 | + indent.should == shiftwidth |
| 624 | + end |
| 625 | + |
| 626 | + it "indents by one level for 100 lines" do |
| 627 | + vim.command('set paste | exe "norm 99o" | set nopaste') |
| 628 | + vim.feedkeys '\<Esc>o' |
| 629 | + indent.should == shiftwidth |
| 630 | + end |
| 631 | +end |
| 632 | + |
| 633 | +describe "Handles far away opening curly brackets" do |
| 634 | + before { vim.feedkeys '\<ESC>ggdGijson = {' } |
| 635 | + |
| 636 | + it "indents by one level" do |
| 637 | + vim.feedkeys '\<CR>' |
| 638 | + vim.feedkeys '\<Esc>o' |
| 639 | + proposed_indent.should == shiftwidth |
| 640 | + end |
| 641 | + |
| 642 | + it "indents by one level for 10 lines" do |
| 643 | + vim.command('set paste | exe "norm 9o" | set nopaste') |
| 644 | + indent.should == shiftwidth |
| 645 | + end |
| 646 | + |
| 647 | + it "indents by one level for 1000 lines" do |
| 648 | + vim.command('set paste | exe "norm 999o" | set nopaste') |
| 649 | + vim.feedkeys '\<Esc>o' |
| 650 | + indent.should == shiftwidth |
| 651 | + end |
| 652 | +end |
0 commit comments