mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2026-09-10 07:46:51 -04:00
Fix rect mark mess up in unselected windows
* lisp/rect.el (rectangle--highlight-for-redisplay): Move `save-excursion' inside `with-selected-window' to ensure it always takes effect. (Bug#81451)
This commit is contained in:
parent
a1fa371488
commit
6534d67a1f
32
lisp/rect.el
32
lisp/rect.el
|
|
@ -868,16 +868,16 @@ Ignores `line-move-visual'."
|
|||
(eq (nth 5 rol) (point)))
|
||||
rol)
|
||||
(t
|
||||
(save-excursion
|
||||
(let* ((pt (point))
|
||||
(nrol nil)
|
||||
(old (if (eq 'rectangle (car-safe rol))
|
||||
(nthcdr 6 rol)
|
||||
(funcall redisplay-unhighlight-region-function rol)
|
||||
nil)))
|
||||
(cl-assert (eq (window-buffer window) (current-buffer)))
|
||||
;; `rectangle--pos-cols' looks up the `selected-window's parameter!
|
||||
(with-selected-window window
|
||||
(let* ((pt (point))
|
||||
(nrol nil)
|
||||
(old (if (eq 'rectangle (car-safe rol))
|
||||
(nthcdr 6 rol)
|
||||
(funcall redisplay-unhighlight-region-function rol)
|
||||
nil)))
|
||||
(cl-assert (eq (window-buffer window) (current-buffer)))
|
||||
;; `rectangle--pos-cols' looks up the `selected-window's parameter!
|
||||
(with-selected-window window
|
||||
(save-excursion
|
||||
(let* ((cols (rectangle--pos-cols start end))
|
||||
(startcol (car cols))
|
||||
(endcol (cdr cols))
|
||||
|
|
@ -976,12 +976,12 @@ Ignores `line-move-visual'."
|
|||
(and (zerop (forward-line 1))
|
||||
(bolp)
|
||||
(<= (point) end-pt))))
|
||||
)
|
||||
)
|
||||
(mapc #'delete-overlay old)
|
||||
`(rectangle ,(buffer-chars-modified-tick)
|
||||
,start ,end ,(rectangle--crutches) ,pt
|
||||
,@nrol))))))
|
||||
))
|
||||
)
|
||||
(mapc #'delete-overlay old)
|
||||
`(rectangle ,(buffer-chars-modified-tick)
|
||||
,start ,end ,(rectangle--crutches) ,pt
|
||||
,@nrol)))))
|
||||
|
||||
(defun rectangle--unhighlight-for-redisplay (orig rol)
|
||||
(if (not (eq 'rectangle (car-safe rol)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue