diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-26 10:50:17 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-26 10:51:29 -0400 |
commit | 750ad1884586628c5aa7fca7a23411035ce26a42 (patch) | |
tree | 4aa129cc6a0b882735520f95717940abe7f8ce22 /src | |
parent | 5c0b01fd887ff5043e196a0e21f03d547e65a98b (diff) | |
download | rneovim-750ad1884586628c5aa7fca7a23411035ce26a42.tar.gz rneovim-750ad1884586628c5aa7fca7a23411035ce26a42.tar.bz2 rneovim-750ad1884586628c5aa7fca7a23411035ce26a42.zip |
vim-patch:8.2.3050: cannot recognize elixir files
Problem: Cannot recognize elixir files.
Solution: Recognize Elixir-specific files. Check if an .ex file is Euphoria
or Elixir. (Austin Gatlin, closes vim/vim#8401, closes vim/vim#8446)
https://github.com/vim/vim/commit/f3caeb63d62c08b579e9b5f40b35e8bf64dde87a
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 71a7a2cce5..202177053a 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -161,6 +161,8 @@ let s:filename_checks = { \ 'ecd': ['file.ecd'], \ 'edif': ['file.edf', 'file.edif', 'file.edo'], \ 'elinks': ['elinks.conf'], + \ 'elixir': ['file.ex', 'file.exs', 'mix.lock'], + \ 'eelixir': ['file.eex', 'file.leex'], \ 'elm': ['file.elm'], \ 'elmfilt': ['filter-rules'], \ 'epuppet': ['file.epp'], @@ -765,5 +767,41 @@ func Test_pp_file() filetype off endfunc +func Test_ex_file() + filetype on + + call writefile(['arbitrary content'], 'Xfile.ex') + split Xfile.ex + call assert_equal('elixir', &filetype) + bwipe! + let g:filetype_euphoria = 'euphoria4' + split Xfile.ex + call assert_equal('euphoria4', &filetype) + bwipe! + unlet g:filetype_euphoria + + call writefile(['-- filetype euphoria comment'], 'Xfile.ex') + split Xfile.ex + call assert_equal('euphoria3', &filetype) + bwipe! + + call writefile(['--filetype euphoria comment'], 'Xfile.ex') + split Xfile.ex + call assert_equal('euphoria3', &filetype) + bwipe! + + call writefile(['ifdef '], 'Xfile.ex') + split Xfile.ex + call assert_equal('euphoria3', &filetype) + bwipe! + + call writefile(['include '], 'Xfile.ex') + split Xfile.ex + call assert_equal('euphoria3', &filetype) + bwipe! + + call delete('Xfile.ex') + filetype off +endfunc " vim: shiftwidth=2 sts=2 expandtab |