@@ -648,37 +648,121 @@ describe('ui/mouse/input', function()
648
648
]] }
649
649
end )
650
650
651
- it (' two clicks will select the word and enter VISUAL' , function ()
652
- feed (' <LeftMouse><2,2><LeftMouse><2,2>' )
651
+ it (' two clicks will enter VISUAL and dragging selects words' , function ()
652
+ feed (' <LeftMouse><2,2>' )
653
+ feed (' <LeftRelease><2,2>' )
654
+ feed (' <LeftMouse><2,2>' )
653
655
screen :expect ([[
654
656
testing |
655
657
mouse |
656
658
{1:suppor}^t and selection |
657
659
{0:~ }|
658
660
{2:-- VISUAL --} |
659
661
]] )
662
+ feed (' <LeftDrag><0,1>' )
663
+ screen :expect ([[
664
+ testing |
665
+ ^m{1:ouse} |
666
+ {1:support} and selection |
667
+ {0:~ }|
668
+ {2:-- VISUAL --} |
669
+ ]] )
670
+ feed (' <LeftDrag><4,0>' )
671
+ screen :expect ([[
672
+ ^t{1:esting} |
673
+ {1:mouse} |
674
+ {1:support} and selection |
675
+ {0:~ }|
676
+ {2:-- VISUAL --} |
677
+ ]] )
678
+ feed (' <LeftDrag><14,2>' )
679
+ screen :expect ([[
680
+ testing |
681
+ mouse |
682
+ {1:support and selectio}^n |
683
+ {0:~ }|
684
+ {2:-- VISUAL --} |
685
+ ]] )
660
686
end )
661
687
662
- it (' three clicks will select the line and enter VISUAL LINE' , function ()
663
- feed (' <LeftMouse><2,2><LeftMouse><2,2><LeftMouse><2,2>' )
688
+ it (' three clicks will enter VISUAL LINE and dragging selects lines' , function ()
689
+ feed (' <LeftMouse><2,2>' )
690
+ feed (' <LeftRelease><2,2>' )
691
+ feed (' <LeftMouse><2,2>' )
692
+ feed (' <LeftRelease><2,2>' )
693
+ feed (' <LeftMouse><2,2>' )
664
694
screen :expect ([[
665
695
testing |
666
696
mouse |
667
697
{1:su}^p{1:port and selection} |
668
698
{0:~ }|
669
699
{2:-- VISUAL LINE --} |
670
700
]] )
701
+ feed (' <LeftDrag><0,1>' )
702
+ screen :expect ([[
703
+ testing |
704
+ ^m{1:ouse} |
705
+ {1:support and selection} |
706
+ {0:~ }|
707
+ {2:-- VISUAL LINE --} |
708
+ ]] )
709
+ feed (' <LeftDrag><4,0>' )
710
+ screen :expect ([[
711
+ {1:test}^i{1:ng} |
712
+ {1:mouse} |
713
+ {1:support and selection} |
714
+ {0:~ }|
715
+ {2:-- VISUAL LINE --} |
716
+ ]] )
717
+ feed (' <LeftDrag><14,2>' )
718
+ screen :expect ([[
719
+ testing |
720
+ mouse |
721
+ {1:support and se}^l{1:ection} |
722
+ {0:~ }|
723
+ {2:-- VISUAL LINE --} |
724
+ ]] )
671
725
end )
672
726
673
- it (' four clicks will enter VISUAL BLOCK' , function ()
674
- feed (' <LeftMouse><2,2><LeftMouse><2,2><LeftMouse><2,2><LeftMouse><2,2>' )
727
+ it (' four clicks will enter VISUAL BLOCK and dragging selects blockwise' , function ()
728
+ feed (' <LeftMouse><2,2>' )
729
+ feed (' <LeftRelease><2,2>' )
730
+ feed (' <LeftMouse><2,2>' )
731
+ feed (' <LeftRelease><2,2>' )
732
+ feed (' <LeftMouse><2,2>' )
733
+ feed (' <LeftRelease><2,2>' )
734
+ feed (' <LeftMouse><2,2>' )
675
735
screen :expect ([[
676
736
testing |
677
737
mouse |
678
738
su^pport and selection |
679
739
{0:~ }|
680
740
{2:-- VISUAL BLOCK --} |
681
741
]] )
742
+ feed (' <LeftDrag><0,1>' )
743
+ screen :expect ([[
744
+ testing |
745
+ ^m{1:ou}se |
746
+ {1:sup}port and selection |
747
+ {0:~ }|
748
+ {2:-- VISUAL BLOCK --} |
749
+ ]] )
750
+ feed (' <LeftDrag><4,0>' )
751
+ screen :expect ([[
752
+ te{1:st}^ing |
753
+ mo{1:use} |
754
+ su{1:ppo}rt and selection |
755
+ {0:~ }|
756
+ {2:-- VISUAL BLOCK --} |
757
+ ]] )
758
+ feed (' <LeftDrag><14,2>' )
759
+ screen :expect ([[
760
+ testing |
761
+ mouse |
762
+ su{1:pport and se}^lection |
763
+ {0:~ }|
764
+ {2:-- VISUAL BLOCK --} |
765
+ ]] )
682
766
end )
683
767
684
768
it (' right click extends visual selection to the clicked location' , function ()
0 commit comments