From fd93f005ad5ab07ede910bd3172376f45d7134ad Mon Sep 17 00:00:00 2001 From: Nathan McCamish <176253562+nmccamish@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:59:46 -0500 Subject: [PATCH] Deduplicate compute-line calls --- src/ext/line-numbers.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ext/line-numbers.lisp b/src/ext/line-numbers.lisp index f0c25f905..7fc0c769f 100644 --- a/src/ext/line-numbers.lisp +++ b/src/ext/line-numbers.lisp @@ -68,8 +68,9 @@ With a positive universal argument, use relative line numbers. Also obey the glo (defmethod lem-core:compute-left-display-area-content ((mode line-numbers-mode) buffer point) (when (buffer-filename (point-buffer point)) - (let* ((string (format nil (variable-value 'line-number-format :default buffer) (compute-line buffer point))) - (attribute (if (eq (compute-line buffer point) + (let* ((computed-line (compute-line buffer point)) + (string (format nil (variable-value 'line-number-format :default buffer) computed-line)) + (attribute (if (eq computed-line (compute-line buffer (buffer-point buffer))) `((0 ,(length string) active-line-number-attribute)) `((0 ,(length string) line-numbers-attribute)))))