summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMárk Magyar <[email protected]>2025-06-22 20:26:46 +0200
committerGitHub <[email protected]>2025-06-22 14:26:46 -0400
commit333569bed38f1fff3c3413f67482cbc884111d41 (patch)
tree66108c30bd007437077270ba74bb5975fd25a1b5
parent09b89fdb232e25c6e8794f7fef8006591c58fb58 (diff)
downloadopencode-333569bed38f1fff3c3413f67482cbc884111d41.tar.gz
opencode-333569bed38f1fff3c3413f67482cbc884111d41.zip
ignore: fix typos and formatting (#294)
-rw-r--r--packages/opencode/src/tool/edit.ts2
-rw-r--r--packages/opencode/src/tool/multiedit.txt2
-rw-r--r--packages/tui/internal/app/app.go2
-rw-r--r--packages/tui/internal/components/dialog/complete.go2
-rw-r--r--packages/tui/internal/image/clipboard_unix.go5
-rw-r--r--packages/tui/internal/layout/overlay.go38
-rw-r--r--packages/tui/internal/theme/loader_test.go1
-rw-r--r--packages/tui/internal/tui/tui.go4
-rw-r--r--packages/tui/pkg/client/generated-client.go2
-rw-r--r--packages/web/src/components/Share.tsx4
-rw-r--r--packages/web/src/components/share.module.css4
11 files changed, 31 insertions, 35 deletions
diff --git a/packages/opencode/src/tool/edit.ts b/packages/opencode/src/tool/edit.ts
index 784001196..5dea06e32 100644
--- a/packages/opencode/src/tool/edit.ts
+++ b/packages/opencode/src/tool/edit.ts
@@ -22,7 +22,7 @@ export const EditTool = Tool.define({
replaceAll: z
.boolean()
.optional()
- .describe("Replace all occurences of old_string (default false)"),
+ .describe("Replace all occurrences of old_string (default false)"),
}),
async execute(params, ctx) {
if (!params.filePath) {
diff --git a/packages/opencode/src/tool/multiedit.txt b/packages/opencode/src/tool/multiedit.txt
index dded8c3c7..1b32bbd9c 100644
--- a/packages/opencode/src/tool/multiedit.txt
+++ b/packages/opencode/src/tool/multiedit.txt
@@ -10,7 +10,7 @@ To make multiple file edits, provide the following:
2. edits: An array of edit operations to perform, where each edit contains:
- old_string: The text to replace (must match the file contents exactly, including all whitespace and indentation)
- new_string: The edited text to replace the old_string
- - replace_all: Replace all occurences of old_string. This parameter is optional and defaults to false.
+ - replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.
IMPORTANT:
- All edits are applied in sequence, in the order they are provided
diff --git a/packages/tui/internal/app/app.go b/packages/tui/internal/app/app.go
index 6fb8242a4..f20620790 100644
--- a/packages/tui/internal/app/app.go
+++ b/packages/tui/internal/app/app.go
@@ -44,7 +44,7 @@ type SendMsg struct {
Text string
Attachments []Attachment
}
-type CompletionDialogTriggerdMsg struct {
+type CompletionDialogTriggeredMsg struct {
InitialValue string
}
diff --git a/packages/tui/internal/components/dialog/complete.go b/packages/tui/internal/components/dialog/complete.go
index 212df49f7..4924885f9 100644
--- a/packages/tui/internal/components/dialog/complete.go
+++ b/packages/tui/internal/components/dialog/complete.go
@@ -116,7 +116,7 @@ func (c *completionDialogComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case []CompletionItemI:
c.list.SetItems(msg)
- case app.CompletionDialogTriggerdMsg:
+ case app.CompletionDialogTriggeredMsg:
c.pseudoSearchTextArea.SetValue(msg.InitialValue)
case tea.KeyMsg:
if c.pseudoSearchTextArea.Focused() {
diff --git a/packages/tui/internal/image/clipboard_unix.go b/packages/tui/internal/image/clipboard_unix.go
index 3cb590207..2653d8cad 100644
--- a/packages/tui/internal/image/clipboard_unix.go
+++ b/packages/tui/internal/image/clipboard_unix.go
@@ -5,8 +5,8 @@ package image
import (
"bytes"
"fmt"
- "image"
"github.com/atotto/clipboard"
+ "image"
)
func GetImageFromClipboard() ([]byte, string, error) {
@@ -28,8 +28,6 @@ func GetImageFromClipboard() ([]byte, string, error) {
}
-
-
func binaryToImage(data []byte) ([]byte, error) {
reader := bytes.NewReader(data)
img, _, err := image.Decode(reader)
@@ -40,7 +38,6 @@ func binaryToImage(data []byte) ([]byte, error) {
return ImageToBytes(img)
}
-
func min(a, b int) int {
if a < b {
return a
diff --git a/packages/tui/internal/layout/overlay.go b/packages/tui/internal/layout/overlay.go
index c617da4cb..e14695c60 100644
--- a/packages/tui/internal/layout/overlay.go
+++ b/packages/tui/internal/layout/overlay.go
@@ -109,11 +109,11 @@ func PlaceOverlay(
// Get the foreground line
fgLine := fgLines[i-y]
fgLineWidth := ansi.PrintableRuneWidth(fgLine)
-
+
// Extract the styles at the border positions
leftStyle := getStyleAtPosition(bgLine, pos)
- rightStyle := getStyleAtPosition(bgLine, pos + 1 + fgLineWidth)
-
+ rightStyle := getStyleAtPosition(bgLine, pos+1+fgLineWidth)
+
// Left border - combine background from original with border foreground
leftSeq := combineStyles(leftStyle, options.borderColor)
if leftSeq != "" {
@@ -172,17 +172,17 @@ type ansiStyle struct {
// parseANSISequence parses an ANSI escape sequence into its components
func parseANSISequence(seq string) ansiStyle {
style := ansiStyle{}
-
+
// Extract the parameters from the sequence (e.g., \x1b[38;5;123;48;5;456m -> "38;5;123;48;5;456")
if !strings.HasPrefix(seq, "\x1b[") || !strings.HasSuffix(seq, "m") {
return style
}
-
+
params := seq[2 : len(seq)-1]
if params == "" {
return style
}
-
+
parts := strings.Split(params, ";")
i := 0
for i < len(parts) {
@@ -222,7 +222,7 @@ func parseANSISequence(seq string) ansiStyle {
}
i++
}
-
+
return style
}
@@ -231,32 +231,32 @@ func combineStyles(bgStyle ansiStyle, fgColor *compat.AdaptiveColor) string {
if fgColor == nil && bgStyle.bgColor == "" && len(bgStyle.attrs) == 0 {
return ""
}
-
+
var parts []string
-
+
// Add attributes
parts = append(parts, bgStyle.attrs...)
-
+
// Add background color from the original style
if bgStyle.bgColor != "" {
parts = append(parts, bgStyle.bgColor)
}
-
+
// Add foreground color if specified
if fgColor != nil {
// Use the light color (could be improved to detect terminal background)
color := (*fgColor).Light
-
+
// Use RGBA to get color components
r, g, b, _ := color.RGBA()
// RGBA returns 16-bit values, we need 8-bit
parts = append(parts, fmt.Sprintf("38;2;%d;%d;%d", r>>8, g>>8, b>>8))
}
-
+
if len(parts) == 0 {
return ""
}
-
+
return fmt.Sprintf("\x1b[%sm", strings.Join(parts, ";"))
}
@@ -264,10 +264,10 @@ func combineStyles(bgStyle ansiStyle, fgColor *compat.AdaptiveColor) string {
func getStyleAtPosition(s string, targetPos int) ansiStyle {
// ANSI escape sequence regex
ansiRegex := regexp.MustCompile(`\x1b\[[0-9;]*m`)
-
+
visualPos := 0
currentStyle := ansiStyle{}
-
+
i := 0
for i < len(s) && visualPos <= targetPos {
// Check if we're at an ANSI escape sequence
@@ -275,7 +275,7 @@ func getStyleAtPosition(s string, targetPos int) ansiStyle {
// Found an ANSI sequence at current position
seq := s[i : i+match[1]]
parsedStyle := parseANSISequence(seq)
-
+
// Update current style (merge with existing)
if parsedStyle.fgColor != "" {
currentStyle.fgColor = parsedStyle.fgColor
@@ -286,7 +286,7 @@ func getStyleAtPosition(s string, targetPos int) ansiStyle {
if len(parsedStyle.attrs) > 0 {
currentStyle.attrs = parsedStyle.attrs
}
-
+
i += match[1]
} else if i < len(s) {
// Regular character
@@ -298,7 +298,7 @@ func getStyleAtPosition(s string, targetPos int) ansiStyle {
visualPos++
}
}
-
+
return currentStyle
}
diff --git a/packages/tui/internal/theme/loader_test.go b/packages/tui/internal/theme/loader_test.go
index c854cac0f..1039ab3f1 100644
--- a/packages/tui/internal/theme/loader_test.go
+++ b/packages/tui/internal/theme/loader_test.go
@@ -133,4 +133,3 @@ func TestLoadThemesFromDirectories(t *testing.T) {
t.Error("Override theme not properly loaded")
}
}
-
diff --git a/packages/tui/internal/tui/tui.go b/packages/tui/internal/tui/tui.go
index c822388d3..6e90b02af 100644
--- a/packages/tui/internal/tui/tui.go
+++ b/packages/tui/internal/tui/tui.go
@@ -117,7 +117,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
updated, cmd := a.completions.Update(
- app.CompletionDialogTriggerdMsg{
+ app.CompletionDialogTriggeredMsg{
InitialValue: initialValue,
},
)
@@ -178,7 +178,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
// 7. Fallback to editor. This is for other characters
- // likek backspace, tab, etc.
+ // like backspace, tab, etc.
updatedEditor, cmd := a.editor.Update(msg)
a.editor = updatedEditor.(chat.EditorComponent)
return a, cmd
diff --git a/packages/tui/pkg/client/generated-client.go b/packages/tui/pkg/client/generated-client.go
index a108357d7..63623db54 100644
--- a/packages/tui/pkg/client/generated-client.go
+++ b/packages/tui/pkg/client/generated-client.go
@@ -603,7 +603,7 @@ func (a *MessageInfo_Metadata_Tool_AdditionalProperties) UnmarshalJSON(b []byte)
var fieldVal interface{}
err := json.Unmarshal(fieldBuf, &fieldVal)
if err != nil {
- return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err)
+ return fmt.Errorf("error unmarshalling field %s: %w", fieldName, err)
}
a.AdditionalProperties[fieldName] = fieldVal
}
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx
index 0671f49f6..73001e2ed 100644
--- a/packages/web/src/components/Share.tsx
+++ b/packages/web/src/components/Share.tsx
@@ -444,7 +444,7 @@ function MarkdownPart(props: MarkdownPartProps) {
{...rest}
>
<MarkdownView
- data-elment-markdown
+ data-element-markdown
markdown={local.text}
ref={(el) => (divEl = el)}
/>
@@ -726,7 +726,7 @@ export default function Share(props: {
for (let i = 0; i < messages().length; i++) {
const msg = messages()[i]
- // TODO: Cleaup
+ // TODO: Cleanup
// const system = result.messages.length === 0 && msg.role === "system"
const assistant = msg.metadata?.assistant
diff --git a/packages/web/src/components/share.module.css b/packages/web/src/components/share.module.css
index 37fce65eb..f094bda56 100644
--- a/packages/web/src/components/share.module.css
+++ b/packages/web/src/components/share.module.css
@@ -659,12 +659,12 @@
}
&[data-expanded="true"] {
- [data-elment-markdown] {
+ [data-element-markdown] {
display: block;
}
}
&[data-expanded="false"] {
- [data-elment-markdown] {
+ [data-element-markdown] {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;