| ... | ... | @@ -115,14 +115,18 @@ function inferHomeFromCwd(cwd: string): string | undefined { |
| 115 | 115 | return undefined; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | | function splitPathAndPosition(value: string): { path: string; line?: string; column?: string } { |
| 118 | function splitPathAndPosition(value: string): { |
| 119 | path: string; |
| 120 | line: string | undefined; |
| 121 | column: string | undefined; |
| 122 | } { |
| 119 | 123 | let path = value; |
| 120 | 124 | let column: string | undefined; |
| 121 | 125 | let line: string | undefined; |
| 122 | 126 | |
| 123 | 127 | const columnMatch = path.match(/:(\d+)$/); |
| 124 | 128 | if (!columnMatch?.[1]) { |
| 125 | | return { path }; |
| 129 | return { path, line: undefined, column: undefined }; |
| 126 | 130 | } |
| 127 | 131 | |
| 128 | 132 | column = columnMatch[1]; |
| ... | ... | @@ -176,10 +180,7 @@ export function resolvePathLinkTarget(rawPath: string, cwd: string): string { |
| 176 | 180 | } |
| 177 | 181 | |
| 178 | 182 | export function preferredTerminalEditor(): EditorId { |
| 179 | | const fallback = |
| 180 | | EDITORS.find((editor) => editor.command)?.id ?? |
| 181 | | EDITORS[0]?.id ?? |
| 182 | | "cursor"; |
| 183 | const fallback = EDITORS.find((editor) => editor.command)?.id ?? EDITORS[0]?.id ?? "cursor"; |
| 183 | 184 | |
| 184 | 185 | if (typeof window === "undefined") { |
| 185 | 186 | return fallback; |