mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
Fix error on small buffers
This commit is contained in:
parent
b12fcff9fa
commit
ece42ec82b
1 changed files with 6 additions and 1 deletions
|
@ -224,7 +224,12 @@ contains the patch."
|
||||||
(let ((new-window-line
|
(let ((new-window-line
|
||||||
(count-lines (window-start w) (point))))
|
(count-lines (window-start w) (point))))
|
||||||
(with-selected-window w
|
(with-selected-window w
|
||||||
(scroll-down (- old-window-line new-window-line))))))))
|
;; Sometimes if the text is less than a buffer long, and
|
||||||
|
;; we do a deletion, it might not be possible to keep the
|
||||||
|
;; vertical position of point the same by scrolling.
|
||||||
|
;; That's okay. We just go as far as we can.
|
||||||
|
(ignore-errors
|
||||||
|
(scroll-down (- old-window-line new-window-line)))))))))
|
||||||
|
|
||||||
(defvar apheleia--current-process nil
|
(defvar apheleia--current-process nil
|
||||||
"Current process that Apheleia is running, or nil.
|
"Current process that Apheleia is running, or nil.
|
||||||
|
|
Loading…
Add table
Reference in a new issue