ranger.el
ranger.el copied to clipboard
Ranger open same file existing in other windows will overwrite the existing window
Description
If Emacs with split windows,open the same file existing in other windows will overwrite the exsiting window.
Reproduction
-
Start Emacs
-
split window
-
open the same file using dired or ranger
-
split windows are merged
Observed behaviour
split windows are mereged
Expected behaviour
Do not merge split windows
Found the solution, overwriting the ranger-disable
function. We probly should add a custom variable for users to select the behavior, e.g. ranger-merge-opened-buffers-if-existing-in-windows
.
(defun ranger-disable ()
"Interactively disable ranger-mode."
(interactive)
(ranger-revert))
This is an issue only in deer-mode right?
Yes, because we probly will not open two ranger buffers at the same time
It happens and is a use case I need to figure out (two ranger frames). Just to clarify, would you like opening the file just focus the existing buffer window and not close deer?
I do like open two deer buffers at the same time. For example, I can do copy pasting files between these two deer buffers.
I've noticed deer can create multiple tabs. But I prefer open multiple deer buffers.
I have another issue with current behavior of deer-mode
when opening the same file. After the split window is deleted because ranger is opening the same file, do a deer
on the buffer to go to deer-mode
will trigger a warning:
file changed on disk; really edit the buffer? (y, n, r or C-h)
The buffer is not changed at all. I guess ranger
misread the buffer state in this case.
And there is no way to get out of this. I find @ztlevi's solution fixed my problem.
I am using Spacemacs
so it could be Spacemacs
's issue, but I doubt it.
Thanks