Fix the approch to updating the view buffer

This commit is contained in:
Sameer Rahmani 2023-06-19 00:27:31 +01:00
parent 881700af70
commit 4ee2db929c
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
1 changed files with 5 additions and 3 deletions

View File

@ -156,9 +156,11 @@ It will pass WATCH-PARAMS to the unit's `:fn'"
(let ((res (apply f watch-params)))
(with-current-buffer buf
(save-excursion
(goto-char (+ 1 start-point))
(delete-char len)
(insert (truncate-string-to-width res len))))))
(let ((txt (truncate-string-to-width res len)))
(replace-region-contents
(+ 1 start-point)
(+ 1 start-point len)
(lambda () (string-pad (truncate-string-to-width res len) len))))))))
(defun noether--make-updater (buf f start-point len)