Allow usage of OpenAI integration in offline mode for #220

Offline mode is more about disabling syncing, so it is reasonable to still allow AI completions if the user has explicitly turned it on.
This commit is contained in:
David Dworken
2024-08-25 15:31:11 -07:00
parent 24f69ca29d
commit 7bbd0cb036
2 changed files with 5 additions and 1 deletions

View File

@ -602,6 +602,10 @@ func setup(userSecret string, isOffline bool) error {
config.HighlightMatches = true
config.AiCompletion = true
config.IsOffline = isOffline
if isOffline {
// By default, offline mode disables AI completion. Users can still enable it if they want it. See #220.
config.AiCompletion = false
}
config.EnablePresaving = true
err := hctx.SetConfig(&config)
if err != nil {