crecord: enable search hotkeys (issue6834)
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Wed, 14 Feb 2024 22:55:11 -0500
changeset 51387 0e063a9b764a
parent 51386 d0f6b96d1fb8
child 51390 92c7765931e0
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.
mercurial/crecord.py
--- 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"]: