nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] support for alt-arrow keys


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] support for alt-arrow keys
Date: Sat, 12 Aug 2017 13:57:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1


Hi Urja,

Op 11-08-2017 om 14:37 schreef Urja Rannikko:
Hi, this patch (attached) was born because i wanted to do this:
bind M-Left prevbuf main
bind M-Right nextbuf main

Hmm...  Yes, that looks like a natural use for those key combos.

Thanks for the patch.

It slightly reworks the key parsing to have less special casing in
the M-things.

In the attached version I have removed a few superfluous tests on
string length (because they have already been done in parse_binding()),
elided the variable 'meta', renamed the new function, reshuffled some
of the insertions (to have the unshifted before the shifted keystrokes)
and given the Alt+Arrow keys unique codes.  Please check if you are
okay with this version.

At first I thought that, when allowing to bind the Alt+Arrow keys, we
should also allow to rebind the Ctrl+Arrow keys.  But if we allow that,
we should also allow the Shift+Ctrl+Arrow keys, and for that we would
have to invent a new notation...  So we'll let that be, and will just
allow the user to make the Alt+Arrow keys do something useful.

Also fixes you previously being able to bind like bare arrow keys and such
with F-1 to F-9.

It took a while to parse this.  :)  But in the end I filed
https://savannah.gnu.org/bugs/?51735 on your behalf.

I added a simplistic update to the nanorc man page.

Looks okay.

I know that nanorc.nanorc would need to be updated to
properly highlight those new keys, but I'm not that good
at regexes.

I've added it in the patch.  Something similar would be needed for
nanohelp.nanorc, but I've left that, because I think the "Left",
"Right", "Up" and "Down" should be transformed to actual arrows in
the help text -- so that they will fit and will match the other
uses of arrows.

Benno

Attachment: 0001-bindings-allow-assigning-functions-to-the-Alt-arrow-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]