Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Sep 26, 2023
1 parent 0cfe567 commit 4bd1d63
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/ext/link.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,24 @@
(unless (end-line-p point)
(character-offset point -1))
(let ((file (points-to-string link-start point)))
(multiple-value-bind (matched-string groups)
(looking-at point ":(\\d+)(?::(\\d+))?")
(cond (matched-string
(character-offset point (length matched-string))
(let ((line-number (elt groups 0))
(charpos (elt groups 1)))
(when (probe-file file)
(multiple-value-bind (matched-string groups)
(looking-at point ":(\\d+)(?::(\\d+))?")
(cond (matched-string
(character-offset point (length matched-string))
(let ((line-number (elt groups 0))
(charpos (elt groups 1)))
(make-instance 'file-link
:file file
:line-number (parse-integer line-number)
:charpos (when charpos (parse-integer charpos))
:start link-start
:end point)))
(t
(make-instance 'file-link
:file file
:line-number (parse-integer line-number)
:charpos (when charpos (parse-integer charpos))
:start link-start
:end point)))
(t
(make-instance 'file-link
:file file
:start link-start
:end point))))))))))
:end point)))))))))))

(defun search-url-link (point &optional limit)
(when (search-forward-regexp point "https?://" limit)
Expand Down

0 comments on commit 4bd1d63

Please sign in to comment.