Skip to content

Commit

Permalink
add two editor variables to line-numbers
Browse files Browse the repository at this point in the history
this patch adds two editor variables to line-numbers, `line-format` and `current-line-display-function`.  this allows the user to change the width/format of the line numbers and to set the current-line display in relative numbers.

for example :
```
(setf (variable-value 'line-number-format :global) "~2D ")
(setf (variable-value 'current-line-display-function :global) (lambda () 0))
```

now the line-numbers will be narrower and the current-line will always be 0.
  • Loading branch information
SequentialDesign committed Dec 5, 2024
1 parent 4aa462a commit 02a3963
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ext/line-numbers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ two-character line-number column.")

(define-editor-variable current-line-display-function
(lambda () (line-number-at-point (current-point)))
"Set to desired current-line display when relative line numbers are active, for example, (lambda () 0) or (lambda () (string \" ->\")).")
"Set to desired current-line display when relative line numbers are
active, for example, (lambda () 0) or (lambda () (string \" ->\")).")

(define-attribute line-numbers-attribute
(t :foreground :base07 :background :base01))
Expand Down

0 comments on commit 02a3963

Please sign in to comment.