##// END OF EJS Templates
crecord: make enter move cursor down to the next item of the same type...
av6 -
r40289:682f73fa default
parent child Browse files
Show More
@@ -616,9 +616,6 b" coreconfigitem('experimental', 'single-h"
616 616 coreconfigitem('experimental', 'sshserver.support-v2',
617 617 default=False,
618 618 )
619 coreconfigitem('experimental', 'spacemovesdown',
620 default=False,
621 )
622 619 coreconfigitem('experimental', 'sparse-read',
623 620 default=False,
624 621 )
@@ -713,6 +713,24 b' class curseschunkselector(object):'
713 713 self.currentselecteditem = nextitem
714 714 self.recenterdisplayedarea()
715 715
716 def nextsametype(self):
717 currentitem = self.currentselecteditem
718 sametype = lambda item: isinstance(item, type(currentitem))
719 nextitem = currentitem.nextitem()
720
721 while nextitem is not None and not sametype(nextitem):
722 nextitem = nextitem.nextitem()
723
724 if nextitem is None:
725 nextitem = currentitem
726 else:
727 parent = nextitem.parentitem()
728 if parent.folded:
729 self.togglefolded(parent)
730
731 self.currentselecteditem = nextitem
732 self.recenterdisplayedarea()
733
716 734 def rightarrowevent(self):
717 735 """
718 736 select (if possible) the first of this item's child-items.
@@ -1027,8 +1045,8 b' class curseschunkselector(object):'
1027 1045 def _getstatuslinesegments(self):
1028 1046 """-> [str]. return segments"""
1029 1047 selected = self.currentselecteditem.applied
1030 spaceselect = _('space: select')
1031 spacedeselect = _('space: deselect')
1048 spaceselect = _('space/enter: select')
1049 spacedeselect = _('space/enter: deselect')
1032 1050 # Format the selected label into a place as long as the longer of the
1033 1051 # two possible labels. This may vary by language.
1034 1052 spacelen = max(len(spaceselect), len(spacedeselect))
@@ -1433,6 +1451,7 b' can use crecord multiple times to split '
1433 1451 the following are valid keystrokes:
1434 1452
1435 1453 [space] : (un-)select item ([~]/[x] = partly/fully applied)
1454 [enter] : (un-)select item and go to next item of same type
1436 1455 A : (un-)select all items
1437 1456 up/down-arrow [k/j] : go to previous/next unfolded item
1438 1457 pgup/pgdn [K/J] : go to previous/next item of same type
@@ -1686,8 +1705,9 b' are you sure you want to review/edit and'
1686 1705 return True
1687 1706 elif keypressed in [' '] or (test and keypressed in ["TOGGLE"]):
1688 1707 self.toggleapply()
1689 if self.ui.configbool('experimental', 'spacemovesdown'):
1690 self.downarrowevent()
1708 elif keypressed in ['\n', 'KEY_ENTER']:
1709 self.toggleapply()
1710 self.nextsametype()
1691 1711 elif keypressed in ['A']:
1692 1712 self.toggleall()
1693 1713 elif keypressed in ['e']:
@@ -327,24 +327,6 b' reflect this edition.'
327 327 hello world
328 328 lower
329 329
330 Check spacemovesdown
331
332 $ cat <<EOF >> $HGRCPATH
333 > [experimental]
334 > spacemovesdown = true
335 > EOF
336 $ cat <<EOF >testModeCommands
337 > TOGGLE
338 > TOGGLE
339 > X
340 > EOF
341 $ hg status -q
342 M b
343 M x
344 $ hg commit -i -m "nothing to commit?" -d "0 0"
345 no changes to record
346 [1]
347
348 330 Check ui.interface logic for the chunkselector
349 331
350 332 The default interface is text
General Comments 0
You need to be logged in to leave comments. Login now