Skip to content

Commit 5dde5f0

Browse files
committed
Fixed end.
1 parent b8cdde1 commit 5dde5f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ivy-file-preview.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ An optional argument INDEX is use to find current ivy candidate."
108108
(unless index (setq index ivy--index))
109109
(cond ((memq ivy-file-preview--this-command '(ivy-searcher-search-file
110110
ivy-searcher-search-project))
111-
(or (plist-get (nth index ivy-searcher--candidates) :end)
112-
(+ pos (length ivy-text))))
111+
(let* ((cand (nth index ivy-searcher--candidates))
112+
(plist-data (cdr cand))
113+
(end-pt (plist-get plist-data :end)))
114+
(or end-pt (+ pos (length ivy-text)))))
113115
(t (+ pos (length ivy-text)))))
114116

115117
(defun ivy-file-preview--project-path ()
@@ -197,7 +199,7 @@ If CURRENT-OV is non-nil it create overlay that are currently selected."
197199
(setq entered t))
198200
(when entered (setq break t)))
199201
(setq index (1+ index)))
200-
results))
202+
(reverse results)))
201203

202204
(defun ivy-file-preview--swap-current-overlay ()
203205
"Delete the previous selected overlay and swap with current selected overlay."

0 commit comments

Comments
 (0)