the-kenny / weechat.el

Chat via weechat's relay protocol in Emacs
177 stars 41 forks source link

do not split multiple lines of a bock of lines to send line by line #87

Open andrelkin opened 4 years ago

andrelkin commented 4 years ago

Multiple line blocks like in slack style a\n b\n c\n are sent line by line. I offered previously the following patch to improve such behaviour, and it works for me (worked for Kenny when he replied on irc).

--- weechat.el~ 2019-06-23 20:30:23.161300841 +0300
+++ weechat.el  2019-06-25 15:24:30.181065563 +0300
@@ -1419,7 +1419,7 @@
     (let ((input (weechat-get-input)))
       (unless (s-blank? input)
         ;; Split multiple lines and send one-by-one
-        (cl-dolist (l (split-string input "\n"))
+   (cl-dolist (l (list (replace-regexp-in-string "\n" "\r" input))) ;;(split-string input "\n"))
           ;; Pipe the input through the message filter system
           (let ((piped-input (weechat-pipe-input l)))
             (when (stringp piped-input)