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: \( and \) #536

Closed
mikelward opened this issue Jan 6, 2018 · 2 comments
Closed

Ligature request: \( and \) #536

mikelward opened this issue Jan 6, 2018 · 2 comments

Comments

@mikelward
Copy link

mikelward commented Jan 6, 2018

Backslashes are used in basic regular expressions to denote special meaning. I think it would be much easier to read if the backslashed characters were ligatures.

Mockup using U+0952 or U+0332:

image

Ligatures to consider:

  • \(
  • \)
  • \+
  • \*
  • \{
  • \}
  • numbers??
@tonsky
Copy link
Owner

tonsky commented Jan 7, 2018

I agree reading backslashed chars is hard, and the problem is worth solving. I have some constraints though:

  • the resulting text should be exactly the same width for indentation not to change
  • Shouldn’t be too confusing, i.e. should be easy to figure out what the original text was
  • We don’t want false negatives (masking a char in the wrong context, in our example, render backslash as an escape character when it’s really not, e.g. in Windows file paths)

What I’m thinking right now is maybe making it thinner, and ignore if backslash is followed by another backslash immediately. From what I’ve seen backslashes are pretty much exclusively escape characters, with the exception of windows paths. I’ll give it some more thought, thanks!

@cpitclaudel
Copy link

From what I’ve seen backslashes are pretty much exclusively escape characters, with the exception of windows paths. I’ll give it some more thought, thanks!

This change doesn't look great for Coq/F*/etc, which use \/ (∨) for logical or and /\ for logical and (∧). (Iosevka has ligatures for these two). It doesn't work too well for Haskell either, which uses it for anonymous functions (\x -> x + 1) :: Num a => a -> a

I'm not sure how to fix these. Ignoring \ when preceded with a slash will break cases like sed 's/\(abc\)/xyz/g'; so would turning /\ into a ligature; for Haskell, it isn't clear that there's a valid ignore pattern, except for (\, and then that would look weird when used as an actual escape.

Not sure what the solution is.

robfrawley pushed a commit to robfrawley/fonts-firacode that referenced this issue Jul 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants