[PATCH RFC] crecord: make an option for space key to move cursor down (issue5159) (RFC)

Anton Shestakov av6 at dwimlabs.net
Sun Jan 8 02:19:30 UTC 2017


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1483841309 -28800
#      Sun Jan 08 10:08:29 2017 +0800
# Node ID 1afa1ffe6984bfe0027336ce0c83486e82ba2b50
# Parent  cfd14b0508ddf8edf156d202e2c5d07b259c2f46
crecord: make an option for space key to move cursor down (issue5159) (RFC)

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.

What do you people think? And in what section should I put the config?

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1588,6 +1588,8 @@ are you sure you want to review/edit and
             return True
         elif keypressed in [' '] or (test and keypressed in ["TOGGLE"]):
             self.toggleapply()
+            if self.ui.configbool('crecord', 'spacemovesdown'):
+                self.downarrowevent()
         elif keypressed in ['A']:
             self.toggleall()
         elif keypressed in ['e']:


More information about the Mercurial-devel mailing list