Using scrolling, avoid redrawing editor screen after deleting a line

This commit is contained in:
John Lorentzson 2025-07-31 11:05:49 +02:00
parent 6f6a800897
commit 62c19a38d8

View file

@ -384,7 +384,20 @@ serial connection the editor normally runs under.")
(replace (line-content left-line) (line-content right-line)
:start1 start)
(delete-line right-line)
(redisplay-view-from-line (current-view *editor*) left-line)
(let ((view (current-view *editor*)))
(update-view-bottom view)
(cond ((and (line-in-view left-line view)
(< (1+ (view-line-number view left-line))
(height view)))
(redisplay-line left-line)
(set-scrolling-region (1+ (view-line-number view left-line))
(height view))
(scroll-screen-up)
(set-scrolling-region)
(unless (null (bottom-line view))
(redisplay-view-from-line view (bottom-line view))))
(t
(redisplay-view-from-line (current-view *editor*) left-line))))
(setf (cursor-line (cursor *editor*)) left-line
(cursor-column (cursor *editor*)) start)
(update-buffer-cursor (current-buffer *editor*))))))