Skip to content

Commit

Permalink
add two editor variables to line-numbers, line-number-formatand curre…
Browse files Browse the repository at this point in the history
…nt-line-value

add two editor variables to line-numbers, `line-format` and `custom-current-line`. they allow the user to set the line format and choose a custom current line if they want.

for example :

`(setf (variable-value 'line-number-format :global) "~2D ")`

for a narrow line-number column. and

`(setf (variable-value 'custom-current-line :global) "->")`

for a current-line indicator of `->`
  • Loading branch information
SequentialDesign committed Dec 6, 2024
1 parent 4d5417e commit 4cf730a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ext/line-numbers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ With a positive universal argument, use relative line numbers. Also obey the glo
(defun compute-line (buffer point)
(if *relative-line*
(let ((cursor-line (line-number-at-point (buffer-point buffer)))
(line (line-number-at-point point)))
(line (line-number-at-point point))
(custom-line (variable-value 'custom-current-line :default buffer)))
(if (= cursor-line line)
(if (variable-value 'custom-current-line)
(variable-value 'custom-current-line :default buffer)
(if custom-line
custom-line
line)
(abs (- cursor-line line))))
(line-number-at-point point)))
Expand Down

0 comments on commit 4cf730a

Please sign in to comment.