summaryrefslogtreecommitdiff
path: root/internal/appconfig
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-10-03 23:50:49 +0300
committerPaul Buetow <paul@buetow.org>2025-10-03 23:50:49 +0300
commit420b5aebf888c638ac096e1476c06eac979ac257 (patch)
tree59434cbc37837399d7b5bc7920ffd7be62f1fc7d /internal/appconfig
parente36a5446bc62842ae3b3e165f66fecb7285a8c6a (diff)
Switch inline prompt markers to >! prefixv0.15.1
Diffstat (limited to 'internal/appconfig')
-rw-r--r--internal/appconfig/config.go4
-rw-r--r--internal/appconfig/config_alias_test.go39
-rw-r--r--internal/appconfig/config_test.go2
3 files changed, 22 insertions, 23 deletions
diff --git a/internal/appconfig/config.go b/internal/appconfig/config.go
index e5a8d5f..59ffd89 100644
--- a/internal/appconfig/config.go
+++ b/internal/appconfig/config.go
@@ -44,7 +44,7 @@ type App struct {
TriggerCharacters []string `json:"trigger_characters" toml:"trigger_characters"`
Provider string `json:"provider" toml:"provider"`
- // Inline prompt trigger characters (default: >text> and >>text>)
+ // Inline prompt trigger characters (default: >!text> and >>!text>)
InlineOpen string `json:"inline_open" toml:"inline_open"`
InlineClose string `json:"inline_close" toml:"inline_close"`
// In-editor chat triggers (default: suffix ">" after one of [?, !, :, ;])
@@ -141,7 +141,7 @@ func newDefaultConfig() App {
CompletionDebounceMs: 800,
CompletionThrottleMs: 0,
// Inline/chat trigger defaults
- InlineOpen: ">",
+ InlineOpen: ">!",
InlineClose: ">",
ChatSuffix: ">",
ChatPrefixes: []string{"?", "!", ":", ";"},
diff --git a/internal/appconfig/config_alias_test.go b/internal/appconfig/config_alias_test.go
index 6cc5bda..da7909e 100644
--- a/internal/appconfig/config_alias_test.go
+++ b/internal/appconfig/config_alias_test.go
@@ -1,20 +1,20 @@
package appconfig
import (
- "log"
- "os"
- "path/filepath"
- "testing"
+ "log"
+ "os"
+ "path/filepath"
+ "testing"
)
func TestOpenAIPresets_AliasResolution(t *testing.T) {
- dir := t.TempDir()
- t.Setenv("XDG_CONFIG_HOME", dir)
- cfgDir := filepath.Join(dir, "hexai")
- if err := os.MkdirAll(cfgDir, 0o755); err != nil {
- t.Fatalf("mkdir: %v", err)
- }
- toml := `
+ dir := t.TempDir()
+ t.Setenv("XDG_CONFIG_HOME", dir)
+ cfgDir := filepath.Join(dir, "hexai")
+ if err := os.MkdirAll(cfgDir, 0o755); err != nil {
+ t.Fatalf("mkdir: %v", err)
+ }
+ toml := `
[provider]
name = "openai"
@@ -24,13 +24,12 @@ model = "codex"
[openai.presets]
codex = "gpt-5-codex"
`
- path := filepath.Join(cfgDir, "config.toml")
- if err := os.WriteFile(path, []byte(toml), 0o644); err != nil {
- t.Fatalf("write: %v", err)
- }
- cfg := Load(log.New(os.Stderr, "test ", 0))
- if cfg.OpenAIModel != "gpt-5-codex" {
- t.Fatalf("expected alias to resolve to gpt-5-codex, got %q", cfg.OpenAIModel)
- }
+ path := filepath.Join(cfgDir, "config.toml")
+ if err := os.WriteFile(path, []byte(toml), 0o644); err != nil {
+ t.Fatalf("write: %v", err)
+ }
+ cfg := Load(log.New(os.Stderr, "test ", 0))
+ if cfg.OpenAIModel != "gpt-5-codex" {
+ t.Fatalf("expected alias to resolve to gpt-5-codex, got %q", cfg.OpenAIModel)
+ }
}
-
diff --git a/internal/appconfig/config_test.go b/internal/appconfig/config_test.go
index 4ae04d8..2c00f68 100644
--- a/internal/appconfig/config_test.go
+++ b/internal/appconfig/config_test.go
@@ -365,7 +365,7 @@ manual_invoke_min_prefix = 3
trigger_characters = [".", ":"]
[inline]
-inline_open = ">"
+inline_open = ">!"
inline_close = ">"
[chat]