Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triple-colon ligature in ss07 has odd cursor placement in specific scenarios #216

Open
TehPers opened this issue May 10, 2024 · 2 comments

Comments

@TehPers
Copy link

TehPers commented May 10, 2024

In vscode, the interaction between the triple-colon ligature from ss07 (:::) and red squigglies seems to cause issues with cursor placement. Under certain circumstances, the triple-colon ligature renders correctly, but the cursor treats it as two 1.5-wide colon characters and a single 0-width colon.

I've observed this issue in v1.100 and v1.101, but not in v1.000.

In this screenshot, the cursor is logically placed between the 1st and 2nd colon from the left, but visually appears in the middle of the 2nd colon:

329493627-04b163af-7411-4df0-9cef-1e8a3ad1a0a5

Moving the cursor right by 1 character places it at the end of the :::, and moving it right again doesn't visually move the cursor.

After moving it right once:

image

And again (no visual change):

image

It's also worth noting that this only seems to happen when red squigglies are involved on the right side of the triple-colon ligature:

image

This is with ss07 disabled:

image

This is from v1.000, which doesn't appear to have the ligature:

329494799-dcef3275-d021-462a-8184-03bcf93fad8f

Also, this seems to only happen with Monaspace's triple-colon ligature. Here's an example of how it looks with Fira Code and its ligatures enabled:

329495443-6578aaf9-1d8a-484f-8470-42c74dd309f5

(I had originally posted about this in the Nerd Fonts repo related to a different issue I had come across, but this appears to be Monaspace.)

@Finii
Copy link
Contributor

Finii commented May 10, 2024

Scribus seems to handle this correctly.
This is only when the red squiggels are there?

My VScode font setup is below, but I can not get these red things to appear, which language is that?

What I noticed is that the new ligs are 'backwards', while usually they are 'forward', hmm, but that should not make any difference.

image

image

@TehPers
Copy link
Author

TehPers commented May 11, 2024

@Finii Yes, it's only when there are red squigglies. It renders fine when there is no error being reported, and even in some other language when red squiggles are present. I'm using a Rust project. Should be possible to repro using a fresh project, after running cargo new.

Full repro:

  1. If you don't already have Rust setup, there may be a system package for it, or you could look at https://rustup.rs/ to get the toolchain.
  2. Setup vscode with the rust-lang.rust-analyzer extension.
  3. Run cargo new --bin monaspace-test to create a new project, and open that folder with vscode.
  4. In src/main.rs, write use crate:::foo; and save.
  5. Move cursor into the colons:

image

My relevant editor settings are:

{
  "editor.fontFamily": "'Monaspace Neon', Consolas, 'Courier New', monospace",
  "editor.fontLigatures": "'calt', 'liga', 'ss01', 'ss02', 'ss03', 'ss06', 'ss07'",
}

I was also able to confirm the issue happening with only the ss07 ligatures enabled ("editor.fontLigatures": "'ss07'"), and with only the above two editor settings enabled.

This is on Windows 11 23H2 using Monaspace Neon v1.101 (I double-checked the installed version) and vscode 1.89.1. Interestingly, this doesn't happen with TypeScript errors:

image

I'm not completely sure why this specifically happens with Rust. It may be where the errors are being marked by rust-analyzer. Here's the full list of problems it's reporting, if that's relevant:

image

I'm also wondering if this is an issue specifically with how vscode renders the text when squigglies are involved. To be honest, I don't even know how to begin debugging this kind of problem, or I'd try to offer more direction. If you do try the repro steps, let me know if you're unable to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants