Skip to content

Commit

Permalink
Check result items instead of MSG arg
Browse files Browse the repository at this point in the history
  • Loading branch information
10sr committed Sep 2, 2020
1 parent d98199c commit 5aef823
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fuzzy-finder.el
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ This function sets current buffer to BUF, and returns created window."
(switch-to-buffer buf)
new-window))

(cl-defun fuzzy-finder--after-term-handle-exit (_ msg)
(cl-defun fuzzy-finder--after-term-handle-exit (&rest _)
"Call the action function when fuzzy-finder program terminated normally.
Should be hooked to `term-handle-exit'.
Use MSG to check if fuzzy-finder process exited with code 0."
Should be hooked to `term-handle-exit'."
(unless fuzzy-finder--output-file
(cl-return-from fuzzy-finder--after-term-handle-exit))

Expand All @@ -156,7 +155,7 @@ Use MSG to check if fuzzy-finder process exited with code 0."
(lines (split-string text output-delimiter t)))
(delete-file output-file)
(set-window-configuration fuzzy-finder--window-configuration)
(when (string= "finished\n" msg)
(when lines
(with-current-buffer buf
(funcall action lines)))))
(advice-add #'term-handle-exit
Expand Down

0 comments on commit 5aef823

Please sign in to comment.