Closed NimoTh closed 6 years ago
For me windows are reused, i.e. first time I press ENTER
a new window is opened and then that window is reused on further accesses. Which version of emacs are you using?
Might be some setting you have related to compilation-mode
possibly?
Try to load emacs without your init.el
file to get a vanilla emacs: emacs -Q -l rg.el
Does the same happen?
I tried with emacs -Q -l s.el -l rg.el
. Using latest rg.el
from elpa (20180116.9). I can reproduce the "issue" -- with a twist. The behavior I described only occurs when the Emacs frame is on my secondary display! (WTF?) My MacBook (macOS 10.13.2 (17C205)) is the primary display. When the Emacs frame is on that display, windows are reused even with when loading my custom init.el
(.emacs
in my case). Once I move the frame to my secondary display, which is my monitor, a new window is opened for every different file/buffer when using Enter
or the mouse to select a match (next-error works fine)
emacs -Q -l s.el -l rg.el
.emacs.d/elpa/rg-20180116.9/rg.el
rg
with search string require
, file type elisp
, directory .emacs.d/elpa
next-error
to visit matches; all matches are shown in the same window, even matches in other filesEnter
or mouse-click on a match in a file which is currently not displayed in any window
Expected: same as using next-error
, i.e. reuse existing window.
Actual: a new window is opened to visit the bufferAny ideas?
This seems to be some internal problelm with how emacs displays windows in your setup. I know that compilation-mode
that rg-mode
is based on is using other-window
to show the buffer in some other window than what is current. How that is actually implemented I don't know.
I suggest you try to debug the different next-error defuns in compile.el and the window display code.
It might help to see when this happens, e.g. will it happen from pure compilation buffers, if you use emacs built in grep
or rgrep
etc.
Sorrry I can't help you more. I don't think it's a problem with this package. That should be easy to check by testing with grep
for instance.
Yes, you're right. rgrep has the same issue. Thanks for the hint. I will investigate further in that direction.
Cheers!
Currently, rg opens a new window for every file when I press
Enter
in the*rg*
buffer. I would prefer rg to only open a new window once when I visit a result. rg should then reuse that newly opened window when I pressEnter
on another result. Is that possible?