@@ -607,7 +607,7 @@ def test_global_namespace_completion(self):
607
607
output = multiline_input (reader , namespace )
608
608
self .assertEqual (output , "python" )
609
609
610
- def test_updown_arrow_with_completion_menu (self ):
610
+ def test_up_down_arrows_with_completion_menu (self ):
611
611
"""Up arrow in the middle of unfinished tab completion when the menu is displayed
612
612
should work and trigger going back in history. Down arrow should subsequently
613
613
get us back to the incomplete command."""
@@ -633,6 +633,29 @@ def test_updown_arrow_with_completion_menu(self):
633
633
self .assertEqual (output , "os." )
634
634
635
635
636
+ def test_right_down_arrows_with_completion_menu (self ):
637
+ """Right / Down arrows while the tab completion menu is displayed
638
+ should do nothing"""
639
+ code = "os.\t \t "
640
+ namespace = {"os" : os }
641
+
642
+ events = itertools .chain (
643
+ code_to_events (code ),
644
+ [
645
+ Event (evt = "key" , data = "down" , raw = bytearray (b"\x1b OB" )),
646
+ Event (evt = "key" , data = "right" , raw = bytearray (b"\x1b OC" )),
647
+ ],
648
+ code_to_events ("\n " )
649
+ )
650
+ reader = self .prepare_reader (events , namespace = namespace )
651
+ output = multiline_input (reader , namespace )
652
+ self .assertEqual (output , "os." )
653
+ # When we press right and/or down arrow while
654
+ # the completions menu is displayed,
655
+ # the cursor should stay where it was on the line.
656
+ self .assertEqual (reader .cmpltn_menu_vis , 1 )
657
+ self .assertEqual (reader .cxy , (6 , 0 ))
658
+
636
659
@patch ("_pyrepl.curses.tigetstr" , lambda x : b"" )
637
660
class TestUnivEventQueue (TestCase ):
638
661
def setUp (self ):
0 commit comments