scholtzm / punk

⚡ Alternative cross-platform Steam client for desktop
MIT License
100 stars 29 forks source link

No line breaks in chat logs using default text editor #39

Closed mxamber closed 7 years ago

mxamber commented 7 years ago

I tried the program today for the purpose of having chatlogs created automatically (instead of having to copy everything manually), and when I checked the log, I found that it had no line breaks when opened with the default text editor (notepad.exe). Like, none at all. Neither between posts, nor line breaks within one post. It does work when using an alternative editor, like npp.

I've no idea whether this is an issue with the Windows text editor or a problem with Punk. My best guess is that you developed the program on Mac or Linux and those OS use a different way to encode line breaks than Windows does?

punk line breaks

punk no line breaks

scholtzm commented 7 years ago

Yes, indeed. Punk uses \n for line breaks which is not displayed properly when using standard Notepad.exe.

For the time being, you can use some other editor, e.g. Notepad++.

I'll think about using CRLF on Windows instead of LF.

scholtzm commented 7 years ago

Just looking at it right now, this will be a very easy fix:

https://nodejs.org/api/os.html#os_os_eol https://github.com/scholtzm/punk/blob/master/src/plugins/chat-logger/index.js#L37

scholtzm commented 7 years ago

Fixed in https://github.com/scholtzm/punk/commit/4fdd4ea787a9114c205cf36f292c7e1113ea987e