crecord: add an experimental option for space key to move cursor down
authorAnton Shestakov <av6@dwimlabs.net>
Sun, 08 Jan 2017 10:08:29 +0800
changeset 30797 0bde7372e4c0
parent 30796 168ef0a4eb3b
child 30798 f50c0db50025
crecord: add an experimental option for space key to move cursor down I really want to have an option of toggling a selection on a line and also moving cursor down as a single keystroke. It also kinda makes sense for space key to do this, because some other curses UIs in the wild do this (e.g. various file managers, htop). So I got an idea to make a config option that defaults to False for compatibility, but allows making crecord UI a lot more useful for people with big hunks. We add this an experimental option to experiment with this behavior.
mercurial/crecord.py
--- a/mercurial/crecord.py	Mon Jan 02 12:02:08 2017 -0800
+++ b/mercurial/crecord.py	Sun Jan 08 10:08:29 2017 +0800
@@ -1588,6 +1588,8 @@
             return True
         elif keypressed in [' '] or (test and keypressed in ["TOGGLE"]):
             self.toggleapply()
+            if self.ui.configbool('experimental', 'spacemovesdown'):
+                self.downarrowevent()
         elif keypressed in ['A']:
             self.toggleall()
         elif keypressed in ['e']: