Compare commits
No commits in common. "34f705aef8d829c741212c6f12d292ac97979fef" and "78487f1c24becbdee05b046128b5fdae14662cc0" have entirely different histories.
34f705aef8
...
78487f1c24
1 changed files with 12 additions and 16 deletions
|
@ -126,7 +126,6 @@ serial connection the editor normally runs under.")
|
|||
|
||||
|
||||
(defun move-cursor (row col)
|
||||
(assert (and (integerp row) (integerp col)))
|
||||
(write-byte #x1B *eio*)
|
||||
(write-char #\[ *eio*)
|
||||
(format *eio* "~D;~DH" row (1+ col))
|
||||
|
@ -422,8 +421,17 @@ Additionally ensures correct line numbers on the way, as a bonus."
|
|||
:do (ensure-correct-line-number line))
|
||||
(let ((line-number (view-line-number (buffer-view buffer)
|
||||
(cursor-line (cursor buffer)))))
|
||||
(when (null line-number)
|
||||
(get-line-into-view (cursor-line (cursor buffer)) (buffer-view buffer))
|
||||
;; the ugly (of many, one)
|
||||
(when (null line-number) ; line is off-screen
|
||||
(if (and (not (null (bottom-line (buffer-view buffer))))
|
||||
(eql (next-line (bottom-line (buffer-view buffer)))
|
||||
(cursor-line (cursor buffer))))
|
||||
(setf (top-line (buffer-view buffer))
|
||||
(next-line (top-line (buffer-view buffer)))
|
||||
(bottom-line (buffer-view buffer)) nil)
|
||||
(setf (top-line (buffer-view buffer)) (cursor-line (cursor buffer))
|
||||
(bottom-line (buffer-view buffer)) nil))
|
||||
(redisplay-view (buffer-view buffer))
|
||||
(setf line-number (view-line-number (buffer-view buffer)
|
||||
(cursor-line (cursor buffer)))))
|
||||
(move-cursor line-number (cursor-column (cursor buffer)))))
|
||||
|
@ -466,7 +474,7 @@ Additionally ensures correct line numbers on the way, as a bonus."
|
|||
((%buffer :accessor buffer :initarg :buffer)
|
||||
(%top-line :accessor top-line :initform nil)
|
||||
(%bottom-line :accessor bottom-line :initform nil)
|
||||
(%height :accessor height :initform 23)))
|
||||
(%height :accessor height :initform 20)))
|
||||
|
||||
(defmacro do-view-lines ((line local-line-number) view &body body)
|
||||
`(loop :repeat (height ,view)
|
||||
|
@ -545,18 +553,6 @@ Additionally ensures correct line numbers on the way, as a bonus."
|
|||
(redisplay-line (top-line view))
|
||||
(redisplay-status-line :completely-p t))
|
||||
|
||||
(defmethod get-line-into-view ((line line) (view buffer-view))
|
||||
;; Assuming it's not already.
|
||||
(update-view-bottom view)
|
||||
(cond ((eql line (prev-line (top-line view)))
|
||||
(scroll-view-up view))
|
||||
((eql line (next-line (bottom-line view)))
|
||||
(scroll-view-down view))
|
||||
(t
|
||||
(setf (top-line view) line)
|
||||
(redisplay-view view)))
|
||||
(redisplay-status-line :completely-p nil))
|
||||
|
||||
(defmethod current-view ((obj editor))
|
||||
(buffer-view (current-buffer obj)))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue