0

I tried several extensions and settings, but I was not able to make VSCode show all the EOLs (i.e. the file "as it is"), here is an example of the same few lines of a file as displayed by:

VSCode (unfaithful)

enter image description here

and Notepad++ (faithful)

enter image description here

In general I always prefer to see the file I'm editing "as it is", VSCode has nice colors and styles but it's unreasonable (especially if you deal with TeX) that it hides characters as it likes.

mmj
  • 5,514
  • 2
  • 44
  • 51
  • Does this answer your question? [Show line ends in vscode](https://stackoverflow.com/questions/52493127/show-line-ends-in-vscode) – Luuk Nov 19 '22 at 16:50
  • @Luuk No, the screenshots you see above were taken with the extension suggested in that answer enabled. – mmj Nov 19 '22 at 17:03

1 Answers1

1

I do think the ShowEOL

With setting like:

"showeol.eol.character.crlf": " [CRLF]",
"showeol.eol.character.lf": "[LF]",
"showeol.eol.color": "#229DCA",
"showeol.eof.color": "#229DCA"

give a pretty nice view, and I think the colors can be changed to you likings

enter image description here

EDIT: Multiple consecutive EOL's are rendered as single (according to comment), but how to reproduce this? (Screenshot was taken in Windows11)

enter image description here

Luuk
  • 12,245
  • 5
  • 22
  • 33
  • Unfortunately this extension is not able to faithfully show the content of the file, multiple consecutive EOLs are still rendered as a single EOL. – mmj Nov 19 '22 at 18:22
  • How is it reproducible that "multiple consecutive EOLs are still rendered as a single EOL" ? – Luuk Nov 20 '22 at 09:51
  • I disabled and reloaded all extensions except ShowEOL and I stil EOLs weren't showing, I closed and reopened VSCode and still EOLs weren't showed, then I closed just that single file from VSCode and when I reopened it I could see all EOLs. So I guess the problem is solved and ShowEOL extension works, but I don't know how to reproduce the issue. I guess the real issue is that VSCode is "too smart" and even when you reload all files or you close and reopen it, VSCode shows the content of some cache instead of the actual files, and that shouldn't happen. – mmj Nov 20 '22 at 15:32
  • Thanks for the clarification, it seems to be this question/answer that is involved: [How can I detect file change from outside in VSCode Extension?](https://stackoverflow.com/questions/68689993/how-can-i-detect-file-change-from-outside-in-vscode-extension), because **Visual Studio Code** does not detect when it should reload a file when it's contents are changed (and also not when it needs a reload because it should be displayed different... ) – Luuk Nov 20 '22 at 16:00
  • I don't expect VSCode to tell me when a file has changed and needs reloading, but I expect that it reloads it from file at least when I close and reopen the whole VSCode, but that did not happen. A "Reload file from disk" command when right-clicking the file tab would be useful too. – mmj Nov 20 '22 at 16:13
  • OK, I have `"window.restoreWindows": "none"`, so VSC does not remember which files I had open, and I need to re-open them when re-opening VSC. (edit: It's another setting I have set different.. but cannot find which one, on my site the files are reload on relaunch) – Luuk Nov 20 '22 at 16:32