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

Anton Shestakov av6 at dwimlabs.net
Mon Jan 16 12:04:29 EST 2017


On Fri, 13 Jan 2017 22:25:24 -0800
Martin von Zweigbergk <martinvonz at google.com> wrote:

> On Fri, Jan 13, 2017, 15:43 Sean Farley <sean at farley.io> wrote:
> 
> > Anton Shestakov <av6 at dwimlabs.net> writes:
> >
> > > On Tue, 10 Jan 2017 17:27:32 +0100
> > > Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> > >
> > >>
> > >>
> > >> On 01/08/2017 03:19 AM, Anton Shestakov wrote:
> > >> > # 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?
> > >>
> > >> What about using a modifier key for that ? eg: shift space select and
> > >> move forward.
> > >
> > > I don't know. I can't think of a key combination and/or modifier that
> > > would feel natural as a way to do "action" vs. "action+move". You know
> > > how in some IM clients Enter sends the message and Shift+Enter just
> > > inserts a newline? It's the closest I could think of and it's still
> > > pretty different (there it's "action" vs. "newline").
> >
> 
> 
> I thought Gmail had something like this for selecting conversations and
> advancing, but it doesn't seem like it. However, I found that it uses '['
> and ']' to navigate between conversations and '{' and '}' (which on US
> keyboard are shifted '[' and ']'). By analogy, since crecord uses 'j' and
> 'k' to navigate (or arrow keys), perhaps 'J' and 'K' could be used to
> select/deselect and move down/up?

Okay, this could work. Personally, I'm more used to arrow keys, so if
it's possible to read Shift+Arrow keys in curses - sounds good.

There's one issue that I can see in this idea though, because using
Shift key could both feel like you're "dragging a selection" over a
number of lines or not feel like that at all. Let's consider a number
of lines in a hunk; some of the lines are selected for commit (let's
say even), some are not (let's say odd). When you think about
Shift-ArrowDown as dragging a selection, it should make all of the
lines selected (or all deselected, depending on the state of the first
line in the "selection"). I never thought about this originally, but
this behavior could be even more useful. Or not, it's hard to tell
without trying it out.

I'll try and see if it works for me after I add tests for
experimental.spacemovesdown (which should happen soon-ish).


More information about the Mercurial-devel mailing list