Skip to content

Commit

Permalink
Fix invocation of phpactor by moving its parameters definitions
Browse files Browse the repository at this point in the history
Before this commit, some parameters definitions happened while being
wrapped by "with-current-buffer" which produced unexpected results.

This commit also removes a now useless cmd variable.
  • Loading branch information
kermorgant committed Jul 27, 2018
1 parent 3f8dc20 commit a64d3db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions phpactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@
(phpactor--add-history 'phpactor--rpc (list action arguments))
(let ((json (json-encode (list :action action
:parameters arguments)))
(cmd (phpactor--make-command-string "rpc"
(format "--working-dir=%s" (phpactor-get-working-dir))))
(json-object-type 'plist)
(json-array-type 'list)
(output (get-buffer-create "*Phpactor Output*")))
(output (get-buffer-create "*Phpactor Output*"))
(cwd (phpactor-get-working-dir))
(phpactor-executable (phpactor-find-executable)))
(with-current-buffer output (erase-buffer))
(with-current-buffer (get-buffer-create "*Phpactor Input*")
(erase-buffer)
(insert json)
(call-process-region (point-min) (point-max) (phpactor-find-executable) nil output nil "rpc" (format "--working-dir=%s" (phpactor-get-working-dir)))
(call-process-region (point-min) (point-max) phpactor-executable nil output nil "rpc" (format "--working-dir=%s" cwd))
(with-current-buffer output
(goto-char (point-min))
(json-read-object)))))
Expand Down

0 comments on commit a64d3db

Please sign in to comment.