zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: fix bug with Ctrl-^ handling
Date: Thu, 09 Mar 2000 15:52:54 +0000	[thread overview]
Message-ID: <38C7C8D6.A69E1E6C@u.genie.co.uk> (raw)

My normal editor allows Ctrl-6 and Shift-Ctrl-6 to be used for changing the case of the current selection. Sadly my terminal won't distinguish between the two keystrokes but I thought I'd bind it to uppercase the current word in zsh anyway. This revealed a bug in getkeystring():

in 3.1.6-dev-19:
bindkey '^^' capitalise-word
bindkey: cannot bind to an empty key sequence

in Bart's preliminary 3.0.8 I don't get an error message but the key continues to do nothing.

The problem was that in getkeystring() both '^'s are picked up and taken to set the variable control so the bindkey command works as if I had used just '^' as the key parameter. The following small patch fixes it. I have included patches for both 3.1.6 and 3.0.8 so you may need to separate them first or something.

Oliver Kiddle

--- zsh-3.1.6-dev-19/Src/utils.c.bak	Thu Mar  9 15:03:36 2000
+++ zsh-3.1.6-dev-19/Src/utils.c	Thu Mar  9 15:28:24 2000
@@ -3198,7 +3198,7 @@
 	} else if (fromwhere == 4 && *s == Snull) {
 	    for (u = t; (*u++ = *s++););
 	    return t + 1;
-	} else if (*s == '^' &&
+	} else if (*s == '^' && !control &&
 		   (fromwhere == 2 || fromwhere == 5 || fromwhere == 6)) {
 	    control = 1;
 	    continue;
--- zsh-3.0.8/Src/zle_main.c.bak	Thu Mar  9 15:25:39 2000
+++ zsh-3.0.8/Src/zle_main.c	Thu Mar  9 15:26:23 2000
@@ -845,7 +845,7 @@
 		}
 		break;
 	    }
-	} else if (*s == '^' && fromwhere == 2) {
+	} else if (*s == '^' && !control && fromwhere == 2) {
 	    control = 1;
 	    continue;
 	} else if (*s == Meta)


                 reply	other threads:[~2000-03-09 15:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=38C7C8D6.A69E1E6C@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).