[Top][All Lists]

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

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

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] add rebinding for Ctrl+Arrow-keys combinations
Date: Mon, 08 Aug 2016 19:24:58 +0200

On Mon, Aug 8, 2016, at 13:46, Rishabh Dave wrote:
> It's hard to discuss until one knows what the underlying problem truly
> is and if the problem is solvable and if one is capable of solving it.

It's solvable, and you solved it, and in quite an elegant way too --
I didn't realize it could be done by basically adding zero lines.

But... I don't like the moving around of all the initialization stuff.
I will have to think about that.

Comments about details of the patch:

@@ -446,6 +446,19 @@ void assign_keyinfo(sc *s, const char *keystring)
        s->keycode = KEY_HOME;
     else if (!strcasecmp(keystring, "End"))
        s->keycode = KEY_END;
+#ifndef NANO_TINY
+    /* Handle some special combinations, where combination is more than
+     * a pair of characters. */
+    if (!strcasecmp(keystring, "^Left"))
+       s->keycode = controlleft;
+    if (!strcasecmp(keystring, "^Right"))

No, this is not the place to put this block.  Look where ^Space is
handled; that's where this block should be hooked in.

@@ -2488,11 +2515,6 @@ int main(int argc, char **argv)
 #ifdef DEBUG
     fprintf(stderr, "Main: set up windows\n");
-    /* Initialize all the windows based on the current screen
-     * dimensions. */
-    window_init();

Hm.  You move the window initialization, but not the corresponding
debug print statement.  Keep things together.

@@ -396,14 +396,6 @@ int parse_kbinput(WINDOW *win)
                    case 'B':
                        retval = KEY_END;
-#ifndef NANO_TINY
-                   case 'C':
-                       retval = controlright;
-                       break;
-                   case 'D':
-                       retval = controlleft;
-                       break;

You're still breaking Ctrl+Left and Ctrl+Right on an iTerm.  Don't
remove those lines.


-- - A fast, anti-spam email service.

reply via email to

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