mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-10 16:54:08 -05:00
Add autocorrect_resolve(). This resolves and populates the correct values for autocorrect config. Make autocorrect config callback internal. The API is meant to provide a high-level way to retrieve the config. Allowing access to the config callback from outside violates that intent. Additionally, in some cases, without access to the config callback, two config iterations cannot be merged into one, which can hurt performance. This is fine, as the code path that calls autocorrect_resolve() is cold. Signed-off-by: Jiamu Sun <39@barroit.sh> Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 lines
399 B
C
22 lines
399 B
C
#ifndef AUTOCORRECT_H
|
|
#define AUTOCORRECT_H
|
|
|
|
enum autocorrect_mode {
|
|
AUTOCORRECT_HINT,
|
|
AUTOCORRECT_NEVER,
|
|
AUTOCORRECT_PROMPT,
|
|
AUTOCORRECT_IMMEDIATELY,
|
|
AUTOCORRECT_DELAY,
|
|
};
|
|
|
|
struct autocorrect {
|
|
enum autocorrect_mode mode;
|
|
int delay;
|
|
};
|
|
|
|
void autocorrect_resolve(struct autocorrect *conf);
|
|
|
|
void autocorrect_confirm(struct autocorrect *conf, const char *assumed);
|
|
|
|
#endif /* AUTOCORRECT_H */
|