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

Ligature request: /** #202

Closed
yvvt0379 opened this issue Apr 9, 2020 · 13 comments
Closed

Ligature request: /** #202

yvvt0379 opened this issue Apr 9, 2020 · 13 comments
Labels
unicode request Request for adding more symbols
Milestone

Comments

@yvvt0379
Copy link

yvvt0379 commented Apr 9, 2020

In JavaScript and some other languages, /** marks the beginning of a doc comment, e.g.

/**
 * Represents a book.
 *
 * @param {string} title Title of the book
 * @param {string} author Who wrote the book
 */
function Book(title, author) {
    this.title = title;
    this.author = author;
}

However, the * in /* is on the top, but /** is just / plus **. Isn't there a ligature for /**?
(English is not my mother language, so I may have some difficulty expressing my idea exactly.)
批注 2020-04-09 190032

@philippnurullin
Copy link
Member

Hi, it was removed because of this issue #88

@yvvt0379
Copy link
Author

I came up with a better solution: if /* or /** follows or is followed by any character that matches this regex \w|\.|/, then disable it. Is it feasible? (I just realized that email reply don't support markdown😅)

@philippnurullin
Copy link
Member

Sadly this will be really hard to make in OpenType. There is no way to make complex rule as this. To work it needs "clear" instructions on every case.
I will try to think of a way, but don't see a better solution that removing the /**.

@yvvt0379
Copy link
Author

OK, I see.

@philippnurullin philippnurullin added the unicode request Request for adding more symbols label Apr 10, 2020
@trygveaa
Copy link

Hi, it was removed because of this issue #88

Hm, I don't see why that issue would cause a difference between /* and /**. Shouldn't the same rules apply for those two?

@yvvt0379
Copy link
Author

yvvt0379 commented Apr 11, 2020 via email

@philippnurullin
Copy link
Member

Here is discussion about this ligature from Fira Code community tonsky/FiraCode#367

The problem i see here is tonsky/FiraCode#219 & it will affect the case @BornForFever set as example.

I agree with Nikita (Tonsky) here. Removing /** seems like a good compromise.

@tomByrer
Copy link

Removing /** seems like a good compromise.

I think so also.
Unless there is a way to detect the beginning of lines in OpenType?
Or as a compromise to the compromise, is the have only the italic version have the ligature (since comments are almost always italics).?

@philippnurullin
Copy link
Member

@tomByrer but it won't fix the problem with shifted asterisks. It's a main problem.

@trygveaa
Copy link

Unless there is a way to detect the beginning of lines in OpenType?

I think doing something specific when it's the beginning of the line is a bad idea. Comments are often indented, and would be weird if that's different from the beginning of the line.

@yvvt0379
Copy link
Author

It might be a good idea to turn those ligatures off for /*/ and /**/ (and perhaps /*.)

Is it possible?

@philippnurullin
Copy link
Member

@BornForFever The /*/, /**/ sequence removed in 1.0.6 This will be the next update.

@philippnurullin philippnurullin added this to the v2.002 milestone Jul 16, 2020
@philippnurullin philippnurullin modified the milestones: v2.200, v2.3000 Oct 21, 2020
philippnurullin added a commit that referenced this issue Jan 22, 2021
- Added exclusion in -> ligature to look reasonable in negative arguments for C++ <1-> #107
- /** brought back #202
- */ /* aligned to match *  #215
- Added multiline bracket characters ⎛ ⎞ ⎝ ⎠ ⎜ #290
- Fixed Powerline arrows height #395
@philippnurullin
Copy link
Member

Added back this ligature. Grab the files here https://github.com/JetBrains/JetBrainsMono/tree/master/fonts
Added some exclusions so the #88 woun't be a problem. If you find more conflicts feel free to create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unicode request Request for adding more symbols
Projects
None yet
Development

No branches or pull requests

4 participants