Firacode: Something for `[x]`

Created on 11 Feb 2016  路  14Comments  路  Source: tonsky/FiraCode

I really like the box instead of [ ]. I think it would be nice if we have something for [x]. This would add an extra feature for writing a task list.

stylistic sets suggestion

Most helpful comment

what about using [*] instead of [x] ?

All 14 comments

:+1:

My only fear is that what if you're accessing a hash/array and the key/index is the x variable. This might not be a problem though because the brackets and the variable should be separate syntactic elements.

what about using [*] instead of [x] ?

@MadcapJake that's actually good point, I haven't thought of it. I was only thinking about it's use on Markdown.

The problem is that ligatures are defined in a language-agnostic way. This is a font, not a language, and I think we should be careful about whether a ligature is a good idea for most use cases or just isolated languages. Maybe this is what @tonsky will solve with stylistic sets, I don't know what they are yet.

In this particular one, I personally think that using x as variable name for an array index is not uncommon, and the result of making [x] look like a nicer checkbox would compromise the visual in most programming languages for myArray[x].

In GFM task lists, the check box needs to be preceded by a list marker and a space, i.e. - [ ], * [ ], + [ ] (and perhaps . [ ]). I don't know any programming language where these sequences with a fixed length of 5 characters would appear _regularly_.

Python can have both + [ ] and * [ ] as legal sequences, although I don鈥檛 know why I鈥檇 use either of them. The checked versions, + [x] and * [x], would both be more common.

I also think ligatures for GFM markdown checkboxes would be nice :
don't forget the checked boxes ...
- [ ], - [x], * [ ] & * [x]

Just floating the idea of using [*] again.. any takers?

PragmataPro has this already as a feature set.

FiraCode now makes it easier to control individual ligatures IIRC, so my main objection is gone as long as this is disabled by default (places where you'd be writing GFM are more likely to support OpenType features than places where you'd write programming languages where [x] is relevant is an array or index, I expect).

Just curious, what GFM stands for?

Will track progress in #993

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomByrer picture tomByrer  路  4Comments

aryairani picture aryairani  路  3Comments

Photonico picture Photonico  路  3Comments

miniBill picture miniBill  路  4Comments

Gang-Yang picture Gang-Yang  路  3Comments