Function: ghostel--deactivate-repainted-region

ghostel--deactivate-repainted-region is a natively compiled function defined in ghostel.el.

Signature

(ghostel--deactivate-repainted-region)

Documentation

Deactivate the region when the last redraw rewrote part of it.

Terminal output replaces text in place, so the selection would be left covering text the user never selected. An empty region is kept, as is line mode's: it repaints the whole buffer on every redraw. The primary selection keeps the text that was actually selected.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel--deactivate-repainted-region ()
  "Deactivate the region when the last redraw rewrote part of it.
Terminal output replaces text in place, so the selection would be left
covering text the user never selected.  An empty region is kept,
as is line mode's: it repaints the whole buffer on every redraw.
The primary selection keeps the text that was actually selected."
  (when-let* (((region-active-p))
              ((not (eq ghostel--input-mode 'line)))
              ((/= (region-beginning) (region-end)))
              (repainted ghostel--repainted-region)
              ((< (region-beginning) (cdr repainted)))
              ((> (region-end) (car repainted))))
    (with-demoted-errors "ghostel: deactivate-mark error: %S"
      (let ((select-active-regions nil))
        (deactivate-mark)))))