emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

lsp-ui showing ^M on Windows #271

Open parbo opened 5 years ago

parbo commented 5 years ago

Is it possible to get rid of the ^M chars in the lsp-ui popups (docs and peek):

image

davels commented 4 years ago

The problem is when peek reads a file off disk. It splits lines with "\n". The fix is:

--- d:/home/.emacs.d/elpa/lsp-ui-20190523.1521/lsp-ui-peek.el
+++ #<buffer lsp-ui-peek.el>
@@ -345,7 +345,7 @@
                            chunk)
                          (subst-char-in-string ?\t ?\s it)
                          (concat header it)
-                         (split-string it "\n")))
+                         (split-string it "[\r\n]+")))
           (list-refs (->> lsp-ui-peek--list
                           (--remove (lsp-ui-peek--prop 'lsp-ui-peek-hidden it))
                           (-drop lsp-ui-peek--offset)