We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85919c4 commit b07e8fbCopy full SHA for b07e8fb
ivy-file-preview.el
@@ -209,10 +209,11 @@ If CURRENT-OV is non-nil it create overlay that are currently selected."
209
(defun ivy-file-preview--open-file (fn pos)
210
"Open the file path (FN) and move to POS.
211
If POS is nil then it won't moves."
212
- (let ((is-fild-p t))
+ (let ((is-fild-p t) (just-fn (f-filename fn)))
213
(cond ((file-exists-p fn) (find-file fn))
214
((not ivy-file-preview-details) (setq is-fild-p nil))
215
- ((find-buffer-visiting fn) (switch-to-buffer fn))
+ ((or (find-buffer-visiting fn) (get-buffer just-fn))
216
+ (switch-to-buffer just-fn))
217
(t (setq is-fild-p nil)))
218
(if (not is-fild-p)
219
(setq ivy-file-preview--selected-file "")
0 commit comments