xonecas.io
62159
Sy

symb / commit 78cfb44

fix: remove outdated code

xonecas2026-02-17 78cfb446e8d252dc90b57b8e4126a060c2c850ce parent c8758d9

3 files changed

config.toml+1−1
@@ -1,7 +1,7 @@
11 # Symb Configuration File
22
33 # Default provider (optional - if not set, first provider in map is used)
4-default_provider = "zen-opus"
4+default_provider = "zen-codex"
55
66 # Ollama providers (local)
77 [providers.ollama-qwen]
internal/tui/mouse.go+5−29
@@ -9,7 +9,6 @@ import (
99
1010 tea "charm.land/bubbletea/v2"
1111 "charm.land/lipgloss/v2"
12- "github.com/charmbracelet/x/ansi"
1312 "github.com/xonecas/symb/internal/highlight"
1413 )
1514
@@ -225,10 +224,9 @@ func (m Model) translateMouse(msg tea.MouseMsg, offX, offY int) tea.Msg {
225224
226225 // isClickableLine returns true if the wrapped line at lineIdx is clickable.
227226 // Tool result entries (first line only, which has the [view] button) and undo
228-// entries are always clickable. Plain text lines are clickable only if they
229-// contain a file path reference.
227+// entries are always clickable.
230228 func (m *Model) isClickableLine(lineIdx int) bool {
231- lines := m.wrappedConvLines() // ensures convLineSource is also fresh
229+ m.wrappedConvLines() // ensures convLineSource is also fresh
232230 src := m.convLineSource
233231 if lineIdx < 0 || lineIdx >= len(src) {
234232 return false
@@ -250,17 +248,13 @@ func (m *Model) isClickableLine(lineIdx int) bool {
250248 case entryToolDiag, entryToolCall, entrySeparator:
251249 return false
252250 default:
253- // Plain text: clickable if it contains a file path.
254- if lineIdx >= len(lines) {
255- return false
256- }
257- return filePathRe.MatchString(ansi.Strip(lines[lineIdx]))
251+ return false
258252 }
259253 }
260254
261255 // handleConvClick resolves a click on a wrapped conversation line.
262256 // Tool result [view] buttons open the relevant content in the editor.
263-// Undo buttons trigger an undo. Plain text file paths open the file.
257+// Undo buttons trigger an undo.
264258 func (m *Model) handleConvClick(wrappedLine, col int) tea.Cmd {
265259 m.wrappedConvLines() // ensure convLineSource is fresh
266260 src := m.convLineSource
@@ -291,12 +285,7 @@ func (m *Model) handleConvClick(wrappedLine, col int) tea.Cmd {
291285 return nil
292286
293287 default:
294- // Plain text: try to open a file path reference.
295- lines := m.wrappedConvLines()
296- if wrappedLine >= len(lines) {
297- return nil
298- }
299- return m.tryOpenFilePath(ansi.Strip(lines[wrappedLine]))
288+ return nil
300289 }
301290 }
302291
@@ -388,19 +377,6 @@ func (m *Model) showRawContent(content, language string) {
388377 m.setFocus(focusEditor)
389378 }
390379
391-// tryOpenFilePath looks for a file:line reference in text and opens it in the editor.
392-func (m *Model) tryOpenFilePath(text string) tea.Cmd {
393- matches := filePathRe.FindStringSubmatch(text)
394- if matches == nil {
395- return nil
396- }
397- path := matches[1]
398- lineNum := 0
399- if matches[2] != "" {
400- lineNum, _ = strconv.Atoi(matches[2])
401- }
402- return m.openFile(path, lineNum)
403-}
404380
405381 // openFile loads a file into the editor. path is relative to cwd.
406382 func (m *Model) openFile(path string, lineNum int) tea.Cmd {
internal/tui/tui.go+0−3
@@ -139,9 +139,6 @@ var toolResultLineRe = regexp.MustCompile(`\(lines\s+(\d+)-\d+\)`)
139139 // toolResultRangeRe extracts both start and end lines from "(lines N-M)".
140140 var toolResultRangeRe = regexp.MustCompile(`\(lines\s+(\d+)-(\d+)\)`)
141141
142-// filePathRe matches file references like "path/to/file.go:123" or just "path/to/file.go".
143-// Requires a '/' to avoid matching version numbers like "v1.0".
144-var filePathRe = regexp.MustCompile(`(?:^|[\s(])([a-zA-Z0-9_./-]*[/][a-zA-Z0-9_.-]+\.[a-zA-Z]\w*)(?::(\d+))?`)
145142
146143 // ---------------------------------------------------------------------------
147144 // Conversation selection (character-level)