Fix highlight for atoms containing @ character#512
Open
w-sanches wants to merge 1 commit intoelixir-editors:masterfrom
w-sanches:wsa-fix-highlight-atom-with-at
Open
Fix highlight for atoms containing @ character#512w-sanches wants to merge 1 commit intoelixir-editors:masterfrom w-sanches:wsa-fix-highlight-atom-with-at
w-sanches wants to merge 1 commit intoelixir-editors:masterfrom
w-sanches:wsa-fix-highlight-atom-with-at
Conversation
Collaborator
|
Is the only thing stopping this from getting merged the conflicts, or is there something wrong with the commit? I'd be happy to fix the conflicts. |
I think
I got this error: Elixir's syntax reference for atoms mentions that unquoted atoms should start with unicode letters or an underscore and then it supports numbers and at symbols ( I think the following regex can match unquoted atoms: I would use a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
\wand@matched chars.@nifoc @jbodah please take at look at this. Any inputs are welcome.