punassuming / ranger.el

Bringing the goodness of ranger to dired!
699 stars 52 forks source link

deer-jump-other-window: restore previous buffer? #135

Open dieggsy opened 7 years ago

dieggsy commented 7 years ago

It would be nice if deer-jump-other-window would restore the buffer that was there before (if there was one), or otherwise close the window it created on ranger-close.

Currently, it does this thing where regardless of whether there's previously one or two windows, you end up with two windows of the same buffer.

punassuming commented 7 years ago

@therockmandolinist, I just submitted some commits which help some of the behavioral issues with deer-jump. Give it a try.

dieggsy commented 7 years ago

@ralesi now i just end up with a messages buffer regardless of whether i had a buffer open in the other window (or whether there was another window at all)

punassuming commented 7 years ago

This is because of the behaviour of 'other-window' I will add a check for when there are no other windows. Do you have this issue with multiple windows open?

dieggsy commented 7 years ago

The behavior for opening deer in other window is the same whether I previously had one or multiple windows open - when I q out, the other window sticks around and goes to some other buffer, not the one it was previously at. Doesn't close if there was no other window before either, just goes to the same buffer.

dieggsy commented 7 years ago

I don't know if this helps, but the ideal behavior is pretty much exactly that of the *Help* buffer (like describe-variable, describe-function, etc).

dieggsy commented 7 years ago

@ralesi Seems like some of the recent commits fixed this, so thanks!

There is another thing though, when deer-jump-other-window is called with a buffer already open in other-window, the following error arises: Debugger entered--Lisp error: (void-variable oth-buf). It still works as expected, regardless. Any thoughts? Should I open a separate issue?

dieggsy commented 7 years ago

i'm actually unable to reproduce this for now, although there's still a reference to the undefined variable oth-buf in deer-jump-other-window.