punassuming / ranger.el

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

deer-jump-other-window opening wrong directory #149

Open mclearc opened 7 years ago

mclearc commented 7 years ago

deer-jump-other-window doesn't seem to properly fetch the present working directory of the current buffer before opening a deer buffer in another window, as one would expect. Instead, a deer buffer is opened in the other window, but with the directory of one of my other open buffers, not the directory of the buffer from which the command deer-jump-other-window was called. I think this may be due to a recent update of the deer-jump-other-window function, but I'm not sure. Any ideas? Thanks!

mclearc commented 7 years ago

Just to clarify:

  (defun deer-jump-other-window (&optional path)
    "Launch dired in a minimal ranger window in other window."
    (interactive)
    (switch-to-buffer-other-window (current-buffer))
    (deer path))

Seems to work as expected while

 (defun deer-jump-other-window (&optional path)
   "Launch dired in a minimal ranger window in other window."
   (interactive)
   (switch-to-buffer-other-window nil 'norecord)
   (deer path))

does not. I believe the latter version of the function is what is currently in the package.