|
@@ -24,7 +24,6 @@ import (
|
|
|
cmdcomp "github.com/sst/opencode/internal/components/commands"
|
|
cmdcomp "github.com/sst/opencode/internal/components/commands"
|
|
|
"github.com/sst/opencode/internal/components/dialog"
|
|
"github.com/sst/opencode/internal/components/dialog"
|
|
|
"github.com/sst/opencode/internal/components/fileviewer"
|
|
"github.com/sst/opencode/internal/components/fileviewer"
|
|
|
- "github.com/sst/opencode/internal/components/ide"
|
|
|
|
|
"github.com/sst/opencode/internal/components/modal"
|
|
"github.com/sst/opencode/internal/components/modal"
|
|
|
"github.com/sst/opencode/internal/components/status"
|
|
"github.com/sst/opencode/internal/components/status"
|
|
|
"github.com/sst/opencode/internal/components/toast"
|
|
"github.com/sst/opencode/internal/components/toast"
|
|
@@ -654,14 +653,16 @@ func (a Model) home() string {
|
|
|
|
|
|
|
|
// Use limit of 4 for vscode, 6 for others
|
|
// Use limit of 4 for vscode, 6 for others
|
|
|
limit := 6
|
|
limit := 6
|
|
|
- if os.Getenv("OPENCODE_CALLER") == "vscode" {
|
|
|
|
|
|
|
+ if util.IsVSCode() {
|
|
|
limit = 4
|
|
limit = 4
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ showVscode := util.IsVSCode()
|
|
|
commandsView := cmdcomp.New(
|
|
commandsView := cmdcomp.New(
|
|
|
a.app,
|
|
a.app,
|
|
|
cmdcomp.WithBackground(t.Background()),
|
|
cmdcomp.WithBackground(t.Background()),
|
|
|
cmdcomp.WithLimit(limit),
|
|
cmdcomp.WithLimit(limit),
|
|
|
|
|
+ cmdcomp.WithVscode(showVscode),
|
|
|
)
|
|
)
|
|
|
cmds := lipgloss.PlaceHorizontal(
|
|
cmds := lipgloss.PlaceHorizontal(
|
|
|
effectiveWidth,
|
|
effectiveWidth,
|
|
@@ -670,19 +671,6 @@ func (a Model) home() string {
|
|
|
styles.WhitespaceStyle(t.Background()),
|
|
styles.WhitespaceStyle(t.Background()),
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- // Add VSCode shortcuts if in VSCode environment
|
|
|
|
|
- var ideShortcuts string
|
|
|
|
|
- if os.Getenv("OPENCODE_CALLER") == "vscode" {
|
|
|
|
|
- ideView := ide.New()
|
|
|
|
|
- ideView.SetBackgroundColor(t.Background())
|
|
|
|
|
- ideShortcuts = lipgloss.PlaceHorizontal(
|
|
|
|
|
- effectiveWidth,
|
|
|
|
|
- lipgloss.Center,
|
|
|
|
|
- ideView.View(),
|
|
|
|
|
- styles.WhitespaceStyle(t.Background()),
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
lines := []string{}
|
|
lines := []string{}
|
|
|
lines = append(lines, "")
|
|
lines = append(lines, "")
|
|
|
lines = append(lines, "")
|
|
lines = append(lines, "")
|
|
@@ -690,10 +678,6 @@ func (a Model) home() string {
|
|
|
lines = append(lines, "")
|
|
lines = append(lines, "")
|
|
|
lines = append(lines, "")
|
|
lines = append(lines, "")
|
|
|
lines = append(lines, cmds)
|
|
lines = append(lines, cmds)
|
|
|
- if os.Getenv("OPENCODE_CALLER") == "vscode" {
|
|
|
|
|
- lines = append(lines, "")
|
|
|
|
|
- lines = append(lines, ideShortcuts)
|
|
|
|
|
- }
|
|
|
|
|
lines = append(lines, "")
|
|
lines = append(lines, "")
|
|
|
lines = append(lines, "")
|
|
lines = append(lines, "")
|
|
|
|
|
|