mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-12-08 18:31:28 +01: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:
parent
c0f95d07e7
commit
b3a88a53d3
3 changed files with 14 additions and 4 deletions
|
|
@ -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>
|
2016-11-23 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* unposted: Src/Zle/zle_main.c: clear ERRFLAG_ERROR before
|
* unposted: Src/Zle/zle_main.c: clear ERRFLAG_ERROR before
|
||||||
|
|
|
||||||
5
README
5
README
|
|
@ -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.
|
other parameters not local to the scope are output with the "-g" option.
|
||||||
Previously, only "typeset" commands were output, never using "-g".
|
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
|
Incompatibilities between 5.0.8 and 5.2
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2944,9 +2944,7 @@ mod_export void
|
||||||
spckword(char **s, int hist, int cmd, int ask)
|
spckword(char **s, int hist, int cmd, int ask)
|
||||||
{
|
{
|
||||||
char *t, *correct_ignore;
|
char *t, *correct_ignore;
|
||||||
int x;
|
|
||||||
char ic = '\0';
|
char ic = '\0';
|
||||||
int ne;
|
|
||||||
int preflen = 0;
|
int preflen = 0;
|
||||||
int autocd = cmd && isset(AUTOCD) && strcmp(*s, ".") && strcmp(*s, "..");
|
int autocd = cmd && isset(AUTOCD) && strcmp(*s, ".") && strcmp(*s, "..");
|
||||||
|
|
||||||
|
|
@ -3015,6 +3013,7 @@ spckword(char **s, int hist, int cmd, int ask)
|
||||||
} else {
|
} else {
|
||||||
guess = *s;
|
guess = *s;
|
||||||
if (*guess == Tilde || *guess == String) {
|
if (*guess == Tilde || *guess == String) {
|
||||||
|
int ne;
|
||||||
ic = *guess;
|
ic = *guess;
|
||||||
if (!*++t)
|
if (!*++t)
|
||||||
return;
|
return;
|
||||||
|
|
@ -3059,6 +3058,7 @@ spckword(char **s, int hist, int cmd, int ask)
|
||||||
if (errflag)
|
if (errflag)
|
||||||
return;
|
return;
|
||||||
if (best && (int)strlen(best) > 1 && strcmp(best, guess)) {
|
if (best && (int)strlen(best) > 1 && strcmp(best, guess)) {
|
||||||
|
int x;
|
||||||
if (ic) {
|
if (ic) {
|
||||||
char *u;
|
char *u;
|
||||||
if (preflen) {
|
if (preflen) {
|
||||||
|
|
@ -3088,14 +3088,14 @@ spckword(char **s, int hist, int cmd, int ask)
|
||||||
free(pptbuf);
|
free(pptbuf);
|
||||||
fflush(shout);
|
fflush(shout);
|
||||||
zbeep();
|
zbeep();
|
||||||
x = getquery("nyae \t", 0);
|
x = getquery("nyae", 0);
|
||||||
if (cmd && x == 'n')
|
if (cmd && x == 'n')
|
||||||
pathchecked = path;
|
pathchecked = path;
|
||||||
} else
|
} else
|
||||||
x = 'n';
|
x = 'n';
|
||||||
} else
|
} else
|
||||||
x = 'y';
|
x = 'y';
|
||||||
if (x == 'y' || x == ' ' || x == '\t') {
|
if (x == 'y') {
|
||||||
*s = dupstring(best);
|
*s = dupstring(best);
|
||||||
if (hist)
|
if (hist)
|
||||||
hwrep(best);
|
hwrep(best);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue