Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pi-coding-agent-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,19 @@ Returns \"text\" for unrecognized extensions to ensure consistent fencing."
(or (cdr (assoc ext pi-coding-agent--extension-language-alist))
"text"))))

(defun pi-coding-agent-browse-url-at-point ()
"Browse the markdown link URL at or near point."
(interactive)
(let* ((pos (point))
(line (buffer-substring-no-properties
(line-beginning-position) (line-end-position)))
;; Find the link text nearest to point on this line
(url (when (string-match "(\\(https?://[^)]+\\))" line)
(match-string 1 line))))
(if url
(browse-url url)
(user-error "No URL found on this line"))))

;;;; Major Modes

(defvar pi-coding-agent-chat-mode-map
Expand All @@ -452,6 +465,7 @@ Returns \"text\" for unrecognized extensions to ensure consistent fencing."
(define-key map (kbd "<tab>") #'pi-coding-agent-toggle-tool-section)
(define-key map (kbd "RET") #'pi-coding-agent-visit-file)
(define-key map (kbd "<return>") #'pi-coding-agent-visit-file)
(define-key map (kbd "C-c C-o") #'pi-coding-agent-browse-url-at-point)
map)
"Keymap for `pi-coding-agent-chat-mode'.")

Expand Down
Loading