zsh-workers
 help / color / mirror / code / Atom feed
From: Thorsten Meinecke <kaefer@aglaia.aball.DE>
To: zsh-workers@math.gatech.edu
Subject: Re: big key binding patch
Date: Mon, 25 Nov 1996 19:57:53 +0100 (MET)	[thread overview]
Message-ID: <m0vS6E8-00008PC@aglaia.aball.DE> (raw)
In-Reply-To: <24676.199611251602@stone.dcs.warwick.ac.uk> from "Zefram" at Nov 25, 96 04:02:40 pm

In archive/latest/2472, Zefram wrote:
> That'll teach me to assume that someone else was mistaken.  The code I
> replaced had HashTable *'s in that list, and extra dereferences.

That'll teach me to put the rationale for such hacks into comments.
Don't you appreciate patches sent in by wannabe hackers from all
over the world?

Anyway, with Zefram's patch, which is sure impressive, I'm experi-
encing core dumps in vi mode.  Let's say, I'm pressing those keys in
an xterm: Cursor-up, cursor-down, cursor-up, ie.

  ~/wrk/z/zsh-3.1.0-test3/Src> <ESC>[A<ESC>[B<ESC>[A
  Program received signal SIGSEGV, Segmentation fault.
  0x8098b2b in getkeycmd () at zle_main.c:542
  542             if (cky->func == z_undefinedkey)
  (gdb) [A
        ^^
Now, after two feep()s and the third key-press, the prefix is recog-
nized, but there's no binding for it in keybindtab (== vikeybindtab),
dereferencing cky (== NULL).  The easy way out is to add the default
cursor key bindings also to vi insert mode. 

[ In a similar vain, what exactly happens to meta-bindings like "\M-x"
  after `bindkey -m'? They're displayed as "^[x", and `bindkey -{a,v}m'
  makes them look like (*iso8859-1 alert*) "ø".  They're working OK,
  albeit difficult to locate on my keyboard. ]

Regards,
--Thorsten

--- zle_main.c	1996/11/24 18:16:15	2.33
+++ zle_main.c	1996/11/25 18:11:40
@@ -687,6 +687,12 @@
     addbinding(altbindtab, altkeybindtab, "\33[A", 3, z_uplineorhistory);
     addbinding(altbindtab, altkeybindtab, "\33[B", 3, z_downlineorhistory);
 
+    /* vi insert mode: arrow keys */
+    addbinding(vibindtab, vikeybindtab, "\33[C", 3, z_forwardchar);
+    addbinding(vibindtab, vikeybindtab, "\33[D", 3, z_backwardchar);
+    addbinding(vibindtab, vikeybindtab, "\33[A", 3, z_uplineorhistory);
+    addbinding(vibindtab, vikeybindtab, "\33[B", 3, z_downlineorhistory);
+
     /* emacs mode: arrow keys */
     addbinding(embindtab, emkeybindtab, "\33[C", 3, z_forwardchar);
     addbinding(embindtab, emkeybindtab, "\33[D", 3, z_backwardchar);


  reply	other threads:[~1996-11-25 18:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-24 15:30 Zefram
1996-11-25 13:22 ` Peter Stephenson
1996-11-25 16:02   ` Zefram
1996-11-25 18:57     ` Thorsten Meinecke [this message]
1996-11-25 22:05       ` Zefram
1996-11-26  8:46         ` Zefram
1996-11-26 12:03 Duncan Sinclair
1996-11-26 12:10 ` Zefram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0vS6E8-00008PC@aglaia.aball.DE \
    --to=kaefer@aglaia.aball.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).