Open ztlevi opened 5 years ago
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
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![image|591x500](https://emacs-china.org/uploads/default/optimized/2X/c/cc69ad2326989fd8e1d9f44c5b6df8d40f7a7e39_1_591x500.png)
Observed behaviour
split windows are mereged
Expected behaviour
Do not merge split windows