mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-10 16:54:08 -05:00
autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINT
AUTOCORRECT_SHOW is ambiguous. Its purpose is to show commands similar to the unknown one and take no other action. Rename it to fit the semantics. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
a6e0ccbd38
commit
f06f1f043c
@@ -12,7 +12,7 @@ static enum autocorrect_mode parse_autocorrect(const char *value)
|
||||
case 1:
|
||||
return AUTOCORRECT_IMMEDIATELY;
|
||||
case 0:
|
||||
return AUTOCORRECT_SHOW;
|
||||
return AUTOCORRECT_HINT;
|
||||
default: /* other random text */
|
||||
break;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ static enum autocorrect_mode parse_autocorrect(const char *value)
|
||||
else if (!strcmp(value, "immediate"))
|
||||
return AUTOCORRECT_IMMEDIATELY;
|
||||
else if (!strcmp(value, "show"))
|
||||
return AUTOCORRECT_SHOW;
|
||||
return AUTOCORRECT_HINT;
|
||||
else
|
||||
return AUTOCORRECT_DELAY;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ void autocorrect_resolve_config(const char *var, const char *value,
|
||||
conf->delay = git_config_int(var, value, ctx->kvi);
|
||||
|
||||
if (!conf->delay)
|
||||
conf->mode = AUTOCORRECT_SHOW;
|
||||
conf->mode = AUTOCORRECT_HINT;
|
||||
else if (conf->delay < 0 || conf->delay == 1)
|
||||
conf->mode = AUTOCORRECT_IMMEDIATELY;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
struct config_context;
|
||||
|
||||
enum autocorrect_mode {
|
||||
AUTOCORRECT_SHOW,
|
||||
AUTOCORRECT_HINT,
|
||||
AUTOCORRECT_NEVER,
|
||||
AUTOCORRECT_PROMPT,
|
||||
AUTOCORRECT_IMMEDIATELY,
|
||||
|
||||
2
help.c
2
help.c
@@ -674,7 +674,7 @@ char *help_unknown_cmd(const char *cmd)
|
||||
; /* still counting */
|
||||
}
|
||||
|
||||
if (cfg.autocorrect.mode != AUTOCORRECT_SHOW && n == 1 &&
|
||||
if (cfg.autocorrect.mode != AUTOCORRECT_HINT && n == 1 &&
|
||||
SIMILAR_ENOUGH(best_similarity)) {
|
||||
char *assumed = xstrdup(main_cmds.names[0]->name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user