* PATCH: fix bug with Ctrl-^ handling
@ 2000-03-09 15:52 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2000-03-09 15:52 UTC (permalink / raw)
To: Zsh workers
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-03-09 15:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-09 15:52 PATCH: fix bug with Ctrl-^ handling Oliver Kiddle
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).