code-eol
code-eol copied to clipboard
The symbol is displayed left to cursor in tab indented files
I'm editing a file using tabs for indentation (Golang, Makefile any other where code style requires it).
So far so good. And then I press enter and get this
Notice that the cursor isn't aligned properly, but padded right. It's rather annoying. Expected behavior is like this (here I use spaces, not tabs)
Interestingly all the line ending extensions I tried share this problem.
Is it easy to fix? I it is, I could try it myself.
Thanks for your work.
Hmm I'm not sure what exactly is happening here. (and I'm having a hard time reproducing it) What language are you using?
My current guess is that the language has a auto-indent functionality when you press enter, and somehow the auto indent is messing with the appending of the ending character.
There is probably a rough/hacky but quick way to solve this by re-rendering that line or all of the visible lines. (If you want to try this yourself).
That definitely looks like an annoying/important problem though. I originally created this fork because of a similar issue with the original.
Sadly I probably won't be able to look into this until this summer (~May). I've got a lot of planned changes for this repo around May though.
It is Makefile, and I have a similar problem with Go. And almost fresh installation of VSCode.
same problem. But I found the cause and the solution.
The cause is probably using non-english font. I had a problem using Japanese fonts. Solved by changing editor.fontFamily as follows.
"editor.fontFamily": "English-font, your-font",
my setting: "editor.fontFamily": "'Iosevka SS05','Ricty Diminished'", Ricty Diminished is Japanese font
However, I want to fix this problem with code-eol.
Thanks @shungo27 this should help me reproduce the bug so I can start trying things myself. I agree you shouldn't be expected to change your font for the extension to work. Do you have any other hunches about why this would happen? I don't know much about fonts much less non-English fonts.
Just as a general explanation, the extension finds the newline/eol character(s) and then places a decoration "after" (to the right of) the them. The cursor being positioned after the newline ... should mean its on the next line. I'm starting to wonder if this is a problem with VS Code.
I don't know why, but the font seems to make a difference.
"Ricty Diminished" have this problem. "M+ 1mn" have not this problem. Both are Japanese fonts.
Thanks, that helps. I guess I'll try to figure out the difference between those fonts.