Skip to content

Commit

Permalink
Fix comments on the end of lines.
Browse files Browse the repository at this point in the history
Fixes #176
  • Loading branch information
kassio committed Sep 13, 2016
1 parent 30e2203 commit 32a1027
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions spec/syntax/comments_spec.rb
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'Comments syntax' do
it 'full line comment' do
expect(<<~EOF).to include_elixir_syntax('elixirComment', '#\ this\ is\ a\ comment')
# this is a comment
EOF
end

it 'end line comment' do
expect(<<~EOF).to include_elixir_syntax('elixirComment', '#\ this\ is\ a\ comment')
IO.puts "some text" # this is a comment
EOF
end
end
2 changes: 1 addition & 1 deletion syntax/elixir.vim
Expand Up @@ -13,7 +13,7 @@ syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,e
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration

syn match elixirComment '^\s*#.*' contains=elixirTodo,@Spell
syn match elixirComment '#.*' contains=elixirTodo,@Spell
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained

syn keyword elixirKeyword case when with cond for if unless try receive send
Expand Down

0 comments on commit 32a1027

Please sign in to comment.