Files
git/autocorrect.h
Jiamu Sun 46483152a4 autocorrect: provide config resolution API
Add autocorr_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 autocorr_resolve() is cold.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00

22 lines
382 B
C

#ifndef AUTOCORRECT_H
#define AUTOCORRECT_H
enum autocorr_mode {
AUTOCORRECT_HINTONLY,
AUTOCORRECT_NEVER,
AUTOCORRECT_PROMPT,
AUTOCORRECT_IMMEDIATELY,
AUTOCORRECT_DELAY,
};
struct autocorr {
enum autocorr_mode mode;
int delay;
};
void autocorr_resolve(struct autocorr *conf);
void autocorr_confirm(struct autocorr *conf, const char *assumed);
#endif /* AUTOCORRECT_H */