benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
400 stars 29 forks source link

Respect multiple frames (incl. mini frames) when finding the window displaying the target buffer #67

Open MattMicheletti opened 2 years ago

MattMicheletti commented 2 years ago

For the function vr--target-window, its call to get-buffer-window should use the second argument to respect multi frame Emacs configurations as well for packages like maple-minibuffer. Otherwise visual-regexp will throw an error when called and sort of break (replacing still works but the UI of visual-regexp kind of goes haywire as overlays stick around, etc.).

Recommend replacement (incl. changing the if with when for better readability):

(defun vr--target-window ()
  (when vr--target-buffer
      (get-buffer-window vr--target-buffer 'visible)))

Thoughts?

Thanks for a great package BTW! :)

benma commented 2 years ago

Can you provide a step by step instruction on how to produce the bug/break?

Can you make a PR?