Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Sep 28, 2023
1 parent dfeaee5 commit 4cc1659
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/ext/detective.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@
:navigate-reference

:move-to-reference)

#+sbcl
(:lock t))

(in-package :lem/detective)

(defclass reference ()
((name :type string
((name :type string
:initarg :reference-name
:reader reference-name)

Expand Down Expand Up @@ -168,7 +168,7 @@
(with-point ((p (buffer-start-point (point-buffer (current-point)))))
(loop :for point = (search-forward-regexp p (capture-regex-regex regex))
:while point
:collect (funcall (capture-regex-function regex)
:collect (funcall (capture-regex-function regex)
(copy-point point :temporary)
class)))))
(with-accessors ((function-regex search-function-regex)
Expand All @@ -183,7 +183,7 @@
(cons (cons "packages" package-regex) :package-reference)
(cons (cons "variables" variable-regex) :variable-reference)
(cons (cons "misc" misc-regex) :misc-reference))))

(setf (buffer-references (current-buffer))
(make-hash-table :test 'equal))

Expand Down Expand Up @@ -244,16 +244,16 @@
(let ((closest (%closest-reference))
(current-expression
(lem:with-point ((p point))
(funcall
(variable-value 'lem/language-mode:beginning-of-defun-function :buffer)
p 1) p)))

(if (= (line-number-at-point (car closest))
(line-number-at-point current-expression))
(find (car closest)
(cdr closest)
:key #'reference-point :test #'point=)
(message "Not inside a reference."))))
(funcall (variable-value 'lem/language-mode:beginning-of-defun-function :buffer)
p 1)
p)))

(if (= (line-number-at-point (car closest))
(line-number-at-point current-expression))
(find (car closest)
(cdr closest)
:key #'reference-point :test #'point=)
(message "Not inside a reference."))))

(defun %closest-reference (&key (direction :up))
(let* ((references (buffer-references (current-buffer)))
Expand Down

0 comments on commit 4cc1659

Please sign in to comment.