nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH] add rebinding for Ctrl+Arrow-keys combinations


From: Rishabh Dave
Subject: [Nano-devel] [PATCH] add rebinding for Ctrl+Arrow-keys combinations
Date: Wed, 3 Aug 2016 01:21:40 +0530

Hello,

I have tried to resolve "bug #44688: rebinding ^Left and ^Right does
not work". Link to it - http://savannah.gnu.org/bugs/?44688. Since it
required negligible effort to extend it to ^Arrow instead of
^Left/Right, I have covered that as well.

^Arrow-keys are not re-assignable because they are hard-coded to jump
to next/previous word/block. Moreover, code only considers shortcut
with a single pair of characters like ^G. Code, thus, sees the content
of variable sc->keystr as ^U/D/L/R (instead of ^Up/Down/Left/Right)
and ignores the rest of characters, ending up in assigning wrong
values to s->seq.

Attached patch makes rebinding Ctrl-Arrow key combinations possible,
but it may not be the correct/appropriate/best way. Mostly, I've
tested on following statements in ~/.nanorc -

bind ^Left exit main
bind ^Right help main
bind ^Down writeout main
bind ^Up whereis main
#bind F6 exit main


Since I was dubious regarding my method, I have kept the patch
incomplete (checking for and updating code to new commits, syntax
colouring for  the rebinding code in .nanorc is not covered, etc) for
this reason. However, patch is tested for leaks, etc.

Before hitting composing mail, I checked archive and found a similar
topic - [PATCH] input: make the Ctrl+Arrow keys work on a Linux
console. Certainly, we are not on same issue. As far as I can see,
they both concern same feature but different issues - "make work" and
"add rebind".

Attachment: add-rebinding-for-ctrl-arrows.patch
Description: Text Data


reply via email to

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