Add method to get the last line of a buffer
This commit is contained in:
parent
0451b5b7d1
commit
b7dea0f333
1 changed files with 5 additions and 0 deletions
|
@ -454,6 +454,11 @@ serial connection the editor normally runs under.")
|
||||||
(buffer-view instance) (make-instance 'buffer-view :buffer instance)
|
(buffer-view instance) (make-instance 'buffer-view :buffer instance)
|
||||||
(top-line (buffer-view instance)) (first-line instance)))
|
(top-line (buffer-view instance)) (first-line instance)))
|
||||||
|
|
||||||
|
(defmethod last-line ((buffer buffer))
|
||||||
|
(loop :for line := (first-line buffer) :then (next-line buffer)
|
||||||
|
:until (null (next-line line))
|
||||||
|
:finally (return line)))
|
||||||
|
|
||||||
(defmethod buffer-string ((buffer buffer))
|
(defmethod buffer-string ((buffer buffer))
|
||||||
"Returns a string equivalent to BUFFER's contents."
|
"Returns a string equivalent to BUFFER's contents."
|
||||||
(with-output-to-string (output)
|
(with-output-to-string (output)
|
||||||
|
|
Loading…
Add table
Reference in a new issue