Skip to content

Commit

Permalink
Merge pull request #22 from DeX3/master
Browse files Browse the repository at this point in the history
Fix import-js breaking when json-encoding-pretty-print is set
  • Loading branch information
kevinkehl authored Jul 9, 2018
2 parents 0a10328 + 6930be6 commit fb1f167
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugin/import-js.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@
(unless import-js-process
(throw 'import-js-daemon "import-js-daemon not running")))

(defun import-js-json-encode-alist (alist)
(let ((json-encoding-pretty-print nil))
(json-encode-alist alist)))

(defun import-js-send-input (input-alist)
"Append the current buffer content and path to file to a data alist, and send to import-js"
(let ((input-json (json-encode-alist (append input-alist `(("fileContent" . ,(buffer-string))
("pathToFile" . ,(buffer-file-name)))))))
(let ((input-json (import-js-json-encode-alist (append input-alist
`(("fileContent" . ,(buffer-string))
("pathToFile" . ,(buffer-file-name)))))))
(process-send-string import-js-process input-json)
(process-send-string import-js-process "\n")))

Expand Down

0 comments on commit fb1f167

Please # to comment.