Skip to content

Commit ece9fc6

Browse files
authored
Merge pull request #365 from elixir-editors/dont-highlight-operators-mid-identifier
syntax: match and/or/in/not as operators only if they are entire words
2 parents 23856d8 + e3dbca3 commit ece9fc6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

spec/syntax/operator_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ def foo(bar // :baz)
2222
:queue.in x, 5
2323
EOF
2424
end
25+
26+
it 'does not highlight operators inside of elixirIds' do
27+
expect(<<~EOF).not_to include_elixir_syntax('elixirOperator', 'in')
28+
incoming
29+
EOF
30+
end
2531
end

syntax/elixir.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ syn keyword elixirSelf self
3636
" This unfortunately also matches function names in function calls
3737
syn match elixirUnusedVariable contained '\v%(^|[^.])@<=<_\w*>'
3838

39-
syn match elixirOperator '\v\.@<!%(and|or|in|not)'
39+
syn match elixirOperator '\v\.@<!<%(and|or|in|not)>'
4040
syn match elixirOperator '!==\|!=\|!'
4141
syn match elixirOperator '=\~\|===\|==\|='
4242
syn match elixirOperator '<<<\|<<\|<=\|<-\|<'

0 commit comments

Comments
 (0)