From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.6/8.7.3) with ESMTP id FAA09708 for ; Tue, 26 Nov 1996 05:57:39 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA24855; Mon, 25 Nov 1996 13:50:08 -0500 (EST) Resent-Date: Mon, 25 Nov 1996 13:50:08 -0500 (EST) Message-Id: Subject: Re: big key binding patch To: zsh-workers@math.gatech.edu Date: Mon, 25 Nov 1996 19:57:53 +0100 (MET) In-Reply-To: <24676.199611251602@stone.dcs.warwick.ac.uk> from "Zefram" at Nov 25, 96 04:02:40 pm From: Thorsten Meinecke Organization: none. Location: Berlin, Germany X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Resent-Message-ID: <"hom-D2.0.H46.VfUco"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2475 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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> [A[B[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);