##// END OF EJS Templates
crecord: new keys g & G to navigate to the top and bottom respectively...
Arun Chandrasekaran -
r42240:80103ed2 default
parent child Browse files
Show More
@@ -1467,6 +1467,8 b' the following are valid keystrokes:'
1467 pgup/pgdn [K/J] : go to previous/next item of same type
1467 pgup/pgdn [K/J] : go to previous/next item of same type
1468 right/left-arrow [l/h] : go to child item / parent item
1468 right/left-arrow [l/h] : go to child item / parent item
1469 shift-left-arrow [H] : go to parent header / fold selected header
1469 shift-left-arrow [H] : go to parent header / fold selected header
1470 g : go to the top
1471 G : go to the bottom
1470 f : fold / unfold item, hiding/revealing its children
1472 f : fold / unfold item, hiding/revealing its children
1471 F : fold / unfold parent item and all of its ancestors
1473 F : fold / unfold parent item and all of its ancestors
1472 ctrl-l : scroll the selected line to the top of the screen
1474 ctrl-l : scroll the selected line to the top of the screen
@@ -1505,6 +1507,45 b' the following are valid keystrokes:'
1505 self.stdscr.refresh()
1507 self.stdscr.refresh()
1506 self.stdscr.keypad(1) # allow arrow-keys to continue to function
1508 self.stdscr.keypad(1) # allow arrow-keys to continue to function
1507
1509
1510 def handlefirstlineevent(self):
1511 """
1512 Handle 'g' to navigate to the top most file in the ncurses window.
1513 """
1514 self.currentselecteditem = self.headerlist[0]
1515 currentitem = self.currentselecteditem
1516 # select the parent item recursively until we're at a header
1517 while True:
1518 nextitem = currentitem.parentitem()
1519 if nextitem is None:
1520 break
1521 else:
1522 currentitem = nextitem
1523
1524 self.currentselecteditem = currentitem
1525
1526 def handlelastlineevent(self):
1527 """
1528 Handle 'G' to navigate to the bottom most file/hunk/line depending
1529 on the whether the fold is active or not.
1530
1531 If the bottom most file is folded, it navigates to that file and
1532 stops there. If the bottom most file is unfolded, it navigates to
1533 the bottom most hunk in that file and stops there. If the bottom most
1534 hunk is unfolded, it navigates to the bottom most line in that hunk.
1535 """
1536 currentitem = self.currentselecteditem
1537 nextitem = currentitem.nextitem()
1538 # select the child item recursively until we're at a footer
1539 while nextitem is not None:
1540 nextitem = currentitem.nextitem()
1541 if nextitem is None:
1542 break
1543 else:
1544 currentitem = nextitem
1545
1546 self.currentselecteditem = currentitem
1547 self.recenterdisplayedarea()
1548
1508 def confirmationwindow(self, windowtext):
1549 def confirmationwindow(self, windowtext):
1509 "display an informational window, then wait for and return a keypress."
1550 "display an informational window, then wait for and return a keypress."
1510
1551
@@ -1725,6 +1766,10 b' are you sure you want to review/edit and'
1725 self.togglefolded(foldparent=True)
1766 self.togglefolded(foldparent=True)
1726 elif keypressed in ["m"]:
1767 elif keypressed in ["m"]:
1727 self.commitMessageWindow()
1768 self.commitMessageWindow()
1769 elif keypressed in ["g", "KEY_HOME"]:
1770 self.handlefirstlineevent()
1771 elif keypressed in ["G", "KEY_END"]:
1772 self.handlelastlineevent()
1728 elif keypressed in ["?"]:
1773 elif keypressed in ["?"]:
1729 self.helpwindow()
1774 self.helpwindow()
1730 self.stdscr.clear()
1775 self.stdscr.clear()
General Comments 0
You need to be logged in to leave comments. Login now