code-eol icon indicating copy to clipboard operation
code-eol copied to clipboard

The symbol is displayed left to cursor in tab indented files

Open drtyrsa opened this issue 5 years ago • 6 comments

I'm editing a file using tabs for indentation (Golang, Makefile any other where code style requires it).

image

So far so good. And then I press enter and get this image

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) image

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.

drtyrsa avatar Mar 19 '19 13:03 drtyrsa

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.

jeff-hykin avatar Mar 20 '19 06:03 jeff-hykin

It is Makefile, and I have a similar problem with Go. And almost fresh installation of VSCode.

drtyrsa avatar Mar 20 '19 08:03 drtyrsa

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.

shungo27 avatar Jul 20 '19 19:07 shungo27

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.

jeff-hykin avatar Jul 28 '19 01:07 jeff-hykin

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.

shungo27 avatar Jul 29 '19 16:07 shungo27

Thanks, that helps. I guess I'll try to figure out the difference between those fonts.

jeff-hykin avatar Jul 29 '19 16:07 jeff-hykin