Skip to content

Commit

Permalink
[Part of #1110] Don't remove all newlines of ESS commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Feb 10, 2021
1 parent 983c54b commit 6dc6831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lisp/ess-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ nil and not t, query for each instance."
nil))

(defun ess--strip-final-newlines (string)
(replace-regexp-in-string "\n+" "" string))
(replace-regexp-in-string "\n+$" "" string))


;;*;; Debugging tools
Expand Down
7 changes: 7 additions & 0 deletions test/ess-test-inf.el
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ Needed with slow-responding processes."

;; There should be no output after the early exit or async restoration
:inf-result "")

(etest-deftest-r ess-command-newlines-test ()
"`ess-command' doesn't garble new lines (#1110)."
:eval ((should (string= (ess--strip-final-newlines "1\n2")
"1\n2"))
(should (equal (ess-get-words-from-vector "{ 'foo'\n'bar'\n }\n")
(list "bar")))))

;;*;; Inferior interaction

Expand Down

0 comments on commit 6dc6831

Please sign in to comment.