mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Merge 5e0d258a3c into 83397ebde2
This commit is contained in:
commit
3e58f51079
1 changed files with 12 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import {
|
|||
type Component,
|
||||
} from "solid-js"
|
||||
import { Dynamic } from "solid-js/web"
|
||||
import open from "open"
|
||||
import path from "path"
|
||||
import { useRoute, useRouteData } from "@tui/context/route"
|
||||
import { useSync } from "@tui/context/sync"
|
||||
|
|
@ -71,6 +72,14 @@ import { DialogSubagent } from "./dialog-subagent.tsx"
|
|||
|
||||
addDefaultParsers(parsers.parsers)
|
||||
|
||||
/**
|
||||
* Handle alt+click or ctrl+click on links in markdown content
|
||||
* Opens URLs in the default browser
|
||||
*/
|
||||
function handleLinkClick(url: string) {
|
||||
open(url).catch(() => {})
|
||||
}
|
||||
|
||||
class CustomSpeedScroll implements ScrollAcceleration {
|
||||
constructor(private speed: number) {}
|
||||
|
||||
|
|
@ -1347,6 +1356,7 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass
|
|||
content={"_Thinking:_ " + content()}
|
||||
conceal={ctx.conceal()}
|
||||
fg={theme.textMuted}
|
||||
onLinkClick={handleLinkClick}
|
||||
/>
|
||||
</box>
|
||||
</Show>
|
||||
|
|
@ -1367,6 +1377,7 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess
|
|||
content={props.part.text.trim()}
|
||||
conceal={ctx.conceal()}
|
||||
fg={theme.text}
|
||||
onLinkClick={handleLinkClick}
|
||||
/>
|
||||
</box>
|
||||
</Show>
|
||||
|
|
@ -1600,6 +1611,7 @@ ToolRegistry.register<typeof WriteTool>({
|
|||
filetype={filetype(props.input.filePath!)}
|
||||
syntaxStyle={syntax()}
|
||||
content={code()}
|
||||
onLinkClick={handleLinkClick}
|
||||
/>
|
||||
</line_number>
|
||||
</Show>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue