diff mercurial/crecord.py @ 51387:0e063a9b764a

crecord: enable search hotkeys (issue6834) The keys I chose here should be similar to less/vim keybindings, which should fit the overall keybinding theme of crecord.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 14 Feb 2024 22:55:11 -0500
parents d0f6b96d1fb8
children 89cd0dd41e4d
line wrap: on
line diff
--- a/mercurial/crecord.py	Wed Feb 14 22:54:21 2024 -0500
+++ b/mercurial/crecord.py	Wed Feb 14 22:55:11 2024 -0500
@@ -1665,6 +1665,9 @@
                       a : toggle all selections
                       c : confirm selected changes
                       r : review/edit and confirm selected changes
+                      / : regex search for code or filename
+                      n : next search result for code or filename
+                      N : previous search result for code or filename
                       q : quit without confirming (no changes will be made)
                       ? : help (what you're currently reading)"""
         )
@@ -2013,6 +2016,12 @@
             self.togglefolded(foldparent=True)
         elif keypressed in ["m"]:
             self.commitMessageWindow()
+        elif keypressed in ["/"]:
+            self.handlesearch()
+        elif keypressed in ["n"]:
+            self.handlenextsearch()
+        elif keypressed in ["N"]:
+            self.handleprevsearch()
         elif keypressed in ["g", "KEY_HOME"]:
             self.handlefirstlineevent()
         elif keypressed in ["G", "KEY_END"]: