comparison mercurial/crecord.py @ 42572:cd4f1b7c3192

crecord: make KEY_ENTER usable in tests (by not updating UI) Differential Revision: https://phab.mercurial-scm.org/D6620
author Kyle Lippincott <spectral@google.com>
date Mon, 08 Jul 2019 13:06:46 -0700
parents 3be6ff55095b
children 9ac1a5a4a64f
comparison
equal deleted inserted replaced
42571:3be6ff55095b 42572:cd4f1b7c3192
721 nextitem = currentitem 721 nextitem = currentitem
722 722
723 self.currentselecteditem = nextitem 723 self.currentselecteditem = nextitem
724 self.recenterdisplayedarea() 724 self.recenterdisplayedarea()
725 725
726 def nextsametype(self): 726 def nextsametype(self, test=False):
727 currentitem = self.currentselecteditem 727 currentitem = self.currentselecteditem
728 sametype = lambda item: isinstance(item, type(currentitem)) 728 sametype = lambda item: isinstance(item, type(currentitem))
729 nextitem = currentitem.nextitem() 729 nextitem = currentitem.nextitem()
730 730
731 while nextitem is not None and not sametype(nextitem): 731 while nextitem is not None and not sametype(nextitem):
737 parent = nextitem.parentitem() 737 parent = nextitem.parentitem()
738 if parent is not None and parent.folded: 738 if parent is not None and parent.folded:
739 self.togglefolded(parent) 739 self.togglefolded(parent)
740 740
741 self.currentselecteditem = nextitem 741 self.currentselecteditem = nextitem
742 self.recenterdisplayedarea() 742 if not test:
743 self.recenterdisplayedarea()
743 744
744 def rightarrowevent(self): 745 def rightarrowevent(self):
745 """ 746 """
746 select (if possible) the first of this item's child-items. 747 select (if possible) the first of this item's child-items.
747 """ 748 """
1751 return True 1752 return True
1752 elif keypressed in [' ', 'x']: 1753 elif keypressed in [' ', 'x']:
1753 self.toggleapply() 1754 self.toggleapply()
1754 elif keypressed in ['\n', 'KEY_ENTER']: 1755 elif keypressed in ['\n', 'KEY_ENTER']:
1755 self.toggleapply() 1756 self.toggleapply()
1756 self.nextsametype() 1757 self.nextsametype(test=test)
1757 elif keypressed in ['A']: 1758 elif keypressed in ['A']:
1758 self.toggleall() 1759 self.toggleall()
1759 elif keypressed in ['e']: 1760 elif keypressed in ['e']:
1760 self.toggleedit(test=test) 1761 self.toggleedit(test=test)
1761 elif keypressed in ["f"]: 1762 elif keypressed in ["f"]: