1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-07-03 14:11:26 +02:00

39982: $SPROMPT: Don't accept a spelling correction at space/tab.

The patch also downscopes a couple of local variables, with no
functional change.
This commit is contained in:
Daniel Shahaf 2016-11-19 07:55:42 +00:00
parent c0f95d07e7
commit b3a88a53d3
3 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2016-11-24 Daniel Shahaf <d.s@daniel.shahaf.name>
* 39982: README, Src/utils.c: $SPROMPT: Don't accept a spelling
correction at space/tab.
2016-11-23 Bart Schaefer <schaefer@zsh.org>
* unposted: Src/Zle/zle_main.c: clear ERRFLAG_ERROR before

5
README
View file

@ -116,6 +116,11 @@ are output as "export" commands unless the parameter is also local, and
other parameters not local to the scope are output with the "-g" option.
Previously, only "typeset" commands were output, never using "-g".
8) At spelling-correction prompt ($SPROMPT), where the choices offered are
[nyae], previously <Enter> would be accepted to mean [N] and <Space> and
<Tab> would be accepted to mean [Y]. Now <Space> and <Tab> are invalid
choices: typing either of them remains at the prompt.
Incompatibilities between 5.0.8 and 5.2
---------------------------------------

View file

@ -2944,9 +2944,7 @@ mod_export void
spckword(char **s, int hist, int cmd, int ask)
{
char *t, *correct_ignore;
int x;
char ic = '\0';
int ne;
int preflen = 0;
int autocd = cmd && isset(AUTOCD) && strcmp(*s, ".") && strcmp(*s, "..");
@ -3015,6 +3013,7 @@ spckword(char **s, int hist, int cmd, int ask)
} else {
guess = *s;
if (*guess == Tilde || *guess == String) {
int ne;
ic = *guess;
if (!*++t)
return;
@ -3059,6 +3058,7 @@ spckword(char **s, int hist, int cmd, int ask)
if (errflag)
return;
if (best && (int)strlen(best) > 1 && strcmp(best, guess)) {
int x;
if (ic) {
char *u;
if (preflen) {
@ -3088,14 +3088,14 @@ spckword(char **s, int hist, int cmd, int ask)
free(pptbuf);
fflush(shout);
zbeep();
x = getquery("nyae \t", 0);
x = getquery("nyae", 0);
if (cmd && x == 'n')
pathchecked = path;
} else
x = 'n';
} else
x = 'y';
if (x == 'y' || x == ' ' || x == '\t') {
if (x == 'y') {
*s = dupstring(best);
if (hist)
hwrep(best);