nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] ah, here we are again: Ctrl+Left and Ctrl+Right [patch]


From: Benno Schulenberg
Subject: [Nano-devel] ah, here we are again: Ctrl+Left and Ctrl+Right [patch]
Date: Mon, 23 Jun 2014 18:28:55 +0200

Hello all,

Years ago I tried to get Ctrl+Left and Ctrl+Right to do previous-word
and next-word in Nano.  In the end I succeeded, but in a way that
never made it into the repositories.

https://lists.gnu.org/archive/html/nano-devel/2006-12/msg00013.html
https://lists.gnu.org/archive/html/nano-devel/2008-01/msg00002.html

Now I read the code and find that Nano recognizes perfectly fine
a whole series of different Ctrl-Left and Ctrl-Right combinations,
but drops them all down to a plain Left or Right.  I think this is
silly.  When Nano sees Control-Arrow keys as different from plain
Arrow keys, it should hold on to that distinction, and it should do
something special in the case of Control, or do nothing at all: just
say "Unknown Command", as for the few free key combos that are left.

So, I made the attached patch.  For CONTROL_LEFT and CONTROL_RIGHT
I chose values that are way beyond KEY_MAX of ncurses, which is 0777
octal, or 511 decimal, if I'm not mistaken.  Ideally these key codes
should propagate further into nano, to even allow the user to rebind
them, but for now a simple solution will have to do.

Right after making the patch I went and checked pico... and it already
knows Ctrl-Left and Ctrl-Right!  And it does it nicely, too.  It is high
time that nano learns this trick too.

Any objections, comments or pizzas on this patch going into SVN?

Benno

-- 
http://www.fastmail.fm - Send your email first class

Attachment: Ctrl-Left-Right.patch
Description: Text Data


reply via email to

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