FiraCode icon indicating copy to clipboard operation
FiraCode copied to clipboard

Ligature request: Swift \(

Open pxeger opened this issue 4 years ago • 7 comments

In Swift, \( is used for string interpolation:

var name = "Tim McGraw"
"Your name is \(name)"

(source)

Could a ligature be added for this?

pxeger avatar Dec 30 '20 16:12 pxeger

Sure! Do you have ideas how it might look like?

tonsky avatar Dec 30 '20 16:12 tonsky

The backslash and the opening parenthesis could be squished together so that the end of the slash merges with the tip of the parenthesis, something like:

image

pxeger avatar Dec 30 '20 17:12 pxeger

This would conflict with regexps

alexeyten avatar Dec 30 '20 17:12 alexeyten

In LaTeX, \( ... \) is used for the inline math environment. Hence, if \( gets added, I would expect a similar ligature for \) as well, so that it looks symmetric.

jwortmann avatar Jan 03 '21 23:01 jwortmann

Agreed. Heck, why not \[ and \] have their own ligatures, too? And a whole set of ligatures for regex e.g. (?=, etc (I suck at memorizing regex lookbehind/ahead so correct me if I'm wrong :sweat_smile:).

ThatXliner avatar Feb 27 '21 22:02 ThatXliner

This would conflict with regexps

Would it be better if these two symbols just get closer but not connected?

yvvt0379 avatar Jul 21 '21 06:07 yvvt0379