Fix highlight for atoms containing @ character #512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #510
In eb06df6 I used a regexp that was matching too many things. I completely forgot that spaces are also printable characters 🤦♂
This PR comes with a new version using
[^\d0-\d127]
to match those special characters. This will:á ó é
;ಠ
which are valid in an atom like:ಠ‿ಠ
;Elixir actually accepts any UTF-8 letter as atoms and Vim does not support Unicode modifiers AFAIK, so using something like
\p{L}
is not possible 😞I went with the route of adding any non-ASCII on top of words and @s as it gave us more positive results and the false-positives will raise errors when compiled, so they are easily fixable. I still can't decide by myself if we should add those false-positives or not.
WDYT?
The other option would be to remove support for accents and other UTF-8 characters and only highlight those atoms with
\w
and@
matched chars.@nifoc @jbodah please take at look at this. Any inputs are welcome.