This allows a config function to be registered
in the atom.coffee file to support different wrap
guide columns depending on the type of file being
viewed.
Previously, we were rendering every prefix of the dot-separated scope as its own class. So the scope meta.delimiter.method.period.coffee would make a token w/ classes:
class="meta, meta-delimiter, meta-delimiter-method, meta-delimiter-method-period…"
Now we just give the token each piece of the scope as a class:
class="meta delimiter method period coffee"
We lose a bit of meaning, in that a scope selector method.period.coffee would match this element in CSS even though it *wouldn't* in TextMate. But we also gain the behavior where longer prefixes are more specific by naturally producing more specific css selectors. So '.meta.delimiter.method' is always more specific than '.meta.delimiter', whereas '.meta-delimiter-method' ties with '.meta-delimiter'.
If prefix ambiguities become a problem later we may need to revisit this approach, but I think it's good enough for now.
The tokenizer emits individual tokens with arrays of scopes, rather than a more tree-like structure. It's debatable whether we want to emit scope trees rather than token streams in general, though that might complicate things like line wrapping. For now, we're reconstructing the tree during rendering based on information that's implicit in the tokens.
Flexbox was causing layouts and repaints to cover the entire scroll view instead of just the edited line. This cuts down on DOM manipulation cost significantly.
Previously, we were assuming that when uncommenting, that every line would match the comment regex. But this might not be the case. If the first line in the selection is commented but some subsequent lines aren't, they won't match the comment regex. So this commit guards for that case.
Previously if a file was a single line
it couldn't be deleted using the delete
line command because the start row would
index one row back which would be -1 and
therefore not be able to report a length
for use in the delete range.